ThemeConfig constructor
const
ThemeConfig({
- ThemeMode initialMode = ThemeMode.system,
- bool cacheThemeMode = false,
- LightThemeData? lightThemeData,
- DarkThemeData? darkThemeData,
- ScrollBarConfiguration? scrollBarConfiguration,
- List<
StyleRule> styles = const [],
Naki Theme Configuration for defining global light and dark theme customizations.
Theme configuration should occur once at the top-level root
component (e.g. inside main() or in the root NakiApp or
NakiThemeProvider.fromConfig declaration).
Example: Basic Usage
final _themeConfig = ThemeConfig(
initialMode: ThemeMode.system,
cacheThemeMode: true,
lightThemeData: LightThemeData(
colorSeed: ColorSeed(
green: Color('#10b981'),
),
),
darkModeThemeData: DarkThemeData(
colorSeed: ColorSeed(
green: Color('#059669'),
),
),
),
);
void main() {
runApp(NakiThemeProvider.fromConfig(
configuration: _themeConfig,
builder: (context) => MyApp(),
));
}
Implementation
const ThemeConfig({
this.initialMode = ThemeMode.system,
this.cacheThemeMode = false,
this.lightThemeData,
this.darkThemeData,
this.scrollBarConfiguration,
this.styles = const [],
});