maheshj01 / navbar_router

A Navbar widget for advanced usecases to improve user experience and save your time.
https://docs.maheshjamdade.com/navbar_router/
MIT License
29 stars 7 forks source link

Add Swipe support between navbar pages #55

Open bebaoboy opened 4 months ago

bebaoboy commented 4 months ago
Portrait Landscape

If you need help, consider pinging the maintainer @maheshmnj

maheshj01 commented 4 months ago

@bebaoboy Whenever you are ready mark this PR as ready for review and I will take a look and feel free to ping me anytime if you woud like to discuss anything

bebaoboy commented 4 months ago

Im ready for review 😁

maheshj01 commented 4 months ago

@bebaoboy I have added my comments let me know what you think?

bebaoboy commented 4 months ago

The idea is not using page view 'cause the content behind pageview cannot be scroll horizontally. Then why not make the PageView NeverScrollable? If I do that, why should I use PageView in the first place if I cannot swipe it🤣 Besides, the PageView and ListView ScrollController are similar so drag logic will be the same.

This is the PR for the design I think of, the idea is using 2 Gesture Detector on the 2 edges on the screen to help user scroll through the pages. No horizontal scrollables will be affected.

Maybe I skimmed too fast through the client spec and missed the point, or the originally said design was too abstract for me. If you don't want to use this design then leave it and maybe make another PR.

maheshj01 commented 4 months ago

@bebaoboy Do you think you will be able to make that change to land this PR? I think its just that there will be one draggable area, I don't think its a major change in your code.

Just remove one of the Rect and handle these three methods to detect left or right swipe

onHorizontalDragStart: (details) {
    onDragStart(details);
  },
  onHorizontalDragUpdate: (details) {
    onDragUpdate(details);
  },
  onHorizontalDragEnd: (details) {
    onDragEnd(details);
  },
bebaoboy commented 4 months ago

Maybe I'll try that.

maheshj01 commented 4 months ago

Let me know if you have any further questions, I would be happy to discuss.

maheshj01 commented 3 months ago

Hi @bebaoboy, Let me know whenever this is ready for review, No rush take your time, let me know if you have any questions.

Best Mahesh

bebaoboy commented 3 months ago

I think its ready for review @maheshj01

maheshj01 commented 3 months ago

Great, I will take a look at it this weekeend.