nank1ro / flutter-shadcn-ui

shadcn-ui ported in Flutter. Awesome UI components for Flutter, fully customizable.
https://mariuti.com/shadcn-ui
MIT License
657 stars 42 forks source link

Can it work with flex_color_scheme? #44

Closed bigzhu closed 3 months ago

bigzhu commented 3 months ago

https://pub.dev/packages/flex_color_scheme

bigzhu commented 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);
          },
nank1ro commented 3 months ago

Be aware that materialThemeBuilderis meant to be used with theme.copyWith because the internal ThemeData is created with the given ShadThemeData