BackdropScaffold class

Implements the basic functionality of backdrop.

This class internally uses Scaffold. It allows to set a back layer and a front layer and manage the switching between the two. The implementation is inspired by the material backdrop component.

Usage example:

Widget build(BuildContext context) {
  return MaterialApp(
    title: 'Backdrop Demo',
    home: BackdropScaffold(
      appBar: BackdropAppBar(
        title: Text("Backdrop Example"),
        actions: <Widget>[
          BackdropToggleButton(
            icon: AnimatedIcons.list_view,
          )
        ],
      ),
      backLayer: Center(
        child: Text("Back Layer"),
      ),
      frontLayer: Center(
        child: Text("Front Layer"),
      ),
    ),
  );
}

See also:

  • Scaffold, which is the plain scaffold used in material apps.
Inheritance

Constructors

BackdropScaffold({Key? key, AnimationController? animationController, required Widget backLayer, required Widget frontLayer, Widget? subHeader, bool subHeaderAlwaysActive = true, double? headerHeight, ShapeBorder frontLayerShape = const RoundedRectangleBorder(borderRadius: BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16))), BorderRadius? frontLayerBorderRadius, double frontLayerElevation = 1, bool stickyFrontLayer = false, bool revealBackLayerAtStart = false, Curve animationCurve = Curves.ease, Curve? reverseAnimationCurve, Color? frontLayerBackgroundColor, double frontLayerActiveFactor = 1, Color? backLayerBackgroundColor, Color frontLayerScrim = Colors.white70, Color backLayerScrim = Colors.black54, VoidCallback? onBackLayerConcealed, VoidCallback? onBackLayerRevealed, bool maintainBackLayerState = true, bool concealBacklayerOnBackButton = true, GlobalKey<ScaffoldState>? scaffoldKey, PreferredSizeWidget? appBar, Widget? floatingActionButton, FloatingActionButtonLocation? floatingActionButtonLocation, FloatingActionButtonAnimator? floatingActionButtonAnimator, List<Widget>? persistentFooterButtons, Widget? drawer, DrawerCallback? onDrawerChanged, Widget? endDrawer, DrawerCallback? onEndDrawerChanged, Widget? bottomNavigationBar, Widget? bottomSheet, Color? backgroundColor, bool? resizeToAvoidBottomInset, bool primary = true, DragStartBehavior drawerDragStartBehavior = DragStartBehavior.start, bool extendBody = false, bool extendBodyBehindAppBar = false, Color? drawerScrimColor, double? drawerEdgeDragWidth, bool drawerEnableOpenDragGesture = true, bool endDrawerEnableOpenDragGesture = true, String? restorationId})
Creates a backdrop scaffold to be used as a material widget.

Properties

animationController AnimationController?
Can be used to customize the behaviour of the backdrop animation.
final
animationCurve Curve
The animation curve used for the backdrop animation.
final
appBar PreferredSizeWidget?
See Scaffold.appBar and BackdropAppBar.
final
backgroundColor Color?
See Scaffold.backgroundColor.
final
backLayer Widget
Content that should be displayed on the back layer.
final
backLayerBackgroundColor Color?
Background Color for the back layer.
final
backLayerScrim Color
Scrim over backLayer when active (back layer concealed).
final
bottomNavigationBar Widget?
See Scaffold.bottomNavigationBar.
final
bottomSheet Widget?
See Scaffold.bottomSheet.
final
concealBacklayerOnBackButton bool
Specifiy whether to conceal backLayer when back button pressed.
final
drawer Widget?
See Scaffold.drawer.
final
drawerDragStartBehavior DragStartBehavior
See Scaffold.drawerDragStartBehavior.
final
drawerEdgeDragWidth double?
See Scaffold.drawerEdgeDragWidth.
final
drawerEnableOpenDragGesture bool
See Scaffold.drawerEnableOpenDragGesture.
final
drawerScrimColor Color?
See Scaffold.drawerScrimColor.
final
endDrawer Widget?
See Scaffold.endDrawer.
final
endDrawerEnableOpenDragGesture bool
See Scaffold.endDrawerEnableOpenDragGesture.
final
extendBody bool
See Scaffold.extendBody.
final
extendBodyBehindAppBar bool
See Scaffold.extendBodyBehindAppBar.
final
floatingActionButton Widget?
See Scaffold.floatingActionButton.
final
floatingActionButtonAnimator FloatingActionButtonAnimator?
See Scaffold.floatingActionButtonAnimator.
final
floatingActionButtonLocation FloatingActionButtonLocation?
See Scaffold.floatingActionButtonLocation.
final
frontLayer Widget
The widget that is shown on the front layer.
final
frontLayerActiveFactor double
Fraction of available height the frontLayer will occupy when active (back layer concealed).
final
frontLayerBackgroundColor Color?
Background Color for the front layer.
final
frontLayerBorderRadius BorderRadius?
Defines the BorderRadius applied to the front layer.
final
frontLayerElevation double
Defines the elevation applied to the front layer.
final
frontLayerScrim Color
Scrim over frontLayer when minimized (back layer revealed) and animating.
final
frontLayerShape ShapeBorder
Defines the ShapeBorder applied to the front layer.
final
hashCode int
The hash code for this object.
no setterinherited
headerHeight double?
Defines the front layer's height when minimized (back layer revealed).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maintainBackLayerState bool
Specifies whether the state of the backLayer should be maintained.
final
onBackLayerConcealed VoidCallback?
Will be called when backLayer has been concealed.
final
onBackLayerRevealed VoidCallback?
Will be called when backLayer has been revealed.
final
onDrawerChanged DrawerCallback?
See Scaffold.onDrawerChanged.
final
onEndDrawerChanged DrawerCallback?
See Scaffold.onEndDrawerChanged.
final
persistentFooterButtons List<Widget>?
See Scaffold.persistentFooterButtons.
final
primary bool
See Scaffold.primary.
final
resizeToAvoidBottomInset bool?
See Scaffold.resizeToAvoidBottomInset.
final
restorationId String?
See Scaffold.restorationId.
final
revealBackLayerAtStart bool
Indicates whether the back layer should be revealed at the beginning.
final
reverseAnimationCurve Curve?
The reverse animation curve used for the backdrop animation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaffoldKey GlobalKey<ScaffoldState>?
A key to use when building the Scaffold.
final
stickyFrontLayer bool
Indicates the front layer should minimize to the back layer's bottom edge.
final
subHeader Widget?
The widget shown at the top of the front layer.
final
subHeaderAlwaysActive bool
Keeps subHeader active when minimized (back layer revealed).
final

Methods

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