nyColorStyle<T> function
Helper to get the color styles
Find a color style from the Nylo's appThemes.
Example:
final colors = nyColorStyle<MyColorStyles>(context);
print(colors.primaryAccent);
Or get colors from a specific theme:
final colors = nyColorStyle<MyColorStyles>(context, themeId: 'dark_theme');
Implementation
T nyColorStyle<T>(BuildContext context, {String? themeId}) {
if (themeId != null) {
return NyThemeManager.instance.colorStylesFromTheme<T>(themeId);
}
return NyThemeManager.instance.colorStyles<T>();
}