-
Notifications
You must be signed in to change notification settings - Fork 29.7k
docs: Add more potential use case for Bottom Navigation Bar #99644
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
Conversation
|
@HansMuller does this pr need additional changes? |
|
The new examples system requires a tests for each example. They can be simple basic functionality unit tests. See for example examples/api/test/material/appbar/app_bar.0_test.dart |
guidezpl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! I like the example for scrolling to top, but using bottom nav to change state is a bit of an anti-pattern.
It would be more useful to showcase an example like "having a unique item that doesn't update the selectedIndex (ie. a button that opens a dropdown or modal instead of updating the displayed Scaffold.body)"
| onTap: (int index) { | ||
| switch (index) { | ||
| case 0: | ||
| _homeController.animateTo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only scroll if the selected tab is index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing _selectedIndex == 0, perhaps you need to push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine now.
|
1 similar comment
|
|
2 similar comments
|
|
|
17 similar comments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
Adds the dartpad example for the use case mentioned in the issue
Fixes #33810
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.