BubbleShowcase
BubbleShowcase copied to clipboard
Feat: better relative bubble positioning
Fixes Skyost/BubbleShowcase#16 This also supersedes part of the effort that #11 was doing, but I think a bit better, instead of declaring manually by how much you want the container to expand, we just let it automatically use the remainder of the parent's size in the direction that has the most space.
For this I added a new system that allows the expansion of the slide's child beyond the highlighted area, it is heavily assisted by an Align widget (or in the case of the example the SpeechBubble's NipLocation which sets an alignment). And its not possible to center the slide in the highlighted area when you are totally inside one of the quadrants of the screen, the only place where we kinda expand while keeping it centered is when we are not inside only one quadrant (also known as being in the center quadrant of the screen). I added a bunch of private helper functions inside RelativeBubbleSlide
To enable it you must set enableExtraSpace: true when declaring the RelativeBubbleSlide, this way it will be an opt-in change for previous users, and the previous system is still preserved and used by default.
Also modified the example to add showcases of the new system and how it looks.
LMK what you think @Skyost
Also, something that would be a breaking change is that previously that when you set direction: AxisDirection.right it would actually put the bubbleSlide to the left and vice-versa, I have fixed this, so it could break someone's BubbleShowcase, I would suggest moving a major version for the next release.
LMK what you think @Skyost
Seems like a great idea, thanks for this PR 👍
Great! I might finish this in the next week or two, I will tag you when I am done and open for review
Fine 👍