flutter-RaisedButton

/**
    const RaisedButton({
    Key key,
    @required VoidCallback onPressed,
    ValueChanged<bool> onHighlightChanged,//水波紋高亮變化回調(diào),按下返回true,抬起返回false
    ButtonTextTheme textTheme,//按鈕的主題
    Color textColor,//文字的顏色
    Color disabledTextColor,//按鈕禁用時(shí)候文字的顏色
    Color color,//按鈕的背景顏色
    Color disabledColor,//按鈕被禁用的時(shí)候顯示的顏色
    Color highlightColor,//點(diǎn)擊或者toch控件高亮的時(shí)候顯示在控件上面,水波紋下面的顏色
    Color splashColor,//水波紋的顏色
    Brightness colorBrightness,//按鈕主題高亮
    double elevation,//按鈕下面的陰影
    double highlightElevation,//高亮?xí)r候的陰影
    double disabledElevation,//按下的時(shí)候的陰影
    EdgeInsetsGeometry padding,
    ShapeBorder shape,//設(shè)置形狀
    Clip clipBehavior = Clip.none,
    MaterialTapTargetSize materialTapTargetSize,
    Duration animationDuration,
    Widget child,
    })
 */
body: Container(
            padding: EdgeInsets.all(10.0),
            child: Column(
              children: <Widget>[
                RaisedButton(
                  onPressed: () {},
                  child: Text("textColor文本的顏色,color背景顏色,highlightColor按鈕按下的顏色"),
                  textColor: Color(0xffff0000),
                  color: Color(0xfff1f1f1),
                  highlightColor: Color(0xff00ff00),
                ),
                RaisedButton(
                  onPressed: () {},
                  child: Text("disabledTextColor禁用時(shí)文本顏色,disabledColor禁用時(shí)背景顏色"),
                  disabledTextColor: Color(0xff999999),
                  disabledColor: Color(0xffff0000),
                ),
                RaisedButton(
                  onPressed: () {},
                  child: Text("splashColor水波的顏色,disabledColor禁用時(shí)背景顏色"),
                  splashColor: Color(0xffff0000),
                ),
                RaisedButton(
                  onPressed: () {},
                  child: Text("colorBrightness按鈕主題高亮 Brightness.light"),
                  colorBrightness: Brightness.light,
                ),
                RaisedButton(
                  onPressed: () {},
                  child: Text("colorBrightness按鈕主題高亮 Brightness.dark"),
                  colorBrightness: Brightness.dark,
                ),
                Container(
                  margin: EdgeInsets.only(top: 20.0),
                  child: RaisedButton(
                    onPressed: () {},
                    child: Text(
                        "elevation按鈕下面的陰影,highlightElevation高亮?xí)r候的陰影,disabledElevation按下的時(shí)候的陰影"),
                    elevation: 5.0,
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: 20.0),
                  child: RaisedButton(
                    onPressed: () {},
                    child: Text(
                        "elevation按鈕下面的陰影,highlightElevation高亮?xí)r候的陰影,disabledElevation按下的時(shí)候的陰影"),
                    highlightElevation: 5,
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: 20.0),
                  child: RaisedButton(
                    onPressed: () {},
                    child: Text(
                        "elevation按鈕下面的陰影,highlightElevation高亮?xí)r候的陰影,disabledElevation按下的時(shí)候的陰影"),
                    disabledElevation: 5.0,
                  ),
                ),
                RaisedButton(
                  onPressed: () {},
                  child: Text(
                      "onHighlightChanged 水波紋高亮變化回調(diào),按下返回true,抬起返回false"),
                  onHighlightChanged: (bool b) {
                    print(b);
                  },
                ),
                RaisedButton(
                  onPressed: () {
                    print("點(diǎn)擊了");
                  },
                  child: Text("onPressed點(diǎn)擊事件"),
                ),
              ],
            ),
          )
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容