- Drawer Toggle issue fixed

master
NikhilVadoliya 5 years ago
parent 4bcd05cf5f
commit 7214957200

@ -1 +1,25 @@
TODO: Add your license here.
BSD 2-Clause License
Copyright (c) [2020], [Nikhil Vadoliya]
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -1,6 +1,7 @@
# Flutter slider drawer
[![pub package](https://img.shields.io/pub/v/flutter_slider_drawer)](https://pub.dev/packages/flutter_slider_drawer)
[![pub package](https://img.shields.io/pub/v/flutter_slider_drawer)](https://pub.dev/packages/flutter_slider_drawer) [![pub package](https://img.shields.io/github/languages/code-size/NikhilVadoliya/Flutter_slider_drawer)](https://pub.dev/packages/flutter_slider_drawer)
A Flutter package with custom implementation of the Sider Drawer Menu
@ -83,3 +84,9 @@ GlobalKey<SliderMenuContainerState> _key =
```
License
----
BSD 2-Clause License

@ -56,17 +56,17 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
double db = 0;
bool get isDrawerOpen => _isSlideBarOpen;
Animation<double> _translationValues;
void toggle() {
setState(() {
_isSlideBarOpen
? _animationController.forward()
: _animationController.reverse();
? _animationController.reverse()
: _animationController.forward();
_slideBarXOffset = _isSlideBarOpen
? widget.sliderMenuOpenOffset
: widget.sliderMenuCloseOffset;
// _slideBarYOffset = _isSlideBarOpen ? widget.sliderMainOffset : 0;
? widget.sliderMenuCloseOffset
: widget.sliderMenuOpenOffset;
_slideBarYOffset = 0;
_isSlideBarOpen = !_isSlideBarOpen;
});
}
@ -74,7 +74,7 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
setState(() {
_animationController.forward();
_slideBarXOffset = widget.sliderMenuOpenOffset;
// _slideBarYOffset = widget.sliderMainOffset;
_isSlideBarOpen=true;
});
}
@ -83,6 +83,8 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
_animationController.reverse();
_slideBarXOffset = widget.sliderMenuCloseOffset;
_slideBarYOffset = 0;
_isSlideBarOpen=false;
});
}
@ -131,7 +133,6 @@ class SliderMenuContainerState extends State<SliderMenuContainer>
size: widget.drawerIconSize,
progress: _animationController),
onPressed: () {
_isSlideBarOpen = !_isSlideBarOpen;
toggle();
}),
Expanded(

@ -1,6 +1,7 @@
name: flutter_slider_drawer
description: A Flutter package with custom implementation of the Sider Drawer Menu
version: 1.0.1
author: Nikhil Vadoliya <vadoliya.nikhil99@gmail.com>
homepage: https://github.com/NikhilVadoliya/Flutter_slider_drawer
environment:

Loading…
Cancel
Save