高架按钮在身体条款中不用作为儿童的小部件
我试图在这个无状态的小部件中拥有一个高架的小部件。括号的层次结构还可以,但它并不认识到高架the的窗口小部件是儿童的参数
class buildProfileView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisSize: MainAxisSize.min,
children: [
Center(
child: CircleAvatar(
backgroundImage:
Image.network(controller.googleAccount.value?.photoUrl ?? '')
.image,
radius: 100,
),
),
Text(
controller.googleAccount.value?.displayName ?? '',
style: Get.textTheme.headline1,
),
Text(controller.googleAccount.value?.email ?? '',
style: Get.textTheme.bodyText1),
//),
],
child: ElevatedButton(
onPressed: () {},
child: Text('Continue to Main Menu'),
backgroundColor: Colors.blue,
),
),
);
}
}
I am trying to have an ElevatedButton widget in this stateless widget. The hierarchy of the brackets is ok but it is not recognizing the ElevatedButton widget being a parameter of child
class buildProfileView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisSize: MainAxisSize.min,
children: [
Center(
child: CircleAvatar(
backgroundImage:
Image.network(controller.googleAccount.value?.photoUrl ?? '')
.image,
radius: 100,
),
),
Text(
controller.googleAccount.value?.displayName ?? '',
style: Get.textTheme.headline1,
),
Text(controller.googleAccount.value?.email ?? '',
style: Get.textTheme.bodyText1),
//),
],
child: ElevatedButton(
onPressed: () {},
child: Text('Continue to Main Menu'),
backgroundColor: Colors.blue,
),
),
);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题在于代码 -
升高button
不超出列范围。它将
更多地是关于
didget 。
The issue lies on code-strucure
where
ElevatedButton
is out of the column scope.It will be
More about
Column
widget.是的,您不能将儿童和儿童财产分配给专栏。专栏将孩子带到[](正方形支架)内部的儿童街区。
Yeah you can't assign both child and children property to a Column. Column takes children so move ElevatedButton to children block inside [](square brackets).