Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird animation issue when using swipe to dismiss #428

Closed
Jakemangan opened this issue Oct 4, 2024 · 2 comments
Closed

Weird animation issue when using swipe to dismiss #428

Jakemangan opened this issue Oct 4, 2024 · 2 comments

Comments

@Jakemangan
Copy link

I'm experiencing a strange animation issue when I use swipe to dismiss with the modal sheet.

I've attached a video, but it looks like something is expanding based on how much the modal sheet has been pulled down.

I'm pretty certain it's not anything to do with my code, unless I've used some strange settings in the showMaterialModalBottomSheet function. I think this because even when I remove all of the widgets from inside the modal and just use a single text widget it still happens. See the second video for evidence.

I am using the function as follows

This doesn't happen on Android, only iOS.

I'm using iOS 17.3.1 for my testing.

await showMaterialModalBottomSheet(
          enableDrag: true,
          context: context,
          duration: Duration(milliseconds: 500),
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16)),
          ),
          backgroundColor: WorkoutTheme.darkestBackgroundColor,
          builder: (context) => ViewWorkout(workoutId: workoutId));
RPReplay_Final1728078279.1.mov
RPReplay_Final1728078705.mp4
@Jakemangan
Copy link
Author

Jakemangan commented Oct 4, 2024

After some further investigation it looks like it's the ListView animation that happens when the modal is dragged down with no more vertical scroll space. Is there anyway to disable this but still have the swipe to dismiss behaviour so that the swipe to dismiss animation looks more clean?

@Jakemangan
Copy link
Author

Found the solution, or a solution at least.

The problem is with the ListView, not the modal package.

By settings physics: ClamingScrollPhysics on the ListView, the behaviour ceases.

See here - https://stackoverflow.com/questions/53153219/how-can-i-disable-the-animation-when-you-scroll-all-the-way-to-the-top-in-listvi

Will close this now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant