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'.
class CustomButton extends StatelessWidget {
final Color buttonColor;
final Color textColor;
const CustomButton({
Key? key,
required this.buttonColor,
required this.textColor,
}) : super(key: key);
And I mentioned it like the following:
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Color(textColor)),
Thanks in advance.