小编Sam*_*m A的帖子

'需要 1 个必需参数,但找到 0 个'错误

我正在尝试使用颤振(使用 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)

dart flutter flutter-layout

7
推荐指数
1
解决办法
8346
查看次数

标签 统计

dart ×1

flutter ×1

flutter-layout ×1