Closed bigzhu closed 3 months ago
I found materialThemeBuilder
, this code is work well:
materialThemeBuilder: (BuildContext context, ThemeData theme) {
bool darkModeOn = theme.brightness == Brightness.dark;
if (darkModeOn) return FlexThemeData.dark(scheme: FlexScheme.money);
return FlexThemeData.light(scheme: FlexScheme.money);
},
Be aware that materialThemeBuilder
is meant to be used with theme.copyWith
because the internal ThemeData
is created with the given ShadThemeData
https://pub.dev/packages/flex_color_scheme