我是一个新的Flutter 翼和学习关于行和列类.我正在try 向列中添加一个容器,但它引发了错误.
void main(){
runApp(
const Myapp()
);
}
class Myapp extends StatelessWidget {
const Myapp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: Scaffold(
backgroundColor: Colors.teal,
body: SafeArea(
child: Column(
children: <Widget>[
Text('Text 1'),
Container(
height: 100,
width: 100,
color: Colors.blue,
child: Text('Text 2'),
)
],
)
),
),
);
}
}
I am getting errors when I add container as a child in column. Here are the errors :
我正在遵循一个教程,并做同样的仍然得到错误. 谢谢您抽时间见我.