-
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
Added option to disable [NavigationDrawerDestination]s #132349
Added option to disable [NavigationDrawerDestination]s #132349
Conversation
bump |
Bump 2 |
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.
LGTM
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 a lot for the contribution! LGTM! Just left some nit:)
@@ -229,12 +230,18 @@ class NavigationDrawerDestination extends StatelessWidget { | |||
/// text style would use [TextTheme.labelLarge] with [ColorScheme.onSurfaceVariant]. | |||
final Widget label; | |||
|
|||
/// Indicates that this destination is selectable. |
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.
/// Indicates that this destination is selectable. | |
/// Indicates that this destination is selectable. | |
/// | |
/// Defaults to true. |
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.
Seems this has a default value, so might be good to mention this:)
@@ -322,20 +332,31 @@ class _NavigationDestinationBuilder extends StatelessWidget { | |||
/// animation is decreasing or dismissed. | |||
final WidgetBuilder buildLabel; | |||
|
|||
final bool enabled; |
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 we also add some documentation here?
selectedIndex = i; | ||
}, | ||
), | ||
useMaterial3: true, |
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.
useMaterial3: true, |
We can just remove this because useMaterial3
defaults to true now:)
Seems Google testing is failed because of merge conflict. Could you help rebase master and solve the conflicts:) ? |
Sure, will do it tonight |
…ment inserted during the development of the disable option in the NavigationDrawer
… double negatives
…to achieve the desired disabled color on the [NavigationDrawerDestination] widget
…rDestination] to its documentation. Also removed implicit useMaterial3 from its tests.
a6ce9ed
to
a8c43e7
Compare
This PR adds a new option in the NavigationDrawerDestination api allowing it to be disabled, this is very useful for role based access control, especially in the navigation drawer which is used to lay out all the app destinations * flutter#132348
…tination widget) (flutter#132361) This PR adds a new option in the NavigationDestination api (the destination widget for the NavigationBar) allowing it to be disabled. As the issue states this PR is the NavigationBar's version of these two PRs (flutter#132349 and flutter#127113) * flutter#132359
This PR adds a new option in the NavigationDrawerDestination api allowing it to be disabled, this is very useful for role based access control, especially in the navigation drawer which is used to lay out all the app destinations
Pre-launch Checklist
///
).