Skip to content

Commit d73c8ac

Browse files
authored
Merge pull request #42 from Frezyx/master
2 parents 61c4a1b + ec6b0ab commit d73c8ac

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
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.5
2+
3+
* Added backdrop field to set custom background
4+
15
## 1.3.4
26

37
* Hot reload + state update support added.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ An advanced drawer widget, that can be fully customized with size, text, color,
1313
|`drawer`|Drawer widget|*Widget*|required|
1414
|`controller`|Widget controller|*AdvancedDrawerController*| |
1515
|`backdropColor`|Backdrop color|*Color*| |
16+
|`backdrop`|Backdrop widget for custom background|*Widget*| |
1617
|`openRatio`|Opening ratio|*double*|0.75|
1718
|`openScale`|Opening child scale factor|*double*|0.85|
1819
|`animationDuration`|Animation duration|*Duration*|300ms|

example/lib/main.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ class _HomeScreenState extends State<HomeScreen> {
2525
@override
2626
Widget build(BuildContext context) {
2727
return AdvancedDrawer(
28-
backdropColor: Colors.blueGrey,
28+
backdrop: Container(
29+
width: double.infinity,
30+
height: double.infinity,
31+
decoration: BoxDecoration(
32+
gradient: LinearGradient(
33+
begin: Alignment.topLeft,
34+
end: Alignment.bottomRight,
35+
colors: [Colors.blueGrey, Colors.blueGrey.withOpacity(0.2)],
36+
),
37+
),
38+
),
2939
controller: _advancedDrawerController,
3040
animationCurve: Curves.easeInOut,
3141
animationDuration: const Duration(milliseconds: 300),

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
path: ".."
2929
relative: true
3030
source: path
31-
version: "1.3.4"
31+
version: "1.3.5"
3232
js:
3333
dependency: transitive
3434
description:

lib/src/widget.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class AdvancedDrawer extends StatefulWidget {
88
required this.drawer,
99
this.controller,
1010
this.backdropColor,
11+
this.backdrop,
1112
this.openRatio = 0.75,
1213
this.openScale = 0.85,
1314
this.animationDuration = const Duration(milliseconds: 250),
@@ -31,6 +32,9 @@ class AdvancedDrawer extends StatefulWidget {
3132
/// Backdrop color.
3233
final Color? backdropColor;
3334

35+
/// Backdrop widget for custom background.
36+
final Widget? backdrop;
37+
3438
/// Opening ratio.
3539
final double openRatio;
3640

@@ -111,6 +115,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
111115
color: Colors.transparent,
112116
child: Stack(
113117
children: [
118+
if (widget.backdrop != null) widget.backdrop!,
114119
Align(
115120
alignment: widget.rtlOpening
116121
? Alignment.centerRight

pubspec.yaml

Lines changed: 1 addition & 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.4
3+
version: 1.3.5
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

0 commit comments

Comments
 (0)