Dart 颤振错误:_ScaffoldLayout自定义多子女布局委托忘记布局以下子项
在emulator上运行应用程序时引发未知异常:Dart 颤振错误:_ScaffoldLayout自定义多子女布局委托忘记布局以下子项,dart,flutter,Dart,Flutter,在emulator上运行应用程序时引发未知异常: The _ScaffoldLayout custom multichild layout delegate forgot to lay out the following child: 我正在使用flatter1.0.0和dart2.1.0 我试图在谷歌上查找,但找不到解决方案 这是我的密码: @override Widget build(BuildContext context) { return Scaffold(
The _ScaffoldLayout custom multichild layout delegate forgot to lay out the following child:
我正在使用flatter1.0.0
和dart2.1.0
我试图在谷歌上查找,但找不到解决方案
这是我的密码:
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Text Input Example"),
),
body: Column(
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child: Flexible(
child: TextField(
style: TextStyle(
color: Colors.black,
fontSize: 16.0
),
),
),
)
],
),
);
}
@覆盖
小部件构建(构建上下文){
返回脚手架(
appBar:appBar(
标题:文本(“文本输入示例”),
),
正文:专栏(
儿童:[
对齐(
对齐:对齐.bottomCenter,
儿童:灵活(
孩子:TextField(
样式:TextStyle(
颜色:颜色,黑色,
字体大小:16.0
),
),
),
)
],
),
);
}
尝试热重新加载或热重新启动我的应用程序时出现相同错误。
冷启动它(停止然后重新启动)修复了它。从代码中删除Flexible,它应该可以工作。您可以显示initState()的代码吗?如果将小部件从无状态更改为有状态,或者以其他方式更改,然后尝试重新加载,则可能会出现此问题。重启应用程序似乎可以解决这个问题。