Unverified Commit 360ac5bc authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

Add covariant to `ThemeExtension.lerp` (#105207)

* Add covariant to `ThemeExtension.lerp`

* x

* x
parent ea27351e
...@@ -26,7 +26,7 @@ class MyColors extends ThemeExtension<MyColors> { ...@@ -26,7 +26,7 @@ class MyColors extends ThemeExtension<MyColors> {
} }
@override @override
MyColors lerp(ThemeExtension<MyColors>? other, double t) { MyColors lerp(MyColors? other, double t) {
if (other is! MyColors) { if (other is! MyColors) {
return this; return this;
} }
......
...@@ -87,7 +87,7 @@ abstract class ThemeExtension<T extends ThemeExtension<T>> { ...@@ -87,7 +87,7 @@ abstract class ThemeExtension<T extends ThemeExtension<T>> {
/// Linearly interpolate with another [ThemeExtension] object. /// Linearly interpolate with another [ThemeExtension] object.
/// ///
/// {@macro dart.ui.shadow.lerp} /// {@macro dart.ui.shadow.lerp}
ThemeExtension<T> lerp(ThemeExtension<T>? other, double t); ThemeExtension<T> lerp(covariant ThemeExtension<T>? other, double t);
} }
// Deriving these values is black magic. The spec claims that pressed buttons // Deriving these values is black magic. The spec claims that pressed buttons
......
...@@ -25,7 +25,7 @@ class MyThemeExtensionA extends ThemeExtension<MyThemeExtensionA> { ...@@ -25,7 +25,7 @@ class MyThemeExtensionA extends ThemeExtension<MyThemeExtensionA> {
} }
@override @override
MyThemeExtensionA lerp(ThemeExtension<MyThemeExtensionA>? other, double t) { MyThemeExtensionA lerp(MyThemeExtensionA? other, double t) {
if (other is! MyThemeExtensionA) { if (other is! MyThemeExtensionA) {
return this; return this;
} }
...@@ -52,7 +52,7 @@ class MyThemeExtensionB extends ThemeExtension<MyThemeExtensionB> { ...@@ -52,7 +52,7 @@ class MyThemeExtensionB extends ThemeExtension<MyThemeExtensionB> {
} }
@override @override
MyThemeExtensionB lerp(ThemeExtension<MyThemeExtensionB>? other, double t) { MyThemeExtensionB lerp(MyThemeExtensionB? other, double t) {
if (other is! MyThemeExtensionB) { if (other is! MyThemeExtensionB) {
return this; return this;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment