我现在被我正在尝试创建的小应用程序困住了。
当用户点击一个图标时,应该会得到一个带有 2 个按钮(确定和取消)的警报对话框,并且在警报框的主体中,有一个 Cupertino Picker。您将在下面找到代码。我收到此错误消息。
断言失败:第 85 行 pos 15:'children != null':不正确。
class Engage extends StatefulWidget {
Engage ({Key key}) : super(key:key);
@override
_EngageState createState() => _EngageState();
}
class _MyEngageState extends State<MyEngage> {
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(10.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[350])),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(3.0),
child: Container(
// margin: const EdgeInsets.all(30.0),
padding: const EdgeInsets.all(10.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[350])
),
child : Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
child: Column(
children: [
IconButton(
splashColor: Colors.lightGreenAccent,
icon : Image.asset('assets/icons/icon1',
height: iconHeighEngage,),
onPressed:(){
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text('TEST'),
content: Container(
height: 350,
child: Column(
children: <Widget>[
CupertinoPicker(),
FlatButton(
child: Text("OK"),
onPressed: () {
Navigator.pop(context);
},
)
],
),
));
});
},
),
Text('TEST')],
),
),