ResponsiveScaffold class

A Scaffold that rearranges itself according to the device size.

Uses LayoutInfo to decide key elements of the layout. This class has two uses: with and without primary navigation items. These are items that would normally be placed in a BottomNavigationBar. When primary navigation items are provided, two different drawers are used: with and without the primary navigation items (to avoid duplication in the UI).

See the package documentation for how the layout is determined.

Inheritance

Constructors

ResponsiveScaffold({required Widget drawer, required Widget body, required PreferredSizeWidget appBar, Widget? floatingActionButton, Widget? sideSheet, FloatingActionButtonLocation? floatingActionButtonLocation})
Creates a scaffold that responds to the screen size.
const
ResponsiveScaffold.navBar({required Widget drawer, required Widget? secondaryDrawer, required PreferredSizeWidget appBar, required Widget body, required List<NavigationItem>? navItems, required int? navIndex, required ValueChanged<int>? onNavIndexChanged, Widget? sideSheet, Widget? floatingActionButton, FloatingActionButtonLocation? floatingActionButtonLocation})
Creates a responsive layout with primary navigation items.
const

Properties

appBar PreferredSizeWidget
The app bar.
final
body Widget
The main body of the scaffold.
final
drawer Widget
The full drawer to show.
final
floatingActionButton Widget?
The Floating Action Button.
final
floatingActionButtonLocation FloatingActionButtonLocation?
The location of the floating action button.
final
hashCode int
The hash code for this object.
no setterinherited
hasNavBar bool
Whether this widget is being used with a navigation bar.
no setter
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
The index of the current navigation item in navItems.
final
The navigation items.
final
onNavIndexChanged ValueChanged<int>?
A callback for when the user selects a navigation item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryDrawer Widget?
The secondary, more compact, navigation drawer.
final
sideSheet Widget?
The side sheet.
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
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}) 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