CNNavigationBar class

A Cupertino-native navigation bar with liquid glass translucent effect.

Uses native UINavigationBar on iOS and NSToolbar on macOS for authentic translucent blur effects. The navigation bar automatically blurs content behind it, creating the signature iOS/macOS "liquid glass" appearance.

Inheritance

Constructors

CNNavigationBar({Key? key, List<CNNavigationBarAction>? leading, String? title, double? titleSize, VoidCallback? onTitlePressed, List<CNNavigationBarAction>? trailing, bool largeTitle = false, bool transparent = true, Color? tint, double? height, List<String>? segmentedControlLabels, int? segmentedControlSelectedIndex, ValueChanged<int>? onSegmentedControlValueChanged, double? segmentedControlHeight, double? segmentedControlLabelSize, Color? segmentedControlTint})
Creates a native translucent navigation bar.
const
CNNavigationBar.scrollable({Key? key, List<CNNavigationBarAction>? leading, String? title, double? titleSize, VoidCallback? onTitlePressed, List<CNNavigationBarAction>? trailing, required Widget? scrollableContent, bool largeTitle = true, bool transparent = false, Color? tint, double? height, List<String>? segmentedControlLabels, int? segmentedControlSelectedIndex, ValueChanged<int>? onSegmentedControlValueChanged, double? segmentedControlHeight, double? segmentedControlLabelSize, Color? segmentedControlTint})
Creates a navigation bar with native UINavigationController and scroll view.
const
CNNavigationBar.search({Key? key, List<CNNavigationBarAction>? leading, String? title, double? titleSize, VoidCallback? onTitlePressed, List<CNNavigationBarAction>? trailing, required CNSearchConfig? searchConfig, bool largeTitle = false, bool transparent = true, Color? tint, double? height, List<String>? segmentedControlLabels, int? segmentedControlSelectedIndex, ValueChanged<int>? onSegmentedControlValueChanged, double? segmentedControlHeight, double? segmentedControlLabelSize, Color? segmentedControlTint})
Creates a navigation bar with integrated search functionality.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
height double?
Fixed height (if null, uses intrinsic platform height).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
largeTitle bool
Use large title style (iOS 11+ style).
final
leading List<CNNavigationBarAction>?
Leading actions (typically back button, can include multiple items).
final
onSegmentedControlValueChanged ValueChanged<int>?
Called when a segment is selected in the center segmented control.
final
onTitlePressed VoidCallback?
Callback when the title is tapped. If null, the title is not clickable.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollableContent Widget?
Scrollable content widget (only for scrollable navigation bar with UINavigationController). This should be your page content that will be placed in a native scroll view.
final
searchConfig CNSearchConfig?
Search configuration (only for search-enabled navigation bar).
final
segmentedControlHeight double?
Height of the center segmented control in logical pixels. If null, uses platform default height (typically 28 points).
final
segmentedControlLabels List<String>?
Segment labels for the center segmented control. If provided, replaces the title with a segmented control.
final
segmentedControlLabelSize double?
Font size for the segmented control labels. If null, uses platform default font size.
final
segmentedControlSelectedIndex int?
Selected index for the center segmented control.
final
segmentedControlTint Color?
Tint color for the selected segment background in the segmented control. This is the background color of the selected segment. If null, uses the navigation bar's tint color or system default.
final
tint Color?
Tint color for buttons and icons.
final
title String?
Title text for the navigation bar.
final
titleSize double?
Font size for the title text in points. If null, uses the platform default title size.
final
trailing List<CNNavigationBarAction>?
Trailing actions (buttons/icons on the right). For search-enabled navigation bar, search button is added automatically.
final
transparent bool
Use completely transparent background (no blur).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CNNavigationBar>
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
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