flutter_advanced_drawer
flutter_advanced_drawer copied to clipboard
Few improvements for the AdvancedDrawer and AdvancedDrawerController
Hello, here are a few improvements I've thought about for this great package.
Improvements
Add the following properties to the AdvancedDrawer
- Allow customisation of the drag start position by adding an optional
dragStartPositionOffset
parameter- Fixes the issue of the drawer just randomly appearing on screen via a horizontal drag on any part of the screen, even the furthest drag opposite from the provided direction. With this parameter the horizontal drag only starts if the drag start offset (got from dragDetails) is less than or equal to the provided
dragStartPositionOffset
. - You can also make it an enum or a percentage out of 100 like 25%, 50%, 75%, 100% (which is the behaviour we have now) and 0% (which'll mean it's disabled)
- Ex. If 25% is picked, this would mean 25% of the screen from the drag direction would be where the drag has to start to open up the drawer
- Fixes the issue of the drawer just randomly appearing on screen via a horizontal drag on any part of the screen, even the furthest drag opposite from the provided direction. With this parameter the horizontal drag only starts if the drag start offset (got from dragDetails) is less than or equal to the provided
Add the following methods to the AdvancedDrawerController:
-
isDrawerOpen
method- No parameters
- returns a boolean
-
setGestures
method-
enabled:
parameter - returns void
-
Expose many more values to the controller. Thanks