I want to apply a theme in my Flutter app on the disabled text fields' label because the grey color I have right now is quite hard to read.
I'd like to apply it to my entire app, so I'd like to use theming, however, I didn't find any solution that would enable my to customize the label's text style only if the text form field is disabled
How can I theme and set globally the color the disabled text form field's label in Flutter?
I know how to change the label's text style conditionally, however, I need to remember to always use the same style (or I could wrap the widget, but that sounds also suboptimal). I can customize the label's color via the decoration
named parameter, like so:
TextFormField(
enabled: isEnabled,
decoration: InputDecoration(
labelText: 'Value',
labelStyle: TextStyle(color: isEnabled ? Colors.green : Colors.red),
),
// .... other fields, like controller might come here
),