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教程-IconButton篇
Flutter基础widgets教程-IconButton篇
380 0
Flutter基础widgets教程-SizedBox篇
Flutter基础widgets教程-SizedBox篇
222 0
Flutter基础widgets教程-SizedBox篇
Flutter基础widgets教程-SizedOverflowBox篇
Flutter基础widgets教程-SizedOverflowBox篇
175 0
Flutter基础widgets教程-SizedOverflowBox篇
Flutter基础widgets教程-OverflowBox篇
Flutter基础widgets教程-OverflowBox篇
321 0
Flutter基础widgets教程-OverflowBox篇
Flutter基础widgets教程-Offstage篇
Flutter基础widgets教程-Offstage篇
223 0
|
iOS开发
Flutter基础widgets教程-CupertinoNavigationBar篇
Flutter基础widgets教程-CupertinoNavigationBar篇
241 0
|
iOS开发
Flutter基础widgets教程-CupertinoTabScaffold篇
Flutter基础widgets教程-CupertinoTabScaffold篇
224 0
Flutter基础widgets教程-ButtonBar篇
Flutter基础widgets教程-ButtonBar篇
159 0
Flutter基础widgets教程-CupertinoTabView篇
Flutter基础widgets教程-CupertinoTabView篇
258 0
Flutter基础widgets教程-LimitedBox篇
Flutter基础widgets教程-LimitedBox篇
183 0