flutter常見組件之Button(第二期)

內容若是對你有幫助,幫忙點下贊,你的點贊是我更新最大的動力,謝謝啦!若是在開發的過程遇到問題能夠一塊兒討論,能夠加個人QQ羣!167646174!也能夠加我微信,在羣裏!
具體代碼見github ,歡迎各位Star,以及提issues!git

1.RaisedButton

clipboard.png

API 做用 參數
color 背景色 -
padding 與文字的內邊距 -
textColor 按鈕內文字顏色 -
textTheme 按鈕主題 -
disabledColor 按鈕被禁用顯示的顏色 -
disabledTextColor 按鈕被禁用時文字顯示顏色 -
highlightColor 擊高亮的時候顯示在控件上面,水波紋下面的顏色 -
splashColor 水波紋顏色 -
colorBrightness 按鈕主題高亮 -
elevation 按鈕下面的陰影 -
highlightElevation 高亮時候的陰影 -
disabledElevation 按下時候的陰影
clipBehavior 抗鋸齒能力 -
onHighlightChanged 水波紋高亮時候回調 -
onPressed 點擊事件 -
shape 拓展樣式 _
icon 小圖標按鈕 只有IconButton纔會使用到

---擴展---

1.1帶斜角的按鈕

clipboard.png

shape: BeveledRectangleBorder(
       borderRadius: BorderRadius.all(Radius.circular(20))
),

1.2圓按鈕

clipboard.png

shape: CircleBorder(
   // 圓邊顏色
     side: BorderSide(
      color: Colors.black
     )
),

1.3圓角矩形按鈕

clipboard.png

shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.all(Radius.circular(10))
  ),

1.4兩端半圓按鈕

clipboard.png

shape: StadiumBorder(),

2.OutlineButton

API同RaisedButton
默認邊線且背景透明的按鈕github

clipboard.png

3.FlatButton

API同RaisedButtonsegmentfault

4.ButtonBar

clipboard.png

API 做用 參數
alignment 對齊方式 -
mainAxisSize 主軸大小,默認MainAxisSize.max -

5.FloatingActionButton

clipboard.png

API 做用
backgroundColor 背景色
elevation 未點擊的陰影值
highlightElevation 點擊時的陰影值
tooltip 長按文字提示
foregroundColor 按鈕裏面文字小圖標顏色

具體代碼見github ,歡迎各位Star,以及提issues!
不按期更新,根據工做繁忙度決定!
如下是往期相關文章:微信

flutter常見組件API(第一期)ide

相關文章
相關標籤/搜索