Skip to content

Commit

Permalink
Merge pull request #64 from kannel-outis/master
Browse files Browse the repository at this point in the history
added scaffoldKey
  • Loading branch information
WieFel authored Oct 4, 2020
2 parents 577e3b2 + 3508abb commit 834884d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ class BackdropScaffold extends StatefulWidget {
final VoidCallback onBackLayerRevealed;

// ------------- PROPERTIES TAKEN OVER FROM SCAFFOLD ------------- //

/// A key to use when building the [Scaffold].
final GlobalKey<ScaffoldState> scaffoldKey;

/// See [Scaffold.appBar].
final PreferredSizeWidget appBar;
Expand Down Expand Up @@ -267,6 +270,7 @@ class BackdropScaffold extends StatefulWidget {
this.inactiveOverlayOpacity = 0.7,
this.onBackLayerConcealed,
this.onBackLayerRevealed,
this.scaffoldKey,
this.appBar,
this.floatingActionButton,
this.floatingActionButtonLocation,
Expand Down Expand Up @@ -308,7 +312,7 @@ class BackdropScaffoldState extends State<BackdropScaffold>

/// Key for accessing the [ScaffoldState] of [BackdropScaffold]'s internally
/// used [Scaffold].
final scaffoldKey = GlobalKey<ScaffoldState>();
GlobalKey<ScaffoldState> scaffoldKey;
double _backPanelHeight = 0;
double _subHeaderHeight = 0;

Expand All @@ -324,6 +328,9 @@ class BackdropScaffoldState extends State<BackdropScaffold>
@override
void initState() {
super.initState();
// initialize scaffoldKey
scaffoldKey = widget.scaffoldKey ?? GlobalKey<ScaffoldState>();
// initialize _controller
_controller = widget.controller ??
AnimationController(
vsync: this, duration: Duration(milliseconds: 200), value: 1.0);
Expand Down

0 comments on commit 834884d

Please sign in to comment.