Dn-a / flutter_inner_drawer

Inner Drawer is an easy way to create an internal side section (left/right) where you can insert a list-menu or other.
https://pub.dartlang.org/packages/flutter_inner_drawer
MIT License
514 stars 129 forks source link

Fix animation behavior with negative horizontal offset to support narrower drawer. #76

Open TheMeanCanEHdian opened 3 years ago

TheMeanCanEHdian commented 3 years ago

Currently, flutter_inner_drawer supports using a negative horizontal offset. However, doing so breaks the animation when revealing and hiding the drawer, forcing you to use a minimum horizontal offset of 0.

This change fixes that, allowing drawers that are narrower than half the screen width to be configured. Supporting this is particularly useful for devices in landscape mode like tablets.

The changes to the drift (difference in movement compared to gesture) is almost negligible and is comparable to the drift that already exists.

The value of 2.05 was used when manually tuning as it offered the most similar experience for both positive and negative offsets.