如果变量的值大于 10,我试图将下面的颜色从红色更改为绿色。我该怎么做?因为 'color:' 不接受 if, else 语句:
Card(
child: Column(
children:[
Text('Calls Taken',
style: TextStyle(
fontSize: 16.0,
decoration: TextDecoration.underline,
),),
Text('10'),
],
),
color: Colors.redAccent
),
Run Code Online (Sandbox Code Playgroud)
上面的卡片小部件在一个继承StatelfulWidgets的类下
先感谢您!!!