You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code Comments Error in "flutter/packages/flutter/lib/src/material /navigation_bar.dart" #162592
class NavigationDestination extends StatelessWidget {
...
/// The text label that appears below the icon of this
/// [NavigationDestination].
///
/// The accompanying [Text] widget will use
/// [NavigationBarThemeData.labelTextStyle]. If this are null, the default
/// text style would use [TextTheme.labelSmall] with [ColorScheme.onSurface].
final String label;
...
}
If this are null, the default text style would use [TextTheme.labelSmall] is wrong. Actually, This is right in material2, but wrong in material3. I have dived into _NavigationBarDefaultsM3, I found this:
The default text style would use [TextTheme.labelMedium] in Material3.
Conclusion
Rectify the comments as below:
/// The text label that appears below the icon of this
/// [NavigationDestination].
///
/// The accompanying [Text] widget will use
/// [NavigationBarThemeData.labelTextStyle]. If this are null, the default
/// text style would use [TextTheme.labelSmall] with [ColorScheme.onSurface]
/// when [ThemeData.useMaterial3] is false, and use [TextTheme.labelMedium]
/// when [ThemeData.useMaterial3] is true.
final String label;
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.
Activity
Update code comments for navigation_bar.dart (#162596)
github-actions commentedon Feb 20, 2025
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 -vand a minimal reproduction of the issue.Update code comments for navigation_bar.dart (#162596)