lerp method

  1. @override
AppTypography lerp(
  1. covariant ThemeExtension<AppTypography>? other,
  2. double t
)
override

Linearly interpolates between this scale and other by factor t.

Returns this instance unchanged when other is not an AppTypography. Used by Flutter's theme animation system during ThemeData transitions.

Implementation

@override
AppTypography lerp(ThemeExtension<AppTypography>? other, double t) {
  if (other is! AppTypography) return this;

  return AppTypography(
    displayLarge: TextStyle.lerp(displayLarge, other.displayLarge, t),
    displayMedium: TextStyle.lerp(displayMedium, other.displayMedium, t),
    displaySmall: TextStyle.lerp(displaySmall, other.displaySmall, t),
    headlineLarge: TextStyle.lerp(headlineLarge, other.headlineLarge, t),
    headlineMedium: TextStyle.lerp(headlineMedium, other.headlineMedium, t),
    headlineSmall: TextStyle.lerp(headlineSmall, other.headlineSmall, t),
    titleLarge: TextStyle.lerp(titleLarge, other.titleLarge, t),
    titleMedium: TextStyle.lerp(titleMedium, other.titleMedium, t),
    titleSmall: TextStyle.lerp(titleSmall, other.titleSmall, t),
    bodyLarge: TextStyle.lerp(bodyLarge, other.bodyLarge, t),
    bodyMedium: TextStyle.lerp(bodyMedium, other.bodyMedium, t),
    bodySmall: TextStyle.lerp(bodySmall, other.bodySmall, t),
    labelLarge: TextStyle.lerp(labelLarge, other.labelLarge, t),
    labelMedium: TextStyle.lerp(labelMedium, other.labelMedium, t),
    labelSmall: TextStyle.lerp(labelSmall, other.labelSmall, t),
  );
}