generateTheme method
Make sure ThemesManager exist in the widget tree and your are in the correct BuildContext.
builder: (context, child) {
...
ThemeManager.of(context).generateTheme(
ThemeManagerData(
key: <themeKey>,
data: <ThemeData>,
)
);
return child;
},
Implementation
void generateTheme(
ThemeManagerData themeData,
) {
_themes[themeData.key] = themeData;
}