themeProvider top-level property
final
Provides the current ThemeData
based on the current user's theme.
In order to change the theme, the user's theme name must be changed (see userController).
Implementation
final themeProvider = Provider<ThemeData>((ref) {
final themeService = ref.watch(themeServiceProvider);
final themeBasesRepository = ref.watch(themeBasesRepositoryProvider);
final user = ref.watch(userProvider);
final themeBase = themeBasesRepository.getThemeByName(user?.themeName ?? "");
return themeService.generateTheme(themeBase);
});