【发布时间】:2021-01-24 21:53:26
【问题描述】:
我有这门课,从其中一个例子中学习和改变
class SignUpView extends StatelessWidget {
const SignUpView({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
width: 400,
child: Card(
child: SignUpForm(),
),
),
),
);
}
}
但是如果我想放 children ,而不是 child,像这样
class SignUpView extends StatelessWidget {
const SignUpView({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
children: [
SizedBox(
width: 400,
child: Card(
child: SignUpForm(),
),
),
],
),
);
}
}
它说未定义命名参数children。
如果我想在 Center 容器中放置多个孩子怎么办?
【问题讨论】:
标签: flutter layout flutter-layout