CupertinoSliverNavigationBar class

An iOS-styled navigation bar with iOS-11-style large titles using slivers.

The CupertinoSliverNavigationBar must be placed in a sliver group such as the CustomScrollView.

This navigation bar consists of two sections, a pinned static section on top and a sliding section containing iOS-11-style large title below it.

It should be placed at top of the screen and automatically accounts for the iOS status bar.

Minimally, a largeTitle widget will appear in the middle of the app bar when the sliver is collapsed and transfer to the area below in larger font when the sliver is expanded.

For advanced uses, an optional middle widget can be supplied to show a different widget in the middle of the navigation bar when the sliver is collapsed.

Like CupertinoNavigationBar, it also supports a leading and trailing widget on the static section on top that remains while scrolling.

The leading widget will automatically be a back chevron icon button (or a close button in case of a fullscreen dialog) to pop the current route if none is provided and automaticallyImplyLeading is true (true by default).

The largeTitle widget will automatically be a title text from the current CupertinoPageRoute if none is provided and automaticallyImplyTitle is true (true by default).

When transitionBetweenRoutes is true, this navigation bar will transition on top of the routes instead of inside them if the route being transitioned to also has a CupertinoNavigationBar or a CupertinoSliverNavigationBar with transitionBetweenRoutes set to true. If transitionBetweenRoutes is true, none of the Widget parameters can contain any GlobalKeys in their subtrees since those widgets will exist in multiple places in the tree simultaneously.

By default, only one CupertinoNavigationBar or CupertinoSliverNavigationBar should be present in each PageRoute to support the default transitions. Use transitionBetweenRoutes or heroTag to customize the transition behavior for multiple navigation bars per route.

See also:

Inheritance

Constructors

CupertinoSliverNavigationBar({Key key, Widget largeTitle, Widget leading, bool automaticallyImplyLeading: true, bool automaticallyImplyTitle: true, String previousPageTitle, Widget middle, Widget trailing, Border border: _kDefaultNavBarBorder, Color backgroundColor: _kDefaultNavBarBackgroundColor, EdgeInsetsDirectional padding, Color actionsForegroundColor: CupertinoColors.activeBlue, bool transitionBetweenRoutes: true, Object heroTag: _defaultHeroTag })
Creates a navigation bar for scrolling lists. [...]
const

Properties

actionsForegroundColor Color
Default color used for text and icons of the leading and trailing widgets in the navigation bar. [...]
final
automaticallyImplyLeading bool
Controls whether we should try to imply the leading widget if null. [...]
final
automaticallyImplyTitle bool
Controls whether we should try to imply the largeTitle widget if null. [...]
final
backgroundColor Color
The background color of the navigation bar. If it contains transparency, the tab bar will automatically produce a blurring effect to the content behind it.
final
border Border
The border of the navigation bar. By default renders a single pixel bottom border side. [...]
final
heroTag Object
Tag for the navigation bar's Hero widget if transitionBetweenRoutes is true. [...]
final
largeTitle Widget
The navigation bar's title. [...]
final
leading Widget
Widget to place at the start of the navigation bar. Normally a back button for a normal page or a cancel button for full page dialogs. [...]
final
middle Widget
A widget to place in the middle of the static navigation bar instead of the largeTitle. [...]
final
opaque bool
True if the navigation bar's background color has no transparency.
read-only
padding EdgeInsetsDirectional
Padding for the contents of the navigation bar. [...]
final
previousPageTitle String
Manually specify the previous route's title when automatically implying the leading back button. [...]
final
trailing Widget
Widget to place at the end of the navigation bar. Normally additional actions taken on the page such as a search or edit function. [...]
final
transitionBetweenRoutes bool
Whether to transition between navigation bars. [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createState() → _CupertinoSliverNavigationBarState
Creates the mutable state for this widget at a given location in the tree. [...]
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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 toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel: DiagnosticLevel.debug }) String
Returns a string representation of this object.
inherited
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug }) 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 ==(dynamic other) bool
The equality operator. [...]
inherited