Skip to content

Commit bbfc692

Browse files
committed
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
1 parent 8aa024f commit bbfc692

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ An advanced drawer widget, that can be fully customized with size, text, color,
2222
|`animateChildDecoration`|Indicates that [childDecoration] might be animated or not.|*bool*|true|
2323
|`rtlOpening`|Opening from Right-to-left.|*bool*|false|
2424
|`disabledGestures`|Disable gestures.|*bool*|false|
25+
|`initialDrawerScale`|How large the drawer segment should scale from.|*double*|0.75|
2526

2627
## Preview
2728
| Preview Tap | Preview Gesture |

lib/src/widget.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class AdvancedDrawer extends StatefulWidget {
1111
this.backdrop,
1212
this.openRatio = 0.75,
1313
this.openScale = 0.85,
14+
this.initialDrawerScale = 0.75,
1415
this.animationDuration = const Duration(milliseconds: 250),
1516
this.animationCurve,
1617
this.childDecoration,
@@ -41,6 +42,10 @@ class AdvancedDrawer extends StatefulWidget {
4142
/// Opening ratio.
4243
final double openScale;
4344

45+
/// How large the drawer segment should scale from.
46+
/// Set to 1 to disable drawer segment scale effect.
47+
final double initialDrawerScale;
48+
4449
/// Animation duration.
4550
final Duration animationDuration;
4651

@@ -228,7 +233,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
228233
);
229234

230235
_drawerScaleAnimation = Tween<double>(
231-
begin: 0.75,
236+
begin: widget.initialDrawerScale,
232237
end: 1.0,
233238
).animate(parentAnimation);
234239

0 commit comments

Comments
 (0)