RafaelBarbosatec / hidden_drawer_menu

Hidden Drawer Menu is a library for adding a beautiful drawer mode menu feature with perspective animation.
MIT License
352 stars 55 forks source link

Integration with Maps #40

Closed damato3 closed 4 years ago

damato3 commented 4 years ago

Hi,

I'm trying to integrate a SimpleHiddenDrawer widget with a GoogleMaps in the main screen. Problem is that the GestureDetector prevents the map to be draggable, i've set the isDraggable to false but that doesn't work, the GestureDetector still gets the dragging events.

As a work around, i've altered a bit the animated_drawer_content.dart file to avoid the GestureDetector catching dragging events if the isDraggable flag is true.

Do you have another solution for this?

Thank you.

damato3 commented 4 years ago

Anyone interested on my solution check PR https://github.com/RafaelBarbosatec/hidden_drawer_menu/pull/41

RafaelBarbosatec commented 4 years ago

Thanks for contribution!

damato3 commented 4 years ago

Hi @RafaelBarbosatec,

Thanks for merging my PR, however after a research i found another way to achieve what i was trying to do without making changes to the library. We just need to set the gestureRecognizers property in the GoogleMap widget, like this:

GoogleMap(
  gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
    Factory<OneSequenceGestureRecognizer>(() => EagerGestureRecognizer())
  ].toSet(),
  ...
),

the EagerGestureRecognizer will catch Map dragger events as well as other events. Still, the PR can help with other cases where different widgets are claiming gesture events.