flutter 为什么我不能使用这个(RaisedButton)关键字?[duplicate]

eh57zj3b  于 2022-12-30  发布在  Flutter
关注(0)|答案(4)|浏览(545)
    • 此问题在此处已有答案**:

RaisedButton is debricated what is the alternative?(3个答案)
上个月关门了。
enter image description here im无法使用此关键字
我希望使用此关键字dim无法使用此关键字

xvw2m8pv

xvw2m8pv1#

RaisedButton已弃用,已替换为ElevatedButton
替换:

RaisedButton(/*...*/),

与:

ElevatedButton(/*...*/),

在此处检查所有新迁移:
https://docs.flutter.dev/release/breaking-changes/buttons#context

xnifntxz

xnifntxz2#

已弃用,已被ElevatedButton取代。新按钮和按钮主题

5rgfhyps

5rgfhyps3#

不推荐使用RaisedButton。请将其替换为ElevatedButton

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

gr8qqesn4#

Raised button已过时,请使用Elevated Button

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

相关问题