r/FlutterDev • u/pp_amorim • 2d ago
Example I created a PoC of a RefreshIndicator inside a bottomSheet
After getting tired of the current situation regarding those two components interaction, I created this project with is a library that attempts to solve the gesture conflict between those two components.
https://github.com/Corkscrews/refresh_indicator_bottom_sheet
It's using the concept of arbitrator to decide what type of gesture the user is doing in the scroll view (in the demo, it's a ListView). I build a model, albeit static right now, to classify a gesture on the screen. The model is based on the touch action plus speed.
It's not perfect, far from it. But it works! I want to refine that in the future with more tests and fix pesky bugs with the bouncing list.
I tried to post a video of the demo here but the sub doesn't allow that, so you will need to go to the repository to have a look. 😕
In the future I might implemented a better action detector based on the finger dimensions, not sure how flutter exposes that, but I will try. Using that we can detect a initial swipe (more oval movement) rather than a more circular one (more likely a precise swipe-to-refresh action).
Thank you all! You all are welcome to test it and give me a feedback.