Skip to content

Commit

Permalink
Merge pull request #58 from NextFaze/master
Browse files Browse the repository at this point in the history
Support custom initial drawer scale
  • Loading branch information
alex-melnyk authored Jan 17, 2025
2 parents 65222e1 + bbfc692 commit 19ca026
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ An advanced drawer widget, that can be fully customized with size, text, color,
|`animateChildDecoration`|Indicates that [childDecoration] might be animated or not.|*bool*|true|
|`rtlOpening`|Opening from Right-to-left.|*bool*|false|
|`disabledGestures`|Disable gestures.|*bool*|false|
|`initialDrawerScale`|How large the drawer segment should scale from.|*double*|0.75|

## Preview
| Preview Tap | Preview Gesture |
Expand Down
7 changes: 6 additions & 1 deletion lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -229,7 +234,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
);

_drawerScaleAnimation = Tween<double>(
begin: 0.75,
begin: widget.initialDrawerScale,
end: 1.0,
).animate(parentAnimation);

Expand Down

0 comments on commit 19ca026

Please sign in to comment.