Skip to content

Commit 19ca026

Browse files
authored
Merge pull request #58 from NextFaze/master
Support custom initial drawer scale
2 parents 65222e1 + bbfc692 commit 19ca026

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

@@ -229,7 +234,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
229234
);
230235

231236
_drawerScaleAnimation = Tween<double>(
232-
begin: 0.75,
237+
begin: widget.initialDrawerScale,
233238
end: 1.0,
234239
).animate(parentAnimation);
235240

0 commit comments

Comments
 (0)