StacThemeTextStyle class

A text style that references a style from ThemeData.textTheme.

For example, style: StacMaterialTextStyle.bodyMedium maps to Theme.of(context).textTheme.bodyMedium.

Example:

final style = StacThemeTextStyle(textTheme: StacMaterialTextStyle.bodyMedium);

JSON example:

{ "type": "theme", "textTheme": "bodyMedium" }
Inheritance
Available extensions
Annotations
  • @JsonSerializable.new()

Constructors

StacThemeTextStyle({required StacMaterialTextStyle textTheme, bool? inherit, StacColor? color, StacColor? backgroundColor, double? fontSize, StacFontWeight? fontWeight, StacFontStyle? fontStyle, double? letterSpacing, double? wordSpacing, StacTextBaseline? textBaseline, double? height, StacTextLeadingDistribution? leadingDistribution, StacColor? decorationColor, StacTextDecorationStyle? decorationStyle, double? decorationThickness, String? debugLabel, String? fontFamily, List<String>? fontFamilyFallback, String? package, StacTextOverflow? overflow})
A text style that references a style from ThemeData.textTheme.
StacThemeTextStyle.fromJson(Map<String, dynamic> json)
Creates a StacThemeTextStyle from JSON.
factory

Properties

backgroundColor StacColor?
Background color behind the text.
final
color StacColor?
Text color.
final
debugLabel String?
Optional label used for debugging.
final
decorationColor StacColor?
Color for text decorations (underline, overline, etc.).
final
decorationStyle StacTextDecorationStyle?
Style of text decorations (solid, dotted, dashed, etc.).
final
decorationThickness double?
Thickness of text decorations in logical pixels.
final
fontFamily String?
The name of the font family to use.
final
fontFamilyFallback List<String>?
Fallback font families to try if fontFamily is unavailable.
final
fontSize double?
Font size in logical pixels.
final
fontStyle StacFontStyle?
Font style (normal/italic).
final
fontWeight StacFontWeight?
Font weight.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height of this text span, as a multiple of font size.
final
inherit bool?
Whether to inherit styling from the ambient DefaultTextStyle.
final
leadingDistribution StacTextLeadingDistribution?
Strategy for distributing the leading (space above a line).
final
letterSpacing double?
Spacing between letters.
final
overflow StacTextOverflow?
How visual overflow should be handled.
final
package String?
Optional package name for bundled fonts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textBaseline StacTextBaseline?
The baseline to align against.
final
textTheme StacMaterialTextStyle
The TextTheme style key.
final
type StacTextStyleType
The variant discriminator.
finalinherited
wordSpacing double?
Spacing between words.
final

Methods

copyWith({bool? inherit, StacColor? color, StacColor? backgroundColor, double? fontSize, StacFontWeight? fontWeight, StacFontStyle? fontStyle, double? letterSpacing, double? wordSpacing, StacTextBaseline? textBaseline, double? height, StacTextLeadingDistribution? leadingDistribution, StacColor? decorationColor, StacTextDecorationStyle? decorationStyle, double? decorationThickness, String? debugLabel, String? fontFamily, List<String>? fontFamilyFallback, String? package, StacTextOverflow? overflow}) StacThemeTextStyle
Creates a copy of this style with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(BuildContext context) TextStyle?

Available on StacTextStyle, provided by the StacTextStyleParser extension

toJson() Map<String, dynamic>
Converts this theme text style to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

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