CNTabScaffold class
A tab layout that follows the screen it is on — the answer to "the tab bar should move to the side" on iPhone Duo.
iOS 27.1 moves a system tab bar to a vertical bar on one edge of the iPhone Duo outer display, and of the inner display in landscape. It does that only for system containers, so a CNTabBar stays at the bottom. CNTabScaffold reproduces the behaviour: it shows a CNTabBar at the bottom, swaps it for a CNTabRail in the vertical-bar column whenever the system uses one, and, with sidebarOnWideScreens, for a sidebar on screens at least sidebarMinWidth wide (the open inner display in portrait).
It reads the vertical-bar side from CNFoldable, so put a CNFoldableScope above it (or anywhere above the app).
body stays mounted across every placement change, so folding and
unfolding never resets the page's state. It receives a MediaQuery whose
padding includes the space the tabs take, so scroll views keep their last
item clear of the bar.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- CNTabScaffold
- Available extensions
Constructors
-
CNTabScaffold({Key? key, required List<
CNTabBarItem> items, required int currentIndex, required ValueChanged<int> onTap, required Widget body, Color? tint, Color? backgroundColor, bool sidebarOnWideScreens = false, double sidebarMinWidth = 600, CNTabPlacement? placement, WidgetBuilder? tabBarBuilder}) -
Creates an adaptive tab scaffold.
const
Properties
- backgroundColor → Color?
-
Background behind body. Defaults to the system background.
final
- body → Widget
-
The page for the selected tab.
final
- currentIndex → int
-
The selected tab.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
CNTabBarItem> -
The tabs, shared by the bottom bar and the rail.
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.
final
- placement → CNTabPlacement?
-
Forces a placement instead of choosing one. With CNTabPlacement.rail
and no system vertical bar, the rail goes on the right.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Narrowest screen that gets a sidebar when sidebarOnWideScreens is on.
final
-
Show a sidebar instead of the bottom bar on screens at least
sidebarMinWidth wide. The vertical bar still takes precedence.
final
- tabBarBuilder → WidgetBuilder?
-
Builds the bottom bar, for CNTabBar options this scaffold does not
expose (split mode, search, fonts…). Defaults to a CNTabBar with
items, currentIndex, onTap and tint.
final
- tint → Color?
-
Colour of the selected tab.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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
-
resolvePlacement(
BuildContext context) → CNTabPlacement -
The placement this scaffold uses in
context. -
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
Constants
- bottomBarExtent → const double
- Height the bottom bar is assumed to take, above the bottom safe area.