flutter 按钮

2019-10-10  本文已影响0人  CaptainRoy
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("自定义按钮");
                },
            ),
        ],
    );
  }
}
上一篇下一篇

猜你喜欢

热点阅读