-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Material] Expand BottomNavigationBar API (reprise) #28159
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
[Material] Expand BottomNavigationBar API (reprise) #28159
Conversation
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the Googlers can find more info about SignCLA and this PR by following this link. |
examples/flutter_gallery/lib/demo/material/bottom_navigation_demo.dart
Outdated
Show resolved
Hide resolved
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.
Couldn't you wrap this in a ReverseAnimation instead?
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 think so, however I find this (I didn't write this) easier to understand.
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.
Really? Because this seems a lot clearer to me (at least it would be to a newbie):
| opacity: Tween<double>(begin: 1.0, end: 0.0).animate(animation), | |
| opacity: ReverseAnimation(animation), |
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.
The documentation for ReverseAnimation says:
Using a ReverseAnimation is different from simply using a Tween with a begin of 1.0 and an end of 0.0 because the tween does not change the status or direction of the animation.
So what are the implications of changing the animation's direction or status (he asked rhetorically). While I'm scratching my head the person reading Tween<double>(begin: 1.0, end: 0.0) has already moved on.
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.
Well, but you could just as well scratch your head about what the .animate on the Tween does. Or the fact that a Tween isn't an animation, but you're assigning to one.
It's OK to keep it as a Tween, it's not a big deal, but I disagree that it's clearer.
Co-authored-by: MH Johnson <[email protected]> Co-authored-by: Hyo Chan Jang <[email protected]>
f23b7ad to
a1de2f4
Compare
|
How can I get this update to my flutter regularly ? I am running the newest version of the flutter plugin. |
|
Thank you guys for these new features, they look very promising. According to the docs: But when I try them in my AndroidStudio, I get "isnt defined" error. So, to me it looks like I cannot use them yet. What am I missing? :) |
@gisinator Make sure your settings are under |
|
thank you, @frey1esm , but I am afraid that's exactly what I did: Or did I do anything wrong? :) |
Looks good from here. What is your Flutter version? Also, this won't work with the |
|
Thank you sir, looks like this was the issue :) Until now I thought that Android Studio took care of updating the whole stuff. Every now and then I agreed on upating AndroidStudio, Dart, Emulator and so on. Didnt know I had to update Flutter version by myself and just went from 1.21 to 1.54-hotfix.2 Thank you @frey1esm , your help was appreciated :) |

These changes come from @johnsonmh in #27698.
This PR also incorporates work done by @hyochan in #22956.
Expand the BottomNavigationBar API.
Add the ability to customize the following fields on
BottomNavigationBars:backgroundColorelevationselectedItemColorunselectedItemColorselectedFontSizeunselectedFontSizeshowSelectedLabelsshowUnselectedLabelsCombining these fields allows users to create
BottomNavigationBars that match the current Material Design specifications, as well as support other requested features.The default behavior of BottomNavigationBar is still the same:
FixedShiftingCustom font size
Using custom
selectedFontSizeandunselectedFontSize, theBottomNavigationBarnow still animates properly.FixedShiftingCustom Coloring
Using custom
backgroundColor,selectedItemColor, andunselectedItemColor, theBottomNavigationBarcan be customized.Note: shifting
BottomNavigationBars respect the color of theirBottomNavigationBarItems rather than use theBottomNavigationBar'sbackgroundColor, this preserves the "ripple" behavior.FixedShiftingHide/Show labels
Being able to optionally hide/show selected and unselected labels on
fixedBottomNavigationBars allows us to get behavior described in the Material spec.showSelectedLabels && showUnselectedLabelsshowSelectedLabels && !showUnselectedLabels!showSelectedLabels && !showUnselectedLabelsCloses #23178
Closes #27414
Closes #17099
Closes #25895
Closes #22882
Closes #27739
Closes #27651