Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added reverseAnimationCurve property to BackdropScaffold #74

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions lib/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ class BackdropScaffold extends StatefulWidget {
/// Defaults to `false`.
final bool stickyFrontLayer;

/// The animation curve passed to [Tween.animate]() when triggering
/// The animation curve passed to [Tween.animate] when triggering
/// the backdrop animation.
///
/// Defaults to [Curves.easeInOut].
/// Defaults to [Curves.ease].
final Curve animationCurve;

/// The reverse animation curve passed to [Tween.animate].
///
/// If not set, [animationCurve.flipped] is used.
final Curve reverseAnimationCurve;

/// Background [Color] for the back layer.
///
/// Defaults to `Theme.of(context).primaryColor`.
Expand Down Expand Up @@ -269,7 +274,8 @@ class BackdropScaffold extends StatefulWidget {
"This feature was deprecated after v0.2.17.")
this.iconPosition = BackdropIconPosition.leading,
this.stickyFrontLayer = false,
this.animationCurve = Curves.easeInOut,
this.animationCurve = Curves.ease,
this.reverseAnimationCurve,
this.frontLayerBackgroundColor,
this.backLayerBackgroundColor,
this.inactiveOverlayColor = const Color(0xFFEEEEEE),
Expand Down Expand Up @@ -457,9 +463,10 @@ class BackdropScaffoldState extends State<BackdropScaffold>
begin: RelativeRect.fromLTRB(0.0, backPanelHeight, 0.0, frontPanelHeight),
end: RelativeRect.fromLTRB(0.0, 0.0, 0.0, 0.0),
).animate(CurvedAnimation(
parent: controller,
curve: widget.animationCurve,
));
parent: controller,
curve: widget.animationCurve,
reverseCurve:
widget.reverseAnimationCurve ?? widget.animationCurve.flipped));
}

Widget _buildInactiveLayer(BuildContext context) {
Expand Down