I am trying to create a custom class for my FlutButton
widget and when I try to specify the color property with square brackets I get this error:
The default value of an optional parameter must be constant.
class CustomFlatButton extends StatelessWidget {
final String text;
final Color color;
final Color textColor;
CustomFlatButton({
this.text='Default sign in text',
this.color = Colors.white70,
this.textColor = Colors.grey[900] // this is what is causing the error [900]
});
Is there a way to fix this without converting my widget into a stateful one?
In advance, thank you.