ThemeConfig class final
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(),
));
}
Constructors
-
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.
const
Properties
- cacheThemeMode → bool
-
Enables theme mode caching and restoration across sessions.
final
- darkThemeData → DarkThemeData?
-
Customise dark mode properties.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialMode → ThemeMode
-
Initial theme mode.
final
- lightThemeData → LightThemeData?
-
Customise light mode properties.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollBarConfiguration → ScrollBarConfiguration?
-
Scroll bar configuration.
final
-
styles
→ List<
StyleRule> -
Custom styles to add to the theme
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
defaultStyles
→ List<
StyleRule> -
The default styles for theme modes
final