Skip to content

Commit

Permalink
Merge pull request #42 from Frezyx/master
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-melnyk authored Apr 28, 2023
2 parents 61c4a1b + ec6b0ab commit d73c8ac
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.5

* Added backdrop field to set custom background

## 1.3.4

* Hot reload + state update support added.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ An advanced drawer widget, that can be fully customized with size, text, color,
|`drawer`|Drawer widget|*Widget*|required|
|`controller`|Widget controller|*AdvancedDrawerController*| |
|`backdropColor`|Backdrop color|*Color*| |
|`backdrop`|Backdrop widget for custom background|*Widget*| |
|`openRatio`|Opening ratio|*double*|0.75|
|`openScale`|Opening child scale factor|*double*|0.85|
|`animationDuration`|Animation duration|*Duration*|300ms|
Expand Down
12 changes: 11 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return AdvancedDrawer(
backdropColor: Colors.blueGrey,
backdrop: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Colors.blueGrey, Colors.blueGrey.withOpacity(0.2)],
),
),
),
controller: _advancedDrawerController,
animationCurve: Curves.easeInOut,
animationDuration: const Duration(milliseconds: 300),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.3.4"
version: "1.3.5"
js:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class AdvancedDrawer extends StatefulWidget {
required this.drawer,
this.controller,
this.backdropColor,
this.backdrop,
this.openRatio = 0.75,
this.openScale = 0.85,
this.animationDuration = const Duration(milliseconds: 250),
Expand All @@ -31,6 +32,9 @@ class AdvancedDrawer extends StatefulWidget {
/// Backdrop color.
final Color? backdropColor;

/// Backdrop widget for custom background.
final Widget? backdrop;

/// Opening ratio.
final double openRatio;

Expand Down Expand Up @@ -111,6 +115,7 @@ class _AdvancedDrawerState extends State<AdvancedDrawer>
color: Colors.transparent,
child: Stack(
children: [
if (widget.backdrop != null) widget.backdrop!,
Align(
alignment: widget.rtlOpening
? Alignment.centerRight
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_advanced_drawer
description: An advanced drawer widget, that can be fully customized with size, text, color, radius of corners.
version: 1.3.4
version: 1.3.5
homepage: https://github.com/alex-melnyk/flutter_advanced_drawer
repository: https://github.com/alex-melnyk/flutter_advanced_drawer
issue_tracker: https://github.com/alex-melnyk/flutter_advanced_drawer/issues
Expand Down

0 comments on commit d73c8ac

Please sign in to comment.