flutter - 更改图标的不透明度

标签 flutter dart icons opacity

我尝试更改图标的不透明度,当它以以下格式存在于代码中时:

child: Icon(Icons.camera_alt),

我想用来做,就像用彩色来做一样:
color: Colors.green.withOpacity(0.25),

有没有办法做到这一点?

最佳答案

这种方法有什么问题吗?

    Icon(
      Icons.camera_alt,
      color: Colors.green.withOpacity(0.25),
    )

关于flutter - 更改图标的不透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61798613/

相关文章:

ios - Flutter 在执行 Flutter build ios 后卡在 Building Dart 代码上

vba - 在用户表单中的命令按钮上使用办公室图标作为图像

html - 如何将 whatsapp 颜色表情符号作为图标与 .css 链接?

firebase - 强制 Firestore 数据库缓存数据库

flutter - 两列两行 flutter 布局

flutter - Flutter shared_preferences getString()不返回字符串?

android - 不显示具有透明背景的应用程序图标

android - Flutter:在彼此相邻的两列中显示内容

dart - 如何防止对 Flutter Inkwell 进行多次触摸

dart - 如何将所有 map 键放入列表中?