栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Flutter展开Container以填充Row的剩余空间

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Flutter展开Container以填充Row的剩余空间

我建议您仅开始构建布局,

Row
Column
不要感到困惑。我经常按如下方式构建布局。

  1. 仅使用
    Row
    和布局对象(例如,文本,图像)
    Column
    。并在和中设置
    mainAxisAlignment
    crossAxisAlignment
    属性。
    Row``Column
  2. 设置样式
    Padding
    或者
    Align
    Expanded
    等你也可以使用
    Container
  3. 另外装饰。

参考:

布局基本:

https://flutter.dev/docs/development/ui/layout

构建布局时的提示:

https://medium.com/@liewjuntung/tips-on-using-android-studio-to-develop-
flutter-apps-9e42c047b7f4

希望对您有帮助。

示例代码:

    Widget buildCard() {      return Container(        margin: EdgeInsets.all(10.0),        decoration: BoxDecoration(          color: Colors.white,          boxShadow: [ BoxShadow(   color: Color.fromARGB(100, 0, 0, 0),   blurRadius: 5, ),          ],        ),        child: Row(          crossAxisAlignment: CrossAxisAlignment.start,          children: <Widget>[ Image.asset(   'assets/card.png',   height: 62,   width: 62,   fit: BoxFit.cover, ), Padding(   padding: const EdgeInsets.only(top: 12.0, left: 12.0),   child: Text(     "Hello world",     style: TextStyle(       fontWeight: FontWeight.w500,       letterSpacing: 0.8,     ),   ), )          ],        ),      );    }


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/366564.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号