Skip to content

Commit

Permalink
feat: Add missing background and foreground properties to InlineTextS…
Browse files Browse the repository at this point in the history
…tyle (#3187)

Add missing background and foreground properties to `InlineTextStyle`.

Note that Flutter also exposes `backgroundColor` and `foregroundColor`
as redundant helpers. I think for the sake of keeping things simpler on
our end, in particular the merge logic, we can do away with those.
  • Loading branch information
luanpotter committed Jun 6, 2024
1 parent 67e069c commit 34dde50
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/flame/lib/src/text/styles/inline_text_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class InlineTextStyle extends FlameTextStyle {
this.decorationColor,
this.decorationStyle,
this.decorationThickness,
this.background,
this.foreground,
});

final Color? color;
Expand All @@ -45,6 +47,8 @@ class InlineTextStyle extends FlameTextStyle {
final Color? decorationColor;
final TextDecorationStyle? decorationStyle;
final double? decorationThickness;
final Paint? background;
final Paint? foreground;

late final TextRenderer renderer = asTextRenderer();

Expand All @@ -68,6 +72,8 @@ class InlineTextStyle extends FlameTextStyle {
decorationColor: other.decorationColor ?? decorationColor,
decorationStyle: other.decorationStyle ?? decorationStyle,
decorationThickness: other.decorationThickness ?? decorationThickness,
background: other.background ?? background,
foreground: other.foreground ?? foreground,
);
}

Expand Down Expand Up @@ -95,6 +101,8 @@ class InlineTextStyle extends FlameTextStyle {
decorationColor: decorationColor,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
background: background,
foreground: foreground,
);
}
}

0 comments on commit 34dde50

Please sign in to comment.