【问题标题】:Expected an identifier Flutter需要一个标识符 Flutter
【发布时间】:2021-06-29 17:50:08
【问题描述】:

我是一个初学者,我只是想建立一个按钮我做错了什么

RaisedButton(
        child: Text("Click Me"),
        elevation: 4.0,
        splashColor: Colors.blue,
        color: Theme.of(context).accentColor,
        onPressed: ()(
          
        ),
      ),

我试图从主文档中理解,但不明白任何人可以详细告诉我

I checked q&a like this but couldn't get enough info

【问题讨论】:

    标签: flutter dart button identifier


    【解决方案1】:

    您只需将 {} 用于回调函数

    RaisedButton(
        child: Text("Click Me"),
        elevation: 4.0,
        splashColor: Colors.blue,
        color: Theme.of(context).accentColor,
        onPressed: () {
        },
    )
    

    【讨论】:

    • 谢谢,我几分钟前才发现,我在笑上帝,我又犯了另一个问题,你能帮我解决这个问题吗?
    • 好的,很乐意为您提供帮助
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-07
    • 2018-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多