Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c83a088

Browse filesBrowse files
committed
fixes DrivenScrollActivity LateInitializationError _controller
1 parent 6e738ee commit c83a088
Copy full SHA for c83a088

File tree

Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed

‎packages/flutter/lib/src/widgets/scroll_activity.dart

Copy file name to clipboardExpand all lines: packages/flutter/lib/src/widgets/scroll_activity.dart
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,11 +597,10 @@ class BallisticScrollActivity extends ScrollActivity {
597597
AnimationController.unbounded(
598598
debugLabel: kDebugMode ? objectRuntimeType(this, 'BallisticScrollActivity') : null,
599599
vsync: vsync,
600-
)
601-
..addListener(_tick)
602-
..animateWith(
603-
simulation,
604-
).whenComplete(_end); // won't trigger if we dispose _controller before it completes.
600+
).addListener(_tick);
601+
//no cascade notation, to ensure _controller is initialized before we run the animation
602+
603+
_controller.animateWith(simulation).whenComplete(_end); // won't trigger if we dispose _controller before it completes.
605604
}
606605

607606
late AnimationController _controller;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.