TextStyle lerp(TextStyle begin, TextStyle end, double t)

Interpolate between two text styles.

This will not work well if the styles don't set the same fields.

Source

static TextStyle lerp(TextStyle begin, TextStyle end, double t) {
  assert(begin.inherit == end.inherit);
  return new TextStyle(
    inherit: end.inherit,
    color: Color.lerp(begin.color, end.color, t),
    fontFamily: t < 0.5 ? begin.fontFamily : end.fontFamily,
    fontSize: ui.lerpDouble(begin.fontSize ?? end.fontSize, end.fontSize ?? begin.fontSize, t),
    fontWeight: FontWeight.lerp(begin.fontWeight, end.fontWeight, t),
    fontStyle: t < 0.5 ? begin.fontStyle : end.fontStyle,
    letterSpacing: ui.lerpDouble(begin.letterSpacing ?? end.letterSpacing, end.letterSpacing ?? begin.letterSpacing, t),
    wordSpacing: ui.lerpDouble(begin.wordSpacing ?? end.wordSpacing, end.wordSpacing ?? begin.wordSpacing, t),
    textBaseline: t < 0.5 ? begin.textBaseline : end.textBaseline,
    height: ui.lerpDouble(begin.height ?? end.height, end.height ?? begin.height, t),
    decoration: t < 0.5 ? begin.decoration : end.decoration,
    decorationColor: Color.lerp(begin.decorationColor, end.decorationColor, t),
    decorationStyle: t < 0.5 ? begin.decorationStyle : end.decorationStyle
  );
}