【发布时间】:2019-01-27 14:57:56
【问题描述】:
我想在我的 IconButton(右上角)上放置一个 tintColor,这样我就不必在我的项目中放置不同颜色的相同图像。
你如何在 Flutter 中做 tintColor?
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomPadding: true,
backgroundColor: SILVER,
appBar: AppBar(
title: Text(
APP_NAME,
style: TextStyle(
color: RED,
fontFamily: 'Allan')),
// Action buttons
actions: < Widget > [
Container(
width: 45,
child:
IconButton(
color: BLACK,
icon: Image.asset("assets/images/ic_planet.png"),
tooltip: "Planets",
onPressed: () {
_handleSelectedAction();
},
)
...
)
],
【问题讨论】: