Skip to content

Instantly share code, notes, and snippets.

@jesteracer
Created May 6, 2020 06:43
Show Gist options
  • Save jesteracer/cafda2721c72fcb7bc17c94d25f90f5e to your computer and use it in GitHub Desktop.
Save jesteracer/cafda2721c72fcb7bc17c94d25f90f5e to your computer and use it in GitHub Desktop.
Examples
class ThemeProvider extends ChangeNotifier {
CustomThemeData current;
CustomThemeData blackTheme = CustomThemeData(
name: 'black',
bodyFontColor: Color.fromRGBO(184, 184, 184, 1),
...
);
CustomThemeData lightTheme = CustomThemeData(
name: 'black',
bodyFontColor: Color.fromRGBO(184, 184, 184, 1),
...
);
ThemeProvider(withTheme, withFontMultiplier, withAutoTheme) {
theme = withTheme;
autoTheme = withAutoTheme;
current = withTheme == 'light' ? lightTheme : blackTheme;
}
}
TextSpan(
text: block['data']['first'],
style: TextStyle(
color: Provider.of<ThemeProvider>(context)
.current
.bodyFontColor,
fontFamily: 'Proxima Nova',
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment