merge method

  1. @override
Typeface merge(
  1. Typeface? other
)
override

merge other into this preset. Works as copyWith with all it's entry arguments assigned to other's corresponding fields.

Implementation

@override
Typeface merge(other) {
  //...
  return Typeface(
    background: background.merge(other?.background),
    foreground: foreground.merge(other?.foreground),
    //...surface
    primary: primary.merge(other?.primary),
    secondary: secondary.merge(other?.secondary),
    ascent: ascent.merge(other?.ascent),
    //...on surface
    onPrimary: _primary?.merge(other?._primary),
    onSecondary: _secondary?.merge(other?._secondary),
    onAscent: _ascent?.merge(other?._ascent),
    //...extras
    success: success.merge(other?.success),
    error: error.merge(other?.error),
    warning: warning.merge(other?.warning),
  );
}