CNTabRail class

A vertical tab bar for the side of the screen.

On iPhone Duo the system moves tab bars to a vertical bar on one edge — on the outer display, and in landscape on the inner display — but only the tab bars of system containers. CNTabBar is a standalone bar, so it stays horizontal; this widget is its vertical counterpart and takes the same CNTabBarItems. CNTabScaffold switches between the two automatically.

Native Liquid Glass on iOS 26 and later. On macOS it is a native sidebar list, a CNSidebar: the CNTabRailStyle.sidebar style shows each tab's icon and label as a sidebar row, the CNTabRailStyle.rail style only the icons (the label is the tooltip and the VoiceOver label). A Cupertino-drawn fallback elsewhere.

Inheritance
Available extensions

Constructors

CNTabRail({Key? key, required List<CNTabBarItem> items, required int currentIndex, required ValueChanged<int> onTap, CNTabRailStyle style = CNTabRailStyle.rail, Color? tint, bool autoHideOnPageTransition = true, bool autoHideOnModal = true})
Creates a vertical tab rail.
const

Properties

autoHideOnModal → bool
When true (default), the rail's platform view is removed while a modal (a dialog, popup or sheet) covers it, and created again when it closes, as the other glass widgets do (#146, Issue #53). Off, the rail stays and its glass is clipped to its own box while the modal is up. Needs CNTabBarRouteObserver() in the navigator's navigatorObservers.
final
autoHideOnPageTransition → bool
When true (default), the native rail is not drawn while its page is pushed over, popped back to, or covered by another page, as CNTabBar.autoHideOnPageTransition does (#146). Its platform view stays alive, so it is there again at once, but it draws nothing over the incoming page and takes no touches meanwhile. Off, its glass is clipped to its own box during the transition instead.
final
currentIndex → int
The selected tab.
final
hashCode → int
The hash code for this object.
no setterinherited
items → List<CNTabBarItem>
The tabs. SF Symbols (icon / activeIcon), custom icons, image assets (imageAsset / activeImageAsset, SVG or raster) and badges are supported. As in the system tab bar, icons are tinted and drawn at a fixed size.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap → ValueChanged<int>
Called with the index of a tapped tab, including the selected one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → CNTabRailStyle
Rail or sidebar.
final
tint → Color?
Colour of the selected tab. Defaults to the theme's primary colour.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<CNTabRail>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
liquidGlass({CNGlassEffect effect = CNGlassEffect.regular, CNGlassEffectShape shape = CNGlassEffectShape.capsule, double? cornerRadius, Color? tint, bool interactive = false}) → Widget

Available on Widget, provided by the LiquidGlassExtension extension

Applies a Liquid Glass effect to this widget.
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
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

railHeight(int count) → double
Height of the CNTabRailStyle.rail style with count items.

Constants

railWidth → const double
Width of the CNTabRailStyle.rail style.
sidebarWidth → const double
Width of the CNTabRailStyle.sidebar style.