[英]Flutter Positioned class inside stack widget, won't accept a child property
the code runs, but I get an error which says 'child' parameter is undefined.代码运行,但我收到一个错误,提示“child”参数未定义。 I tried flutter doctors, everything is fine.
我试过扑医生,一切都很好。 I did flutter clean, and flutter upgrade.
我做了颤振清洁和颤振升级。
the 'child' parameter simple doesn't show up with the auto fill from intellesence either when I press ctrl+spacebar.当我按 ctrl+spacebar 时,'child' 参数 simple 也不会与来自 intellesence 的自动填充一起显示。
I don't know what the issue is.我不知道是什么问题。
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,
),
),
),
],
),
Your code compiles well.你的代码编译得很好。 It may due to syntax errors in other parts of your code .
这可能是由于代码其他部分的语法错误造成的。 Thus try to find it out on other parts (or paste it to your question).
因此尝试在其他部分找到它(或将其粘贴到您的问题中)。
Ok, It got solved on it's own.好的,它自己解决了。 I restarted the system and reinstalled the virtual device.
我重新启动了系统并重新安装了虚拟设备。 I ran 'flutter clean' and 'get packages' from pubspeck.yaml, works fine now.
我从 pubspeck.yaml 运行了“flutter clean”和“get packages”,现在工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.