flutter_platform_widgets icon indicating copy to clipboard operation
flutter_platform_widgets copied to clipboard

PlatformTheme inside Consumer

Open WeighingDog opened this issue 1 year ago • 0 comments

Hi. I need to wrap PlatformTheme inside a theme Consumer to change primary color of theme based on button press. Is it correct? It's like PlatformTheme.of(context)?.themeMode assegnation does not work properly.

Consumer2<AppThemeData, AppLanguageProvider>( builder: (context, theme, locale, child) => PlatformTheme( themeMode: initialThemeMode, materialLightTheme: AppThemeData.materialLightTheme, materialDarkTheme: AppThemeData.materialDarkTheme, cupertinoLightTheme: theme.cupertinoCustomLightTheme, cupertinoDarkTheme: AppThemeData.cupertinoDarkTheme, matchCupertinoSystemChromeBrightness: true, onThemeModeChanged: (themeMode) { print(themeMode); theme.setThemeMode(themeMode); },

WeighingDog avatar Mar 28 '24 01:03 WeighingDog