Skip to content

Commit

Permalink
Fixing Drawer issue mitesh77#37
Browse files Browse the repository at this point in the history
As the issue states, the drawer was opening when it shouldn't. The problem was that sometimes there was a minute difference between scrollController.offset and widget.drawerWidth (294.54545454545456 and 294.54545454545455, in my case), and thus the correct function was not being executed. I have changed the > < if condition when adding the Listener to scrollController to compare with the floor value instead, (294, in my case). Since the change is quite less, I figure this should work fine :)
  • Loading branch information
emem365 committed May 20, 2020
1 parent 6e95683 commit fd48309
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class _DrawerUserControllerState extends State<DrawerUserController> with Ticker
});
}
iconAnimationController.animateTo(0.0, duration: const Duration(milliseconds: 0), curve: Curves.fastOutSlowIn);
} else if (scrollController.offset > 0 && scrollController.offset < widget.drawerWidth) {
} else if (scrollController.offset > 0 && scrollController.offset < widget.drawerWidth.floor()) {
iconAnimationController.animateTo((scrollController.offset * 100 / (widget.drawerWidth)) / 100,
duration: const Duration(milliseconds: 0), curve: Curves.fastOutSlowIn);
} else if (scrollController.offset <= widget.drawerWidth) {
} else {
if (scrolloffset != 0.0) {
setState(() {
scrolloffset = 0.0;
Expand Down

0 comments on commit fd48309

Please sign in to comment.