NavigationBarThemeData class

Defines default property values for descendant NavigationBar widgets.

Descendant widgets obtain the current NavigationBarThemeData object using NavigationBarTheme.of(context). Instances of NavigationBarThemeData can be customized with NavigationBarThemeData.copyWith.

Typically a NavigationBarThemeData is specified as part of the overall Theme with ThemeData.navigationBarTheme. Alternatively, a NavigationBarTheme inherited widget can be used to theme NavigationBars in a subtree of widgets.

All NavigationBarThemeData properties are null by default. When null, the NavigationBar will provide its own defaults based on the overall Theme's textTheme and colorScheme. See the individual NavigationBar properties for details.

See also:

  • ThemeData, which describes the overall theme information for the application.
Implemented types
Mixed-in types
Annotations

Constructors

Creates a theme that can be used for ThemeData.navigationBarTheme and NavigationBarTheme.
const
factory

Properties

backgroundColor Color?
Overrides the default value of NavigationBar.backgroundColor.
final
badgeThemeData BadgeThemeData?
The theme applied to badges on NavigationBar destinations.
final
destinationIndicatorShape ShapeBorder?
Shape of the full navigation item container ink well.
final
destinationOverlayColor WidgetStateProperty<Color?>?
Overlay colors for the full navigation item container by widget state.
final
elevation double?
Overrides the default value of NavigationBar.elevation.
final
hashCode int
The hash code for this object.
no setteroverride
height double?
Overrides the default value of NavigationBar.height.
final
iconTheme WidgetStateProperty<IconThemeData?>?
The theme to merge with the default icon theme for NavigationDestination icons.
final
indicatorColor Color?
Overrides the default value of NavigationBar's selection indicator.
final
indicatorShape ShapeBorder?
Overrides the default shape of the NavigationBar's selection indicator.
final
labelBehavior NavigationDestinationLabelBehavior?
Overrides the default value of NavigationBar.labelBehavior.
final
labelPadding EdgeInsetsGeometry?
Applies padding around navigation item labels. Defaults to EdgeInsets.zero.
final
labelTextStyle WidgetStateProperty<TextStyle?>?
The style to merge with the default text style for NavigationDestination labels.
final
margin EdgeInsetsGeometry?
Applies a margin around each navigation item in the bar.
final
overlayColor WidgetStateProperty<Color?>?
Overrides the default value of NavigationBar.overlayColor.
final
padding EdgeInsetsGeometry?
Applies padding inside each navigation item's content area.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor Color?
Overrides the default value of NavigationBar.shadowColor.
final
surfaceTintColor Color?
Overrides the default value of NavigationBar.surfaceTintColor.
final
tooltipOffset Offset?
Defines the x/y offset of tooltip popovers relative to the default anchor position.
final
tooltipTrigger TooltipTriggerMode?
Controls which gesture triggers the tooltip popover.
final
tooltipTriggerWhenLabelHidden TooltipTriggerMode?
Overrides tooltipTrigger specifically when the destination label is currently hidden (e.g., when labelBehavior is NavigationDestinationLabelBehavior.alwaysHide or the destination is unselected in NavigationDestinationLabelBehavior.onlyShowSelected).
final
tooltipTriggerWhenLabelVisible TooltipTriggerMode?
Overrides tooltipTrigger specifically when the destination label is currently visible.
final

Methods

copyWith({double? height, Color? backgroundColor, double? elevation, Color? shadowColor, Color? surfaceTintColor, Color? indicatorColor, ShapeBorder? indicatorShape, WidgetStateProperty<TextStyle?>? labelTextStyle, WidgetStateProperty<IconThemeData?>? iconTheme, NavigationDestinationLabelBehavior? labelBehavior, WidgetStateProperty<Color?>? overlayColor, WidgetStateProperty<Color?>? destinationOverlayColor, ShapeBorder? destinationIndicatorShape, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, Offset? tooltipOffset, EdgeInsetsGeometry? labelPadding, TooltipTriggerMode? tooltipTrigger, TooltipTriggerMode? tooltipTriggerWhenLabelVisible, TooltipTriggerMode? tooltipTriggerWhenLabelHidden, BadgeThemeData? badgeThemeData}) NavigationBarThemeData
Creates a copy of this object with the given fields replaced with the new values.
override
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(NavigationBarThemeData? a, NavigationBarThemeData? b, double t) NavigationBarThemeData?
Linearly interpolate between two navigation rail themes.
override