diff --git a/lib/backdrop.dart b/lib/backdrop.dart index 07ea217..9dc9a89 100644 --- a/lib/backdrop.dart +++ b/lib/backdrop.dart @@ -138,6 +138,26 @@ class BackdropScaffold extends StatefulWidget { /// Defaults to `true`. final bool resizeToAvoidBottomInset; + /// Background [Color] for the back layer. + /// + /// Defaults to `Theme.of(context).primaryColor`. + final Color backLayerBackgroundColor; + + /// [FloatingActionButton] for the [Scaffold] + /// + /// Defaults to `null` which leads the [Scaffold] without a [FloatingActionButton] + final Widget floatingActionButton; + + /// [FloatingActionButtonLocation] for the [FloatingActionButton] in the [Scaffold] + /// + /// Defaults to `null` which leads Scaffold to use the default [FloatingActionButtonLocation] + final FloatingActionButtonLocation floatingActionButtonLocation; + + /// [FloatingActionButtonAnimator] for the [FloatingActionButton] in the [Scaffold] + /// + /// Defaults to `null` which leads Scaffold to use the default [FloatingActionButtonAnimator] + final FloatingActionButtonAnimator floatingActionButtonAnimator; + /// Defines the color for the inactive front layer. /// Implicitly an opacity of 0.7 is applied to the passed color. /// @@ -168,7 +188,11 @@ class BackdropScaffold extends StatefulWidget { this.stickyFrontLayer = false, this.animationCurve = Curves.easeInOut, this.resizeToAvoidBottomInset = true, + this.backLayerBackgroundColor, + this.floatingActionButton, this.inactiveOverlayColor = const Color(0xFFEEEEEE), + this.floatingActionButtonLocation, + this.floatingActionButtonAnimator }); @override @@ -291,7 +315,8 @@ class _BackdropScaffoldState extends State return FocusScope( canRequestFocus: isBackPanelVisible, child: Material( - color: Theme.of(context).primaryColor, + color: this.widget.backLayerBackgroundColor ?? + Theme.of(context).primaryColor, child: Column( children: [ Flexible( @@ -331,6 +356,8 @@ class _BackdropScaffoldState extends State onWillPop: () => _willPopCallback(context), child: Scaffold( key: scaffoldKey, + floatingActionButtonLocation: this.widget.floatingActionButtonLocation, + floatingActionButtonAnimator: this.widget.floatingActionButtonAnimator, appBar: widget.appBar ?? AppBar( title: widget.title, @@ -357,6 +384,7 @@ class _BackdropScaffoldState extends State ); }, ), + floatingActionButton: this.widget.floatingActionButton, resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset, ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 53c9aa9..02b7997 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,6 +9,7 @@ authors: - Harsh Bhikadia - Felix Wielander - Daniel Borges + - Felix Wortmann environment: sdk: ">=1.19.0 <3.0.0"