CDKTheme class

A class representing the theme configuration for a Flutter application.

The CDKTheme class provides a mechanism to define and update the visual appearance of an application, including colors that change based on the theme (light or dark) and application focus state. These dynamic colors are accessed via a notifier: CDKTheme theme = CDKThemeNotifier.of(context)!.changeNotifier;.

Static colors are predefined and constant, while dynamic colors change according to the application's theme and focus state.

CDKTheme theme = CDKThemeNotifier.of(context)!.changeNotifier;
Color backgroundColor = theme.isLight ? CDKTheme.white : CDKTheme.black;

CDKTheme Example

This class also provides a set of predefined static colors for convenience.

Inheritance

Constructors

CDKTheme()

Properties

accent Color
getter/setter pair
accent100 Color
getter/setter pair
accent200 Color
getter/setter pair
accent300 Color
getter/setter pair
accent50 Color
getter/setter pair
accent500 Color
getter/setter pair
accent600 Color
getter/setter pair
appearanceConfig String
getter/setter pair
background Color
getter/setter pair
backgroundSecondary0 Color
getter/setter pair
backgroundSecondary1 Color
getter/setter pair
backgroundSecondary2 Color
getter/setter pair
colorConfig String
getter/setter pair
colorText Color
getter/setter pair
colorTextSecondary Color
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isAppFocused bool
getter/setter pair
isLight bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
getSidebarColorBackground(bool isSelected, bool isAccent) Color
getSidebarColorText(bool isSelected, bool isAccent) Color
getThemeData(BuildContext context, String initialAppearance, String initialColor) CupertinoThemeData
initColors(dynamic themeColor) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setAccentColour(String name) → void
setAppearanceConfig(BuildContext context, {String type = "system", bool notify = true}) String
setAppFocus(bool value) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

adjustColor(Color color, double saturationFactor, double brightnessFactor) Color

Constants

black → const Color
blue → const Color
cyan → const Color
green → const Color
grey → const Color
grey50 → const Color
grey60 → const Color
grey70 → const Color
grey80 → const Color
grey90 → const Color
grey100 → const Color
grey200 → const Color
grey300 → const Color
grey500 → const Color
grey600 → const Color
grey700 → const Color
grey800 → const Color
magenta → const Color
red → const Color
systemColors → const Map<String, Color>
transparent → const Color
white → const Color
yellow → const Color