颤振 在堆栈小部件中定位类,不接受子属性



代码运行,但我收到一个错误,说"child"参数未定义。我试过扑动医生,一切都很好。我确实完成了颤振清理和颤振升级。

当我按下ctrl+空格键时,"child"参数simple也不会显示为来自interllesence的自动填充。

我不知道问题出在哪里。

Stack(
children: [
Container(
height: size.height - 27,
decoration: BoxDecoration(
color: kPrimaryColor,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(36),
bottomRight: Radius.circular(36),
),
),
),
Positioned(
bottom: -30.0,
left: 0,
right: 0,
// undefined error with 'child' here
child: Container(
margin: EdgeInsets.all(kDefaultPadding),
height: 54.0,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
color: Colors.white,
),
),
),
],

),

您的代码编译良好。这可能是由于代码其他部分的语法错误。因此,试着在其他部分找到它(或者把它粘贴到你的问题上(。

好的,它自己解决了。我重新启动了系统并重新安装了虚拟设备。我从pubspeck.yaml运行了"flutter clean"one_answers"get packages",现在运行良好。

最新更新