-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Redesign snackbar API to not use routes #432
Comments
This sounds correct to me. Perhaps non-modal bottom sheets should also just be a scaffold feature? |
Well, they need a StateRoute so that they can react to the back button (I don't think snack bars should react to the back button). But beyond that, maybe. |
"showSnackBar()" is now a feature of a Scaffold. To get to a Scaffold you either use a global key (`scaffoldKey.currentState.showSnackBar(...)`), or you use `Scaffold.of(context)`. Snack bars no longer have a route. They are entirely managed by the Scaffold. Fixes flutter#432. Snack bars now queue up when you have several of them. Fixes flutter#374. Snack bars now auto-size themselves around their contents. This is step one towards implementing multiline snack bars. Snack bars now self-dismiss after some per-snackbar configurable period. The self-dismissing pauses while a dialog is up above the snackbar (or anything that uses ModalRoute). To enable this, there's now a `ModalRoute.of(context)` API that returns the current ModalRoute, and you will be rebuilt if you asked for this and the route's "current" status changes. To implement this, the Navigator now rebuilds unconditionally any time it pushes or pops a route. Snack bars now use the curves that Android uses for snack bars. Snack bar contents now fade in.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I think snack bars should be a feature of a Scaffold. They probably shouldn't use routes at all.
According to the specs -- https://www.google.com/design/spec/components/snackbars-toasts.html#snackbars-toasts-specs -- they should not time out while another route (e.g. a dialog) is over them, they should reset their timeout when their parent route resumes being the current route, they should be displayed consecutively in time, etc.
The text was updated successfully, but these errors were encountered: