【问题标题】:why am i not able to use this( RaisedButton) keyword? [duplicate]为什么我不能使用这个(RaisedButton)关键字?
【发布时间】:2022-11-18 11:54:36
【问题描述】:

enter image description here我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字我无法使用这个关键字

我期待使用这个关键字

【问题讨论】:

    标签: java android flutter mobile widget


    【解决方案1】:

    它被 ElevatedButton 取代。 New Buttons and Button Themes

    【讨论】:

      【解决方案2】:

      RaisedButton 已弃用,由 ElevatedButton 取代:

      代替:

      RaisedButton(/*...*/),
      

      和:

      ElevatedButton(/*...*/),
      

      在此处检查所有新迁移:

      https://docs.flutter.dev/release/breaking-changes/buttons#context

      【讨论】:

        【解决方案3】:

        RaisedButton 已弃用。替换为ElevatedButton

        return MaterialApp(
              home: Scaffold(
                  body: Column(
                    children: <Widget>[
                      Text('question'),
                      ElevatedButton(
                        child: Text('answer1'),
                        onPressed: null,
                      ),
                    ],
                  ),
              ),
            );
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-03-20
          • 1970-01-01
          • 2019-06-22
          • 1970-01-01
          • 2012-06-10
          • 2018-02-11
          • 1970-01-01
          相关资源
          最近更新 更多