前面介绍的按钮都是继承于 MaterialButton,而 MaterialButton都自带了一些样式,MaterialButton又是继承自RawMaterialButton,RawMaterialButton即无默认样式的按钮
注意:前面的FlatButton等按钮背景色都是color,RawMaterialButton的背景色是fillColor
01 | class MyApp extends StatelessWidget { |
03 | Widget build(BuildContext context) { |
05 | title: 'RawMaterialButton无默认样式的按钮' , |
08 | title: Text( 'RawMaterialButton无默认样式的按钮' ), |
10 | body: RawMaterialButton( |
12 | child: Text( 'RawMaterialButton无默认样式的按钮' ), |
14 | textStyle: TextStyle(color: Colors.white), |
16 | fillColor: Colors.orange, |
18 | highlightColor: Colors.red, |
20 | highlightElevation: 10.0, |
22 | splashColor: Colors.blue, |
24 | clipBehavior: Clip.antiAlias, |
25 | padding: EdgeInsets.all(20.0), |