merge method

FlameTextStyle? merge(
  1. FlameTextStyle? style1,
  2. FlameTextStyle? style2
)
override

Merges two FlameTextStyles together, preferring the properties of style2 if present, falling back to the properties of style1.

Implementation

FlameTextStyle? merge(FlameTextStyle? style1, FlameTextStyle? style2) {
  if (style1 == null) {
    return style2;
  } else if (style2 == null) {
    return style1;
  } else {
    return (_mergedStylesCache[style1] ??= {})[style2] ??=
        style1.copyWith(style2);
  }
}