Flutter基础widgets教程-CupertinoButton篇

简介: Flutter基础widgets教程-CupertinoButton篇

1 CupertinoButton

ios风格的按钮

2 构造函数

CupertinoButton({
    Key key,
    @required this.child,
    this.padding,
    this.color,
    this.disabledColor = CupertinoColors.quaternarySystemFill,
    this.minSize = kMinInteractiveDimensionCupertino,
    this.pressedOpacity = 0.4,
    this.borderRadius = const BorderRadius.all(Radius.circular(8.0)),
    @required this.onPressed,
})

复制

3 常用属性

3.1 padding:内边距

padding: EdgeInsets.fromLTRB(),

复制

3.2 color:可用时按钮颜色

color: Colors.green,

复制

3.3 disabledColor:不可用时按钮颜色

disabledColor: Colors.blue,

复制

3.4 minSize:按钮最小尺寸

minSize: 40.0,

复制

3.5 pressedOpacity:按下时按钮透明度是原来的多少,不能大于1

pressedOpacity: 0.2,

复制

3.6 borderRadius:按钮圆角大小

borderRadius: BorderRadius.all(Radius.circular(8.0)),

复制

3.7 onPressed:按下回调

onPressed: (){},
相关文章
Flutter基础widgets教程-FlutterLogo篇
Flutter基础widgets教程-FlutterLogo篇
132 0
Flutter基础widgets教程-OverflowBox篇
Flutter基础widgets教程-OverflowBox篇
309 0
Flutter基础widgets教程-OverflowBox篇
Flutter基础widgets教程-LinearProgressIndicator篇
Flutter基础widgets教程-LinearProgressIndicator篇
222 0
Flutter基础widgets教程-CupertinoTabView篇
Flutter基础widgets教程-CupertinoTabView篇
254 0
|
Android开发
Flutter基础widgets教程-MaterialApp篇
Flutter基础widgets教程-MaterialApp篇
150 0
Flutter基础widgets教程-LimitedBox篇
Flutter基础widgets教程-LimitedBox篇
179 0
Flutter基础widgets教程-ConstrainedBox篇
Flutter基础widgets教程-ConstrainedBox篇
122 0
|
iOS开发
Flutter基础widgets教程-CupertinoTabScaffold篇
Flutter基础widgets教程-CupertinoTabScaffold篇
218 0
|
Android开发
Flutter基础widgets教程-ListTile篇
Flutter基础widgets教程-ListTile篇
126 0
|
iOS开发
Flutter基础widgets教程-CupertinoNavigationBar篇
Flutter基础widgets教程-CupertinoNavigationBar篇
232 0