zoukankan      html  css  js  c++  java
  • flutter Material风格-按钮

    1.MaterialButton

    MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: MaterialButton(
                color: Colors.blue,
                textColor: Colors.white,
                child: Text('按钮'),
                onPressed: () {},
              ))),
        );

    2.RaisedButton

    MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: RaisedButton(
                color: Colors.blue,
                textColor: Colors.white,
                child: Text('按钮'),
                onPressed: () {},
              ))),
        );

     

    3.FlatButton 

    MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: FlatButton(
                color: Colors.blue,
                textColor: Colors.white,
                child: Text('按钮'),
                onPressed: () {},
              ))),
        );

     

    4.IconButton

    MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: IconButton(
                color: Colors.green,
                icon: Icon(Icons.pets),
                //长按提示
                tooltip: "ok",
                onPressed: () {},
              ))),
        );

    5.FloatingActionButton

    MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: FloatingActionButton(
                backgroundColor: Colors.red,
                child: Icon(Icons.arrow_upward),
                onPressed: () {},
              ))),
        );

     

    6.OutlineButton

     MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: OutlineButton(
                child: Icon(Icons.pets),
                onPressed: () {},
              ))),
        );

    7.DropdownButton

    下拉按钮

    MaterialApp(
          home: Scaffold(
              appBar: AppBar(
                title: Text("测试"),
              ),
              body: Center(
                  child: DropdownButton(
                value: value,
                icon: Icon(Icons.arrow_upward),
                onChanged: (String newValue) {
                  setState(() {
                    value = newValue;
                  });
                },
                items: <String>['a', 'b', 'c', 'd']
                    .map<DropdownMenuItem<String>>((String value) {
                  return DropdownMenuItem<String>(
                    value: value,
                    child: Text(value),
                  );
                }).toList(),
              ))),
        );

     

    8.PopupMenuButton

  • 相关阅读:
    理解vertical-align
    理解css行高(line-height)
    react 生命周期函数
    react Diff 算法
    React中的虚拟DOM
    无限重启:windows更新之后,在输入密码页面无限重启进入不了系统
    [转]github 上传project代码
    【转】HTTP响应状态码参考簿
    TweenMax—ScrambleText插件 实现类似电脑破译密码的特效
    既然CPU一次只能执行一个线程,那多线程存在的意义是什么?
  • 原文地址:https://www.cnblogs.com/buchizaodian/p/13182056.html
Copyright © 2011-2022 走看看