diff --git a/CHANGELOG.md b/CHANGELOG.md index 74d07e6..c2e23c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.5 + +* Added backdrop field to set custom background + ## 1.3.4 * Hot reload + state update support added. diff --git a/README.md b/README.md index 1fe2ce5..71701e9 100644 --- a/README.md +++ b/README.md @@ -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| diff --git a/example/lib/main.dart b/example/lib/main.dart index c2aedd6..6d1cb0a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -25,7 +25,17 @@ class _HomeScreenState extends State { @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), diff --git a/example/pubspec.lock b/example/pubspec.lock index 7218dec..c48545d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -28,7 +28,7 @@ packages: path: ".." relative: true source: path - version: "1.3.4" + version: "1.3.5" js: dependency: transitive description: diff --git a/lib/src/widget.dart b/lib/src/widget.dart index f27c992..f1fda6a 100644 --- a/lib/src/widget.dart +++ b/lib/src/widget.dart @@ -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), @@ -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; @@ -111,6 +115,7 @@ class _AdvancedDrawerState extends State color: Colors.transparent, child: Stack( children: [ + if (widget.backdrop != null) widget.backdrop!, Align( alignment: widget.rtlOpening ? Alignment.centerRight diff --git a/pubspec.yaml b/pubspec.yaml index 36e41d2..9381f90 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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