Add covariant to ThemeExtension.lerp (#105207)

* Add covariant to `ThemeExtension.lerp`

* x

* x
This commit is contained in:
Pierre-Louis
2022-08-24 18:18:39 +02:00
committed by GitHub
parent ea27351e5e
commit 360ac5bc79
3 changed files with 4 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ class MyColors extends ThemeExtension<MyColors> {
}
@override
MyColors lerp(ThemeExtension<MyColors>? other, double t) {
MyColors lerp(MyColors? other, double t) {
if (other is! MyColors) {
return this;
}

View File

@@ -87,7 +87,7 @@ abstract class ThemeExtension<T extends ThemeExtension<T>> {
/// Linearly interpolate with another [ThemeExtension] object.
///
/// {@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

View File

@@ -25,7 +25,7 @@ class MyThemeExtensionA extends ThemeExtension<MyThemeExtensionA> {
}
@override
MyThemeExtensionA lerp(ThemeExtension<MyThemeExtensionA>? other, double t) {
MyThemeExtensionA lerp(MyThemeExtensionA? other, double t) {
if (other is! MyThemeExtensionA) {
return this;
}
@@ -52,7 +52,7 @@ class MyThemeExtensionB extends ThemeExtension<MyThemeExtensionB> {
}
@override
MyThemeExtensionB lerp(ThemeExtension<MyThemeExtensionB>? other, double t) {
MyThemeExtensionB lerp(MyThemeExtensionB? other, double t) {
if (other is! MyThemeExtensionB) {
return this;
}