我想在我的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();
},
)
...
)
],
Run Code Online (Sandbox Code Playgroud)