XTheme class
A class that defines the theme settings for the application.
Constructors
- XTheme.new({required String id, required String name, required ThemeData themeData, CupertinoThemeData? cupertinoThemeData, PlayxColors colors = const DefaultColors(), bool isDark = false})
-
Creates an XTheme instance with the provided configurations.
const
- XTheme.builder({required String id, required String name, required ThemeData initialTheme, required ThemeData themeBuilder(Locale? locale)?, CupertinoThemeData cupertinoThemeBuilder(Locale? locale)?, PlayxColors colors = const DefaultColors(), bool isDark = false})
-
Creates an XTheme instance with a builder function for dynamic theming
based on the app's locale.
const
Properties
- colors → PlayxColors
-
A custom color scheme for the theme, represented by the PlayxColors class,
which provides custom colors specific to each theme.
final
- cupertinoThemeBuilder → CupertinoThemeData Function(Locale? locale)?
-
A function that returns CupertinoThemeData based on the locale, allowing for
custom theme configurations that adapt to different locales.
final
- cupertinoThemeData → CupertinoThemeData?
-
The CupertinoThemeData that defines the visual styling for a CupertinoApp or
a widget subtree within the app.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
A unique identifier for the theme.
final
- isDark → bool
-
Indicates whether the theme is a dark theme. Defaults to
false
.final - name → String
-
The name of the theme, typically used for display purposes.
final
-
props
→ List<
Object> -
The list of properties that will be used to determine whether
two instances are equal.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - themeBuilder → ThemeData Function(Locale? locale)?
-
A function that returns ThemeData based on the locale, allowing for
custom theme configurations that adapt to different locales.
final
- themeData → ThemeData
-
The ThemeData that defines the visual styling for a MaterialApp or
a widget subtree within the app.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
maybeOf(
BuildContext context) → XTheme? - Tries to retrieve the current XTheme from the BuildContext.
-
of(
BuildContext context) → XTheme - Retrieves the current XTheme from the BuildContext.