class colorSymbol extends StatelessWidget {
final Colors color;
colorSymbol(Colors this.color, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Icon(
Icons.accessibility,
color: ,
size: 64.0,
);
}
}
The code simply return a accessibility icon from Icons and I want this widget to change its color which is given by user. I created a variable from Colors class called color but I cannot move on. Thanks in advance
2
Answers
You like to have
Color
instead ofColors
.You should change your parameter type from
Colors
toColor
: