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

feat: Add Attached Sheet to Playground #265

Merged
merged 11 commits into from
Jul 22, 2024
Merged

Conversation

ABausG
Copy link
Contributor

@ABausG ABausG commented Jul 17, 2024

Description

Adding an AttachedFloatingBottomSheetType to the Playground App.
This works by using a GlobalKey as the anchor to Align the Sheet at the Position of the Anchor.

One thing I think can still be improved is the animation. Ideally it would be nice if the Modal Scales out from the anchor position (+ Transformation based on Anchor Size/Alignment)

A Demo (before improvements to the Alignments/Size Constraints can be found here:

Screen.Recording.2024-07-18.at.00.11.28.mov

Related Issues

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes tests for all changed/updated/fixed behaviors.
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • The package compiles with the minimum Flutter version stated in the pubspec.yaml

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Copy link

@ulusoyca
Copy link
Collaborator

Thank you very much for the example!

@ulusoyca
Copy link
Collaborator

@ABausG When RTL is selected, there is weird behavior. Can you check?

ltr_wms.mov

@ABausG
Copy link
Contributor Author

ABausG commented Jul 18, 2024

@ABausG When RTL is selected, there is weird behavior. Can you check?

Did not test that!! Solved by swapping the passed alignment based on the directionality. Works for me now!

@ABausG ABausG requested a review from ulusoyca July 18, 2024 17:41
@ulusoyca
Copy link
Collaborator

👑 AMAZING! Super happy <3

@ulusoyca ulusoyca enabled auto-merge July 18, 2024 17:50
@ulusoyca ulusoyca disabled auto-merge July 18, 2024 17:51
Copy link
Collaborator

@durannumit durannumit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • still there are some issues on mobile
LTR RTL
Screenshot_1721330505 Screenshot_1721330513

For me looks really good on web btw

playground/lib/home/home_screen.dart Outdated Show resolved Hide resolved
@ABausG
Copy link
Contributor Author

ABausG commented Jul 18, 2024

Did a further refactor to now auto-calculate the Alignment that results in the most available space. By my testing (resizing to super small form factors) this now solves the issue as in the screenshot from mobile

@ABausG ABausG requested a review from durannumit July 18, 2024 20:14
@durannumit
Copy link
Collaborator

Did a further refactor to now auto-calculate the Alignment that results in the most available space. By my testing (resizing to super small form factors) this now solves the issue as in the screenshot from mobile

I tried on latest version, it looks same. Let me test on more devices also

@ABausG
Copy link
Contributor Author

ABausG commented Jul 20, 2024

@durannumit I did some more adjustments to the maxWidth calculation but for me it also works fine on iOS and Android Simulator 🤔

@durannumit
Copy link
Collaborator

@durannumit I did some more adjustments to the maxWidth calculation but for me it also works fine on iOS and Android Simulator 🤔

it works well now! Thanks for quick adjustment, LGTM 🚀

@ulusoyca ulusoyca merged commit 4cca7de into woltapp:main Jul 22, 2024
2 of 3 checks passed
@ABausG ABausG deleted the attached-sheet branch July 22, 2024 07:48
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

Successfully merging this pull request may close these issues.

3 participants