Visitar URL original
Migrate the Animations Package to NNBD by pennzht · Pull Request #245 · flutter/packages · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
20ecd19
On this branch, I will migrate the `animations` package to NNBD.
pennzht Nov 16, 2020
8adc3b5
Initial migration, with tool.
pennzht Nov 16, 2020
7cd9a64
Fix type.
pennzht Nov 16, 2020
78acddd
Fix child?.
pennzht Nov 16, 2020
dc57e56
Add late.
pennzht Nov 16, 2020
a855220
Remove null asserts.
pennzht Nov 16, 2020
56eeaa0
Remove unreachable nulls.
pennzht Nov 16, 2020
346e12c
Remove null asserts.
pennzht Nov 16, 2020
2ca996f
Add !.
pennzht Nov 16, 2020
b4906e0
Correct type.
pennzht Nov 16, 2020
59c9f62
Remove unreachable null.
pennzht Nov 16, 2020
b738ec3
Fix type for transitionType.
pennzht Nov 16, 2020
741a1b4
Fix type.
pennzht Nov 16, 2020
47c6675
Fix type.
pennzht Nov 16, 2020
f8a3965
Remove unnecessary cast.
pennzht Nov 16, 2020
6c3d1a1
Update pubspec.yaml.
pennzht Nov 16, 2020
f8def36
Add analysis_options.yaml.
pennzht Nov 16, 2020
4a994bd
Remove unreachable null.
pennzht Nov 16, 2020
97ca867
Update version.
pennzht Nov 16, 2020
71fb7ab
Remove analysis_options.yaml.
pennzht Nov 16, 2020
94262fc
Fix ColorTween.
pennzht Nov 16, 2020
065e98a
Use bool?.
pennzht Nov 16, 2020
2866bbc
Update route string.
pennzht Nov 16, 2020
1ed746b
Update ValueKey<String> to ValueKey<String?>.
pennzht Nov 16, 2020
04fea7a
Update type signature.
pennzht Nov 16, 2020
0ab8b2e
On this branch, I will remove unnecessary null assertions.
pennzht Nov 16, 2020
d1906e5
Remove unused code, part 1.
pennzht Nov 16, 2020
64b67b1
Remove unused code, part 2.
pennzht Nov 16, 2020
114459b
Add `late` keyword.
pennzht Nov 16, 2020
21af16e
Revert "Add `late` keyword."
pennzht Nov 16, 2020
3467e7a
Add case null.
pennzht Nov 16, 2020
f57dd73
Remove unused code, part 3.
pennzht Nov 16, 2020
6da1e6c
Remove unused code, part 4.
pennzht Nov 16, 2020
e6b1e78
Remove unused code, part 5.
pennzht Nov 16, 2020
bf8336f
Remove unused code, part 6.
pennzht Nov 16, 2020
e7d392e
Remove /*!*/.
pennzht Nov 16, 2020
9741550
Ignore `avoid_as` as a rule.
pennzht Nov 16, 2020
043a4ce
Remove analysis_options.yaml.
pennzht Nov 16, 2020
ae044a3
Add
pennzht Nov 16, 2020
7b85dd5
Run `flutter format .`.
pennzht Nov 16, 2020
2aed6bc
Bump animations version.
pennzht Nov 16, 2020
469f1ad
Correct type from `OpenContainerBuilder` to `CloseContainerBuilder`.
pennzht Nov 16, 2020
f48fbac
Update vector_math.
pennzht Nov 16, 2020
aa9edaf
Update changelog.
pennzht Nov 16, 2020
900c909
Remove dual_transition_builder.dart.
pennzht Nov 18, 2020
773c320
Replace all occurrences of dual_transition_builder.
pennzht Nov 18, 2020
1c80afb
Remove duplicate import.
pennzht Nov 18, 2020
d29301c
Remove 'ignore avoid_as' comments.
pennzht Nov 18, 2020
0b5aae4
Remove `avoid_as` from root.
pennzht Nov 18, 2020
24b150f
Merge branch 'nnbd' into nnbd-t4-merge-nnbd
pennzht Nov 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ValueKey<String> to ValueKey<String?>.
  • Loading branch information
pennzht committed Nov 16, 2020
commit 1ed746b7c70125f9a31e5bd3d053a1d15e9f6e85
108 changes: 54 additions & 54 deletions packages/animations/test/shared_axis_transition_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ void main() {
);

final _StatefulTestWidgetState bottomState = tester.state(
find.byKey(const ValueKey<String>(bottomRoute)),
find.byKey(const ValueKey<String?>(bottomRoute)),
);
expect(bottomState.widget.name, bottomRoute);

Expand All @@ -444,65 +444,65 @@ void main() {
await tester.pump();

expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
final _StatefulTestWidgetState topState = tester.state(
find.byKey(const ValueKey<String>(topRoute)),
find.byKey(const ValueKey<String?>(topRoute)),
);
expect(topState.widget.name, topRoute);

await tester.pump(const Duration(milliseconds: 150));
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pumpAndSettle();
expect(
tester.state(find.byKey(
const ValueKey<String>(bottomRoute),
const ValueKey<String?>(bottomRoute),
skipOffstage: false,
)),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

navigator.currentState!.pop();
await tester.pump();

expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pump(const Duration(milliseconds: 150));
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pumpAndSettle();
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(find.byKey(const ValueKey<String>(topRoute)), findsNothing);
expect(find.byKey(const ValueKey<String?>(topRoute)), findsNothing);
},
);

Expand All @@ -525,7 +525,7 @@ void main() {
Finder fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/')),
of: find.byKey(const ValueKey<String?>('/')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -539,7 +539,7 @@ void main() {
fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/a')),
of: find.byKey(const ValueKey<String?>('/a')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -564,7 +564,7 @@ void main() {
Finder fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/')),
of: find.byKey(const ValueKey<String?>('/')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -577,7 +577,7 @@ void main() {
fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/a')),
of: find.byKey(const ValueKey<String?>('/a')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand Down Expand Up @@ -1078,7 +1078,7 @@ void main() {
);

final _StatefulTestWidgetState bottomState = tester.state(
find.byKey(const ValueKey<String>(bottomRoute)),
find.byKey(const ValueKey<String?>(bottomRoute)),
);
expect(bottomState.widget.name, bottomRoute);

Expand All @@ -1087,65 +1087,65 @@ void main() {
await tester.pump();

expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
final _StatefulTestWidgetState topState = tester.state(
find.byKey(const ValueKey<String>(topRoute)),
find.byKey(const ValueKey<String?>(topRoute)),
);
expect(topState.widget.name, topRoute);

await tester.pump(const Duration(milliseconds: 150));
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pumpAndSettle();
expect(
tester.state(find.byKey(
const ValueKey<String>(bottomRoute),
const ValueKey<String?>(bottomRoute),
skipOffstage: false,
)),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

navigator.currentState!.pop();
await tester.pump();

expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pump(const Duration(milliseconds: 150));
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pumpAndSettle();
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(find.byKey(const ValueKey<String>(topRoute)), findsNothing);
expect(find.byKey(const ValueKey<String?>(topRoute)), findsNothing);
},
);

Expand All @@ -1168,7 +1168,7 @@ void main() {
Finder fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/')),
of: find.byKey(const ValueKey<String?>('/')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -1182,7 +1182,7 @@ void main() {
fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/a')),
of: find.byKey(const ValueKey<String?>('/a')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -1207,7 +1207,7 @@ void main() {
Finder fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/')),
of: find.byKey(const ValueKey<String?>('/')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -1220,7 +1220,7 @@ void main() {
fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/a')),
of: find.byKey(const ValueKey<String?>('/a')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand Down Expand Up @@ -1614,7 +1614,7 @@ void main() {
);

final _StatefulTestWidgetState bottomState = tester.state(
find.byKey(const ValueKey<String>(bottomRoute)),
find.byKey(const ValueKey<String?>(bottomRoute)),
);
expect(bottomState.widget.name, bottomRoute);

Expand All @@ -1623,65 +1623,65 @@ void main() {
await tester.pump();

expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
final _StatefulTestWidgetState topState = tester.state(
find.byKey(const ValueKey<String>(topRoute)),
find.byKey(const ValueKey<String?>(topRoute)),
);
expect(topState.widget.name, topRoute);

await tester.pump(const Duration(milliseconds: 150));
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pumpAndSettle();
expect(
tester.state(find.byKey(
const ValueKey<String>(bottomRoute),
const ValueKey<String?>(bottomRoute),
skipOffstage: false,
)),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

navigator.currentState!.pop();
await tester.pump();

expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pump(const Duration(milliseconds: 150));
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(
tester.state(find.byKey(const ValueKey<String>(topRoute))),
tester.state(find.byKey(const ValueKey<String?>(topRoute))),
topState,
);

await tester.pumpAndSettle();
expect(
tester.state(find.byKey(const ValueKey<String>(bottomRoute))),
tester.state(find.byKey(const ValueKey<String?>(bottomRoute))),
bottomState,
);
expect(find.byKey(const ValueKey<String>(topRoute)), findsNothing);
expect(find.byKey(const ValueKey<String?>(topRoute)), findsNothing);
},
);

Expand All @@ -1704,7 +1704,7 @@ void main() {
Finder fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/')),
of: find.byKey(const ValueKey<String?>('/')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -1718,7 +1718,7 @@ void main() {
fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/a')),
of: find.byKey(const ValueKey<String?>('/a')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -1743,7 +1743,7 @@ void main() {
Finder fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/')),
of: find.byKey(const ValueKey<String?>('/')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand All @@ -1756,7 +1756,7 @@ void main() {
fillContainerFinder = find
.ancestor(
matching: find.byType(Container),
of: find.byKey(const ValueKey<String>('/a')),
of: find.byKey(const ValueKey<String?>('/a')),
)
.last;
expect(fillContainerFinder, findsOneWidget);
Expand Down Expand Up @@ -1833,7 +1833,7 @@ void main() {

double _getOpacity(String key, WidgetTester tester) {
final Finder finder = find.ancestor(
of: find.byKey(ValueKey<String>(key)),
of: find.byKey(ValueKey<String?>(key)),
matching: find.byType(FadeTransition),
);
return tester.widgetList(finder).fold<double>(1.0, (double a, Widget widget) {
Expand All @@ -1848,7 +1848,7 @@ double? _getTranslationOffset(
SharedAxisTransitionType transitionType,
) {
final Finder finder = find.ancestor(
of: find.byKey(ValueKey<String>(key)),
of: find.byKey(ValueKey<String?>(key)),
matching: find.byType(Transform),
);

Expand Down Expand Up @@ -1880,7 +1880,7 @@ double? _getTranslationOffset(

double _getScale(String key, WidgetTester tester) {
final Finder finder = find.ancestor(
of: find.byKey(ValueKey<String>(key)),
of: find.byKey(ValueKey<String?>(key)),
matching: find.byType(ScaleTransition),
);
return tester.widgetList(finder).fold<double>(1.0, (double a, Widget widget) {
Expand Down