美文网首页
flutter 按钮

flutter 按钮

作者: CaptainRoy | 来源:发表于2019-10-10 15:04 被阅读0次
    • 按钮


      按钮
    class MyHomeBody extends StatelessWidget {
        @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return Column(
            children: <Widget>[
                FloatingActionButton(
                    child: Text("FloatingActionButton"),
                    onPressed: () {
                        print("FloatingActionButton Click");
                    },
                ),
                RaisedButton(
                    child: Text("RaisedButton"),
                    onPressed: () {
                        print("RaisedButton Click");
                    },
                ),
                FlatButton(
                    child: Text("FlatButton"),
                    onPressed: () {
                        print("FlatButton Click");
                    },
                ),
                OutlineButton(
                    child: Text("OutlineButton"),
                    onPressed: () {
                        print("OutlineButton Click");
                    },
                ),
                RaisedButton(
                    child: Text("自定义样式",style: TextStyle(color: Colors.red),),
                    color: Colors.orange,
                    highlightColor: Colors.orange[700],
                    shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
                    onPressed: () {
                        print("自定义按钮");
                    },
                ),
            ],
        );
      }
    }
    

    相关文章

      网友评论

          本文标题:flutter 按钮

          本文链接:https://www.haomeiwen.com/subject/vbfapctx.html