Flutter ListTile (tileColor) 有条件地

巴巴亚罗

是否可以更改 tileColor 例如。如果 _userDetails[index].salary < 1000 Colors.red else Color.blue 或者从查询返回颜色并设置tileColor: _userDetails[index].color,

title: Text(_userDetails[index].name),
subtitle: Text(_userDetails[index].salary.toString()),
tileColor: Colors.red,
本质
tileColor: _userDetails[index].salary < 1000  ? Colors.red : Colors.blue

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章