……

Flutter 碎知识(二) 判断语句

Posted on 2022-08-13 16:58  WALL*E  阅读(201)  评论(0编辑  收藏  举报
//直接写判断 ?:
child: !clothList.isNotEmpty ? ListView(
  children: [
      const SizedBox(height: 30), // 距离顶部一个工具栏的高度
      widget.type==2? childText():const SizedBox(height: 50),
  ],
): childInfo(),

个人使用,仅供参考。