注意:前面的FlatButton等按钮背景色都是color,RawMaterialButton的背景色是fillColor
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'RawMaterialButton无默认样式的按钮', home: Scaffold( appBar: AppBar( title: Text('RawMaterialButton无默认样式的按钮'), ), body: RawMaterialButton( onPressed: () {}, child: Text('RawMaterialButton无默认样式的按钮'), //文字样式 textStyle: TextStyle(color: Colors.white), //背景色 fillColor: Colors.orange, //高亮时背景色 highlightColor: Colors.red, //阴影 highlightElevation: 10.0, //按下时水波纹颜色 splashColor: Colors.blue, //抗锯齿等级 clipBehavior: Clip.antiAlias, padding: EdgeInsets.all(20.0), ), )); } }
部分素材资源来源网站,本站提供免费下载,如有侵权请联系站长马上删除!