【发布时间】:2021-03-08 23:24:45
【问题描述】:
我有以下代码在警报中显示一列。行以分钟为单位显示中断值。如果变量(break1、break2 等)为 0,我不想显示该行。我该怎么做呢?谢谢。
content: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 38,
child: Text(
'Break 1:',
style: TextStyle(color: kBodyText, fontSize: 16),
),
),
Expanded(
flex: 62,
child: Text(
'$break1 minutes',
style: TextStyle(color: kBodyText, fontSize: 16),
),
),
],
),
Row(
children: <Widget>[
Expanded(
flex: 38,
child: Text(
'Break 2:',
style: TextStyle(color: kBodyText, fontSize: 16),
),
),
Expanded(
flex: 62,
child: Text(
'$break2 minutes',
style: TextStyle(color: kBodyText, fontSize: 16),
),
),
],
),
],
),
【问题讨论】: