Skip to content
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

Closed
Hixie opened this issue Nov 17, 2015 · 3 comments · Fixed by #479
Closed

Redesign snackbar API to not use routes #432

Hixie opened this issue Nov 17, 2015 · 3 comments · Fixed by #479
Assignees
Labels
c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.

Comments

@Hixie
Copy link
Contributor

Hixie commented Nov 17, 2015

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.

@Hixie Hixie added ⚠ bug c: new feature Nothing broken; request for a new capability team Infra upgrades, team productivity, code health, technical debt. See also team: labels. framework flutter/packages/flutter repository. See also f: labels. labels Nov 17, 2015
@Hixie Hixie added this to the Blue Sky milestone Nov 17, 2015
@HansMuller
Copy link
Contributor

This sounds correct to me. Perhaps non-modal bottom sheets should also just be a scaffold feature?

@Hixie
Copy link
Contributor Author

Hixie commented Nov 17, 2015

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.

@Hixie Hixie self-assigned this Nov 17, 2015
Hixie added a commit to Hixie/flutter that referenced this issue Nov 19, 2015
"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.
@github-actions
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants