美文网首页
flutter card(卡片布局)

flutter card(卡片布局)

作者: CQ_TYL | 来源:发表于2019-02-19 15:31 被阅读0次

Card 摘要:

  • 实现了一个 Material Design card
  • 接受单个孩子,但该孩子可以是Row,Column或其他包含子级列表的widget
  • 显示圆角和阴影
  • Card内容不能滚动
  • Material Components 库的一个widget
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 Card(
        elevation: 4.0,//阴影
        color: Colors.grey,//背景色
        child: new Container(
          color: Colors.lightBlue,
          width: 200.0,
          height: 200.0,

        ),
      )
    );
  }
}

相关文章

网友评论

      本文标题:flutter card(卡片布局)

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