Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
360ac5bc
Unverified
Commit
360ac5bc
authored
Aug 24, 2022
by
Pierre-Louis
Committed by
GitHub
Aug 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add covariant to `ThemeExtension.lerp` (#105207)
* Add covariant to `ThemeExtension.lerp` * x * x
parent
ea27351e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
theme_extension.1.dart
examples/api/lib/material/theme/theme_extension.1.dart
+1
-1
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+1
-1
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+2
-2
No files found.
examples/api/lib/material/theme/theme_extension.1.dart
View file @
360ac5bc
...
...
@@ -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
;
}
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
360ac5bc
...
...
@@ -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
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
360ac5bc
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment