Question:I am trying to make the a Button in flutter reusable as it is pretty much the same except for the Color of the Button. As far as I understand from a number search results, the datatype for colors is
Color. But when I do the following it gives me an error saying
The argument type 'Color' can't be assigned to the parameter type 'int'.
TextStyleaccepts a value of type
Colorwhich is a dart object, not the integer value of the color code.
So you can keep
Colorand use it like the following:
textColorvariable to be
intcontaining the value (Color Code) of the color, example:
0xFFFF0000, and then use it like the following:
If you have better answer, please add a comment about this, thank you!