AdaptiveScaffold class

The Scaffold is designed to be a top level container for a AdpApp. This means that adding a Scaffold to each route on a adp app will provide the app with platform's basic visual layout structure.

It is typically not necessary to nest Scaffolds. For example, in a tabbed UI, where the bottomNavigationBar is a TabBar and the body is a TabBarView, you might be tempted to make each tab bar view a scaffold with a differently titled AppBar. Rather, it would be better to add a listener to the TabController that updates the AppBar

{@tool snippet} Add a listener to the app's tab controller so that the AdaptiveAppBar title of the app's one and only adp scaffold is reset each time a new tab is selected.

TabController(vsync: tickerProvider, length: tabCount)..addListener(() {
  if (!tabController.indexIsChanging) {
    setState(() {
      // Rebuild the enclosing scaffold with a new AppBar title
      appBarTitle = 'Tab ${tabController.index}';
    });
  }
})

{@end-tool}

Although there are some use cases, like a presentation app that shows embedded flutter content, where nested scaffolds are appropriate, it's best to avoid nesting scaffolds.

See also:

Inheritance
Available extensions

Constructors

AdaptiveScaffold({Key? key, AdaptiveAppBar? appBar, Widget? floatingActionButton, FloatingActionButtonLocation? floatingActionButtonLocation, FloatingActionButtonAnimator? floatingActionButtonAnimator, List<Widget>? persistentFooterButtons, AlignmentDirectional persistentFooterAlignment = AlignmentDirectional.centerEnd, AdaptiveDrawer? drawer, DrawerCallback? onDrawerChanged, AdaptiveDrawer? endDrawer, DrawerCallback? onEndDrawerChanged, Widget? bottomNavigationBar, Color? backgroundColor, bool primary = true, DragStartBehavior drawerDragStartBehavior = DragStartBehavior.start, bool extendBody = false, bool extendBodyBehindAppBar = false, Color? drawerScrimColor, String? restorationId, required Widget? body})
Creates an adaptive scaffold.
const

Properties

appBar → AdaptiveAppBar?
An app bar to display at the top of the scaffold.
final
backgroundColor → Color?
The color of the widget that underlies the entire Scaffold.
final
body → Widget?
The primary content of the scaffold.
final
bottomNavigationBar → Widget?
A bottom navigation bar to display at the bottom of the scaffold.
final
drawer → AdaptiveDrawer?
A panel displayed to the side of the body.
final
drawerDragStartBehavior → DragStartBehavior
Determines the way that drag start behavior is handled.
final
drawerScrimColor → Color?
The color to use for the scrim that obscures primary content while a drawer is open.
final
endDrawer → AdaptiveDrawer?
A panel displayed to the side of the body.
final
extendBody → bool
If true, and bottomNavigationBar or persistentFooterButtons is specified, then the body extends to the bottom of the Scaffold, instead of only extending to the top of the bottomNavigationBar or the persistentFooterButtons.
final
extendBodyBehindAppBar → bool
If true, and an appBar is specified, then the height of the body is extended to include the height of the app bar and the top of the body is aligned with the top of the app bar.
final
floatingActionButton → Widget?
A button displayed floating above body, in the bottom right corner.
final
floatingActionButtonAnimator → FloatingActionButtonAnimator?
Animator to move the floatingActionButton to a new floatingActionButtonLocation.
final
floatingActionButtonLocation → FloatingActionButtonLocation?
Responsible for determining where the floatingActionButton should go.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDrawerChanged → DrawerCallback?
Optional callback that is called when the Scaffold.drawer is opened or closed.
final
onEndDrawerChanged → DrawerCallback?
Optional callback that is called when the Scaffold.endDrawer is opened or closed.
final
persistentFooterAlignment → AlignmentDirectional
The alignment of the persistentFooterButtons inside the OverflowBar.
final
persistentFooterButtons → List<Widget>?
A set of buttons that are displayed at the bottom of the scaffold.
final
primary → bool
Whether this scaffold is being displayed at the top of the screen.
final
restorationId → String?
Restoration ID to save and restore the state of the Scaffold.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyDisabledEffect(bool isDisabled, [double disabledOpacity = 0.5, bool? ignoringPointer]) → Widget

Available on Widget, provided by the ApplyDisabledEffect extension

Wraps the current widget with an AnimatedOpacity to visually indicate whether the widget is enabled or disabled.
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
margeWith(Widget? child, [double? space = 4.0, Axis direction = Axis.horizontal]) → Widget

Available on Widget, provided by the MergeToChild extension

Merges the current widget with child, separated by a SizedBox.
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