SPThemeTokens class
Semantic colors, spacing, radii and typography carried through Flutter's theme system.
Add this extension using SPTheme.light, SPTheme.dark or
SPTheme.withTokens, then read it with context.spTheme.
- Inheritance
-
- Object
- ThemeExtension<
SPThemeTokens> - SPThemeTokens
- Annotations
Constructors
- SPThemeTokens({required Color success, required Color onSuccess, required Color warning, required Color onWarning, required Color info, required Color onInfo, SPSpacingTokens spacing = const SPSpacingTokens(), SPRadiusTokens radius = const SPRadiusTokens(), SPTypographyTokens typography = const SPTypographyTokens()})
-
Creates a token set.
const
- SPThemeTokens.fromColorScheme(ColorScheme scheme, {SPSpacingTokens spacing = const SPSpacingTokens(), SPRadiusTokens radius = const SPRadiusTokens(), SPTypographyTokens typography = const SPTypographyTokens()})
-
Creates sensible semantic tokens from a Material ColorScheme.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- info → Color
-
Semantic information color.
final
- onInfo → Color
-
Foreground color placed on info.
final
- onSuccess → Color
-
Foreground color placed on success.
final
- onWarning → Color
-
Foreground color placed on warning.
final
- radius → SPRadiusTokens
-
Application border-radius scale.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → SPSpacingTokens
-
Application spacing scale.
final
- success → Color
-
Semantic success color.
final
- type → Object
-
The extension's type.
no setterinherited
- typography → SPTypographyTokens
-
Application typography scale.
final
- warning → Color
-
Semantic warning color.
final
Methods
-
copyWith(
{Color? success, Color? onSuccess, Color? warning, Color? onWarning, Color? info, Color? onInfo, SPSpacingTokens? spacing, SPRadiusTokens? radius, SPTypographyTokens? typography}) → SPThemeTokens -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant SPThemeTokens? other, double t) → SPThemeTokens -
Linearly interpolate with another ThemeExtension object.
override
-
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