lib/main.dart:90:15:错误:没有为类“_girisState”定义吸气剂“RaisedButton”。
我的代码
RaisedButton.icon(
onPressed: () {
_handleSignIn();
},
color: Colors.blue,
textColor: Colors.white,
label: Text("Google Giris Yap"),
icon: Icon(Icons.sentiment_very_satisfied),
),
RaisedButton(
child: Text("Daha Karpuz Kesecektik :("),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
},
我想我应该更改按钮,但这样做有问题,我不擅长 flutter 谁能帮忙?
我试着换成高架按钮,但没用
ElevatedButton
不具有与RaisedButton
完全相同的属性。
但是你可以像下面那样做你用 RaisedButton 做的一切
ElevatedButton(
onPressed: () {
_handleSignIn();
},
//Styles contains all the design related to button
style: ButtonStyle(
backgroundColor: MaterialStatePropertyAll(Colors.blue),
),
//Child is basically what you want to display inside button It can be Text, Row, Column, or Icon.
child: Row(
children: const [
Text("Google Giris Yap", style: TextStyle(color: Colors.white),),
Icon(Icons.sentiment_very_satisfied),
],
),
)