From 0906ef022fd67121342404f7afaad14b502d3b4e Mon Sep 17 00:00:00 2001 From: Zak Barbuto Date: Fri, 17 Jan 2025 14:18:27 +1030 Subject: [PATCH] Support custom initial drawer scale Allows customizing how much the drawer segment scales. More importantly, enables disabling this scale effect completely if desired to have more simple push drawer. Relates to #52 --- lib/src/widget.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/widget.dart b/lib/src/widget.dart index fe24e3a..85c9392 100644 --- a/lib/src/widget.dart +++ b/lib/src/widget.dart @@ -11,6 +11,7 @@ class AdvancedDrawer extends StatefulWidget { this.backdrop, this.openRatio = 0.75, this.openScale = 0.85, + this.initialDrawerScale = 0.75, this.animationDuration = const Duration(milliseconds: 250), this.animationCurve, this.childDecoration, @@ -41,6 +42,10 @@ class AdvancedDrawer extends StatefulWidget { /// Opening ratio. final double openScale; + /// How large the drawer segment should scale from. + /// Set to 1 to disable drawer segment scale effect. + final double initialDrawerScale; + /// Animation duration. final Duration animationDuration; @@ -228,7 +233,7 @@ class _AdvancedDrawerState extends State ); _drawerScaleAnimation = Tween( - begin: 0.75, + begin: widget.initialDrawerScale, end: 1.0, ).animate(parentAnimation);