Skip to content

Commit 3a2c1f9

Browse files
authored
Merge pull request #30 from alex-melnyk/scaleFactor
Open scale factor added.
2 parents 1cdb59b + 7c4f663 commit 3a2c1f9

File tree

8 files changed

+35
-7
lines changed

8 files changed

+35
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.1
2+
3+
* The openScale parameter added to manage child scale.
4+
15
## 1.3.0
26

37
* Animation controller could be passed via props.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ An advanced drawer widget, that can be fully customized with size, text, color,
1414
|`controller`|Widget controller|*AdvancedDrawerController*| |
1515
|`backdropColor`|Backdrop color|*Color*| |
1616
|`openRatio`|Opening ratio|*double*|0.75|
17+
|`openScale`|Opening child scale factor|*double*|0.85|
1718
|`animationDuration`|Animation duration|*Duration*|300ms|
1819
|`animationCurve`|Animation curve|*Curve*|Curves.easeInOut|
1920
|`childDecoration`|Child container decoration|*BoxDecoration*|Shadow, BorderRadius|

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:flutter_lints/flutter.yaml

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class _HomeScreenState extends State<HomeScreen> {
3131
animationDuration: const Duration(milliseconds: 300),
3232
animateChildDecoration: true,
3333
rtlOpening: false,
34+
// openScale: 1.0,
3435
disabledGestures: false,
3536
childDecoration: const BoxDecoration(
3637
// NOTICE: Uncomment if you want to add shadow behind the page.

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ packages:
2626
path: ".."
2727
relative: true
2828
source: path
29-
version: "1.2.4"
29+
version: "1.3.1"
3030
meta:
3131
dependency: transitive
3232
description:

lib/src/widget.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class AdvancedDrawer extends StatefulWidget {
99
this.controller,
1010
this.backdropColor,
1111
this.openRatio = 0.75,
12+
this.openScale = 0.85,
1213
this.animationDuration = const Duration(milliseconds: 250),
1314
this.animationCurve,
1415
this.childDecoration,
@@ -33,6 +34,9 @@ class AdvancedDrawer extends StatefulWidget {
3334
/// Opening ratio.
3435
final double openRatio;
3536

37+
/// Opening ratio.
38+
final double openScale;
39+
3640
/// Animation duration.
3741
final Duration animationDuration;
3842

@@ -87,12 +91,12 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
8791

8892
_animationController.duration = widget.animationDuration;
8993

90-
final parentAnimation = widget.animationCurve != null
91-
? CurvedAnimation(
94+
final parentAnimation = widget.animationCurve == null
95+
? _animationController
96+
: CurvedAnimation(
9297
curve: widget.animationCurve!,
9398
parent: _animationController,
94-
)
95-
: _animationController;
99+
);
96100

97101
_drawerScaleAnimation = Tween<double>(
98102
begin: 0.75,
@@ -106,7 +110,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
106110

107111
_childScaleAnimation = Tween<double>(
108112
begin: 1.0,
109-
end: 0.85,
113+
end: widget.openScale,
110114
).animate(parentAnimation);
111115

112116
_childDecorationAnimation = DecorationTween(

pubspec.lock

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ packages:
2020
description: flutter
2121
source: sdk
2222
version: "0.0.0"
23+
flutter_lints:
24+
dependency: "direct dev"
25+
description:
26+
name: flutter_lints
27+
url: "https://pub.dartlang.org"
28+
source: hosted
29+
version: "1.0.4"
30+
lints:
31+
dependency: transitive
32+
description:
33+
name: lints
34+
url: "https://pub.dartlang.org"
35+
source: hosted
36+
version: "1.0.1"
2337
meta:
2438
dependency: transitive
2539
description:

pubspec.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_advanced_drawer
22
description: An advanced drawer widget, that can be fully customized with size, text, color, radius of corners.
3-
version: 1.3.0
3+
version: 1.3.1
44
homepage: https://github.com/alex-melnyk/flutter_advanced_drawer
55
repository: https://github.com/alex-melnyk/flutter_advanced_drawer
66
issue_tracker: https://github.com/alex-melnyk/flutter_advanced_drawer/issues
@@ -13,4 +13,7 @@ dependencies:
1313
flutter:
1414
sdk: flutter
1515

16+
dev_dependencies:
17+
flutter_lints: 1.0.4
18+
1619
flutter:

0 commit comments

Comments
 (0)