美文网首页Flutter_功能
flutter 颜色渐变

flutter 颜色渐变

作者: CQ_TYL | 来源:发表于2019-02-19 11:39 被阅读0次
    class _home extends StatefulWidget {
      @override
      State<StatefulWidget> createState() {
        return _homeState();
      }
    }
    class _homeState extends State<_home> {
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return new Scaffold(
            appBar: new AppBar(
              title: Text("title"),
              centerTitle: true,
            ),
            body: new Center(
              child: new Container(
                  height: 200.0,
                  decoration: new BoxDecoration(
                      gradient: const LinearGradient(
                          colors: [Colors.amberAccent, Colors.lightBlue, Colors.red]),
                    border: Border.all(width: 5.0,color: Colors.green)
    
                  ),
              ),
            )
        );
      }
    
    效果图

    相关文章

      网友评论

        本文标题:flutter 颜色渐变

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