Flutter RaiseButton 使用介绍


一、常用属性

color:按钮可点击时的颜色
disabledColor: 按钮不可点击时的颜色
disabledColorTextColor:按钮不可点击时文字的颜色
textColor:按钮可点击时文字的颜色
shape:按钮的样式
    RoundedRectangleBorder(
        borderRadius: BorderRadius.all(Radius.circular(5)))(圆角矩形)
    StadiumBorder()(两边都是半圆)
    CircleBorder(
        side: BorderSide(
            color: Colors.white)) (圆形)
elevation:阴影(一般不设置,使用默认的即可)
onPressed:点击事件
onLongPress:长按点击事件

二、简单使用

RaisedButton(
    onPressed: () {},
    shape: RoundedRectangleBorder(
           borderRadius: BorderRadius.all(Radius.circular(5))),
    color: Colors.red,
    child: Container(
           height: 48,
           alignment: Alignment.center,
           width: MediaQuery.of(context).size.width * .8,
           child: Text(Strings.exit, style: CustomStyles.exitTextStyle)))

文章作者: bigshot
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 bigshot !
 上一篇
dart编程规范 dart编程规范
一、命名规范1、类名,枚举,类型定义,类型参数采用首字母大写的驼峰式命名方式 class SliderMenu { ... } class HttpRequest { ... } typedef Predicate<T> = b
2020-04-15 bigshot
下一篇 
Flutter环境搭建(Mac) Flutter环境搭建(Mac)
.从github拉取代码: git clone -b beta https://github.com/flutter/flutter.git 配置环境变量: 在当期用户目录下创建.bash_profile文件,如果该文件已经存在,
2020-04-08 bigshot
  目录