Tkko / Flutter_dismissible_page

Flutter page widget that is dismissed by swipe gestures, with Hero style animations, Inspired by Facebook and Instagram stories.
https://pub.dev/packages/dismissible_page
MIT License
151 stars 39 forks source link

Support both vertical and horizontal gestures at the same time #2

Closed aytunch closed 2 years ago

aytunch commented 3 years ago

Instagram Stories allow you to move the page along both directions. Can we have the same too? Thanks

Tkko commented 2 years ago

Added DismissiblePageDismissDirection.multi in version 0.7.0

Example

    return DismissiblePage(
      onDismissed: () {
        Navigator.of(context).pop();
      },
      // Note that scrollable widget inside DismissiblePage might limit the functionality
      // If scroll direction matches DismissiblePage direction
      direction: DismissiblePageDismissDirection.multi,
      isFullScreen: false,
      child: Hero(
        tag: 'Unique tag',
        child: Image.network(
          imageUrl,
          fit: BoxFit.cover,
        ),
      ),
    );
aytunch commented 2 years ago

Thank you very much.

Note that scrollable widget inside DismissiblePage might limit the functionality. If scroll direction matches DismissiblePage direction

What Instagram does is, if the scrolling widgets scroll position is not on the start position, swipe gestures keeps on scrolling the inner scroll. If the scroll position is on start, then the page dismiss happens. I want to try to achieve this, I know it is not the responsibility of this package but it is a common use-case. Do you have any suggestions on how this could be done @Tkko ? Btw I hope all you people are safe and this nonsense ends soon.

Tkko commented 2 years ago

Thank you very much.

Note that scrollable widget inside DismissiblePage might limit the functionality.

If scroll direction matches DismissiblePage direction

What Instagram does is, if the scrolling widgets scroll position is not on the start position, swipe gestures keeps on scrolling the inner scroll.

If the scroll position is on start, then the page dismiss happens.

I want to try to achieve this, I know it is not the responsibility of this package but it is a common use-case.

Do you have any suggestions on how this could be done @Tkko ?

Btw I hope all you people are safe and this nonsense ends soon.

I'd love to implement that functionality as well, Airbnb app does it perfectly. If you manage to replicate it please let me know.

DraggableDismissibleSheet is doing kinda similar thing for reference.

Thank you for asking, I'm safe for now, well, until Putin decides to occupy Georgia (my country) again 😡

aytunch commented 2 years ago

Do you mean DraggableScrollableSheet? I could not find any info on DraggableDismissibleSheet?

Tkko commented 2 years ago

Do you mean DraggableScrollableSheet?

I could not find any info on DraggableDismissibleSheet?

Ahh Yes, it's DraggableScrollableSheet.