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
5eabfc24
Unverified
Commit
5eabfc24
authored
Dec 23, 2020
by
Michael Goderbauer
Committed by
GitHub
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow nullable tweens in TweenAnimationBuilder (#72476)
parent
15c009b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
tween_animation_builder.dart
...ages/flutter/lib/src/widgets/tween_animation_builder.dart
+2
-2
tween_animation_builder_test.dart
...es/flutter/test/widgets/tween_animation_builder_test.dart
+17
-0
No files found.
packages/flutter/lib/src/widgets/tween_animation_builder.dart
View file @
5eabfc24
...
...
@@ -113,7 +113,7 @@ import 'value_listenable_builder.dart';
/// [AnimatedBuilder], which can be used similarly to this
/// [TweenAnimationBuilder], but unlike the latter it is powered by a
/// developer-managed [AnimationController].
class
TweenAnimationBuilder
<
T
extends
Object
>
extends
ImplicitlyAnimatedWidget
{
class
TweenAnimationBuilder
<
T
extends
Object
?
>
extends
ImplicitlyAnimatedWidget
{
/// Creates a [TweenAnimationBuilder].
///
/// The properties [tween], [duration], and [builder] are required. The values
...
...
@@ -194,7 +194,7 @@ class TweenAnimationBuilder<T extends Object> extends ImplicitlyAnimatedWidget {
}
}
class
_TweenAnimationBuilderState
<
T
extends
Object
>
extends
AnimatedWidgetBaseState
<
TweenAnimationBuilder
<
T
>>
{
class
_TweenAnimationBuilderState
<
T
extends
Object
?
>
extends
AnimatedWidgetBaseState
<
TweenAnimationBuilder
<
T
>>
{
Tween
<
T
>?
_currentTween
;
@override
...
...
packages/flutter/test/widgets/tween_animation_builder_test.dart
View file @
5eabfc24
...
...
@@ -387,4 +387,21 @@ void main() {
await
tester
.
pump
(
const
Duration
(
seconds:
2
));
expect
(
values
,
everyElement
(
300
));
});
testWidgets
(
'Works with nullable tweens'
,
(
WidgetTester
tester
)
async
{
final
List
<
Size
?>
values
=
<
Size
?>[];
await
tester
.
pumpWidget
(
TweenAnimationBuilder
<
Size
?>(
duration:
const
Duration
(
seconds:
1
),
tween:
SizeTween
(
end:
const
Size
(
10
,
10
)),
builder:
(
BuildContext
context
,
Size
?
s
,
Widget
?
child
)
{
values
.
add
(
s
);
return
const
Placeholder
();
},
),
);
expect
(
values
,
<
Size
>[
const
Size
(
10
,
10
)]);
await
tester
.
pump
(
const
Duration
(
seconds:
2
));
expect
(
values
,
<
Size
>[
const
Size
(
10
,
10
)]);
});
}
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