-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BottomSheetRoute throws if declared as initial route #228
BottomSheetRoute throws if declared as initial route #228
Comments
Any update on this? In my case, this was happened when my app was restoring state and the bottom sheet was in the top of the navigation stack. |
Same issue. Any update on this? |
Same issue here unfortunately |
Having this issue as well. |
Same issue. |
Same issue here |
Hi.
just put |
It looks like that's what they do in Flutter ModalBottomSheetRoute. @override
AnimationController createAnimationController() {
assert(_animationController == null);
if (transitionAnimationController != null) {
_animationController = transitionAnimationController;
willDisposeAnimationController = false;
} else {
_animationController = BottomSheet.createAnimationController(navigator!);
}
return _animationController!;
} I opened a PR with that change: #379 |
I am using
modal_bottom_sheet
together withauto_route
package. My routes declaration looks more or less like this:When I try to navigate to other flow and push modal bottom sheet as the initial route, I get following error:
This is because
ModalBottomSheet
attempts to create animation controller before first frame in which caseoverlay
is still unavailable.https://github.com/jamesblasco/modal_bottom_sheet/blob/master/lib/src/bottom_sheet_route.dart#L176
Is there any specific reason to use
overlay
asTickerProvider
? E.g. bottom sheet from the SDK simply usesnavigator
to create the controller:https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/bottom_sheet.dart#L513
Let me know if I could provide any additional info that would be helpful.
The text was updated successfully, but these errors were encountered: