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

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

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
默認邊線且背景透明的按鈕

clipboard.png

3.FlatButton

API同RaisedButton

4.ButtonBar

clipboard.png

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

5.FloatingActionButton

clipboard.png

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

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

flutter常見組件API(第一期)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章