StacCustomTextStyle class
A custom text style similar to Flutter's TextStyle.
Example:
final style = StacCustomTextStyle(fontSize: 16, color: StacColors.blue);
JSON example:
{"fontSize": 16, "color": "#FF2196F3" }
- Inheritance
-
- Object
- StacTextStyle
- StacCustomTextStyle
- Available extensions
- Annotations
-
- @JsonSerializable.new()
Constructors
-
StacCustomTextStyle({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}) - Reference: https://api.flutter.dev/flutter/painting/TextStyle-class.html
-
StacCustomTextStyle.fromJson(Map<
String, dynamic> json) -
Creates a StacCustomTextStyle from JSON.
factory
Properties
- backgroundColor ↔ StacColor?
-
Background color behind the text.
getter/setter pair
- color ↔ StacColor?
-
Text color.
getter/setter pair
- debugLabel ↔ String?
-
Optional label used for debugging.
getter/setter pair
- decorationColor ↔ StacColor?
-
Color for text decorations (underline, overline, etc.).
getter/setter pair
- decorationStyle ↔ StacTextDecorationStyle?
-
Style of text decorations (solid, dotted, dashed, etc.).
getter/setter pair
- decorationThickness ↔ double?
-
Thickness of text decorations in logical pixels.
getter/setter pair
- fontFamily ↔ String?
-
The name of the font family to use.
getter/setter pair
-
fontFamilyFallback
↔ List<
String> ? -
Fallback font families to try if fontFamily is unavailable.
getter/setter pair
- fontSize ↔ double?
-
Font size in logical pixels.
getter/setter pair
- fontStyle ↔ StacFontStyle?
-
Font style (normal/italic).
getter/setter pair
- fontWeight ↔ StacFontWeight?
-
Font weight.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double?
-
The height of this text span, as a multiple of font size.
getter/setter pair
- inherit ↔ bool?
-
Whether to inherit styling from the ambient
DefaultTextStyle.getter/setter pair - leadingDistribution ↔ StacTextLeadingDistribution?
-
Strategy for distributing the leading (space above a line).
getter/setter pair
- letterSpacing ↔ double?
-
Spacing between letters.
getter/setter pair
- overflow ↔ StacTextOverflow?
-
How visual overflow should be handled.
getter/setter pair
- package ↔ String?
-
Optional package name for bundled fonts.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textBaseline ↔ StacTextBaseline?
-
The baseline to align against.
getter/setter pair
- type → StacTextStyleType
-
The variant discriminator.
finalinherited
- wordSpacing ↔ double?
-
Spacing between words.
getter/setter pair
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}) → StacCustomTextStyle - 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 custom text style to JSON.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited