我正在尝试使用颤振(使用 Dart 2)构建应用程序。我收到一个我无法弄清楚的错误:
错误是在 child: new Center(
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Begin with a search...'),
actions: <Widget> [
new FlatButton(
child: new Text('Logout', style: new TextStyle(fontSize: 17.0, color: Colors.white)),
onPressed: _signOut,
)
]
),
body: new Container(
margin: EdgeInsets.symmetric(horizontal: 20.0),
child: new Center(
child: new Row(
children: <Widget>[
new TextField(
controller: _controller,
autofocus: true,
textAlign: TextAlign.start,
decoration: new InputDecoration(
prefixIcon: new Padding(
padding: const EdgeInsetsDirectional.only(end: 10.0),
child: new Icon(Icons.search),
),
border: …Run Code Online (Sandbox Code Playgroud)