Skip to content

Commit

Permalink
fix: extract back layer scrim
Browse files Browse the repository at this point in the history
  • Loading branch information
mockturtl committed Feb 14, 2021
1 parent 69c2377 commit d50f5be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,7 @@ class BackdropScaffoldState extends State<BackdropScaffold>
fit: StackFit.expand,
children: <Widget>[
_buildBackPanel(),
if (isBackLayerConcealed && widget.frontLayerActiveFactor < 1)
Container(
color: _backLayerScrimColorTween.evaluate(controller),
height: _backPanelHeight),
if (_hasBackLayerScrim) _buildBackLayerScrim(),
PositionedTransition(
rect: _getPanelAnimation(context, constraints),
child: _buildFrontPanel(context),
Expand Down Expand Up @@ -649,6 +646,13 @@ class BackdropScaffoldState extends State<BackdropScaffold>
);
}

Container _buildBackLayerScrim() => Container(
color: _backLayerScrimColorTween.evaluate(controller),
height: _backPanelHeight);

bool get _hasBackLayerScrim =>
isBackLayerConcealed && widget.frontLayerActiveFactor < 1;

@override
Widget build(BuildContext context) {
return Backdrop(
Expand Down

0 comments on commit d50f5be

Please sign in to comment.