NavigationRailThemeData class

Defines default property values for descendant NavigationRail widgets.

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

Typically a NavigationRailThemeData is specified as part of the overall Theme with ThemeData.navigationRailTheme.

All NavigationRailThemeData properties are null by default. When null, the NavigationRail will use the values from ThemeData if they exist, otherwise it will provide its own defaults based on the overall Theme's textTheme and colorScheme. See the individual NavigationRail 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.navigationRailTheme.
const
factory

Properties

backgroundColor Color?
Color to be used for the NavigationRail's background.
final
badgeThemeData BadgeThemeData?
The theme applied to badges on NavigationRail 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?
The z-coordinate to be used for the NavigationRail's elevation.
final
groupAlignment double?
The alignment for the NavigationRailDestinations as they are positioned within the NavigationRail.
final
hashCode int
The hash code for this object.
no setteroverride
iconTheme WidgetStateProperty<IconThemeData?>?
The theme to merge with the default icon theme for NavigationRailDestination icons.
final
indicatorColor Color?
Overrides the default value of NavigationRail's selection indicator color, when useIndicator is true.
final
indicatorShape ShapeBorder?
Overrides the default shape of the NavigationRail's selection indicator.
final
labelType NavigationRailLabelType?
The type that defines the layout and behavior of the labels in the NavigationRail.
final
margin EdgeInsetsGeometry?
Applies a margin around each navigation item in the rail.
final
minExtendedWidth double?
Overrides the default value of NavigationRail's minimum width when it is extended.
final
minWidth double?
Overrides the default value of NavigationRail's minimum width when it is not extended.
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
selectedIconTheme IconThemeData?
The theme to merge with the default icon theme for NavigationRailDestination icons, when the destination is selected.
final
selectedLabelTextStyle TextStyle?
The style to merge with the default text style for NavigationRailDestination labels, when the destination is selected.
final
showLabelsWhenCollapsed bool?
Whether labels are shown while the rail is collapsed and labelType is NavigationRailLabelType.none.
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 labelType is NavigationRailLabelType.none and showLabelsWhenCollapsed is false).
final
tooltipTriggerWhenLabelVisible TooltipTriggerMode?
Overrides tooltipTrigger specifically when the destination label is currently visible.
final
unselectedIconTheme IconThemeData?
The theme to merge with the default icon theme for NavigationRailDestination icons, when the destination is not selected.
final
unselectedLabelTextStyle TextStyle?
The style to merge with the default text style for NavigationRailDestination labels, when the destination is not selected.
final
useIndicator bool?
Whether or not the selected NavigationRailDestination should include a NavigationIndicator.
final

Methods

copyWith({Color? backgroundColor, double? elevation, TextStyle? unselectedLabelTextStyle, TextStyle? selectedLabelTextStyle, IconThemeData? unselectedIconTheme, IconThemeData? selectedIconTheme, double? groupAlignment, NavigationRailLabelType? labelType, bool? useIndicator, Color? indicatorColor, ShapeBorder? indicatorShape, WidgetStateProperty<Color?>? destinationOverlayColor, ShapeBorder? destinationIndicatorShape, bool? showLabelsWhenCollapsed, double? minWidth, double? minExtendedWidth, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, Offset? tooltipOffset, TooltipTriggerMode? tooltipTrigger, TooltipTriggerMode? tooltipTriggerWhenLabelVisible, TooltipTriggerMode? tooltipTriggerWhenLabelHidden, WidgetStateProperty<IconThemeData?>? iconTheme, BadgeThemeData? badgeThemeData}) NavigationRailThemeData
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(NavigationRailThemeData? a, NavigationRailThemeData? b, double t) NavigationRailThemeData?
Linearly interpolate between two navigation rail themes.
override