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

Feature Request : Stacked expandable notifications #88

Open
HosamHasanRamadan opened this issue Jan 30, 2024 · 8 comments · May be fixed by #170
Open

Feature Request : Stacked expandable notifications #88

HosamHasanRamadan opened this issue Jan 30, 2024 · 8 comments · May be fixed by #170
Labels
enhancement New feature or request

Comments

@HosamHasanRamadan
Copy link

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Stacked expandable notifications

Describe alternatives you've considered

Additional context

SolarFlow.mp4

@HosamHasanRamadan HosamHasanRamadan added the enhancement New feature or request label Jan 30, 2024
@payam-zahedi
Copy link
Owner

Thanks @HosamHasanRamadan for opening this issue.
For sure, this is a great Idea.

Let's see how we can achieve it in the future

@sagnik-sanyal
Copy link

Yeah it is a great feature request, would love to have it in near future. I guess we can now think about the implementations and ways on how to achieve this

@deepraj02
Copy link

Hey, this seems to be a good issue to work on, is someone currently working on it?
I'd like to give it a shot

@payam-zahedi
Copy link
Owner

Hey @deepraj02
I appreciate it

It's yours now

@AntonioAEMartins
Copy link
Collaborator

@deepraj02, I wanted to follow up and ask if you've made any progress on this.

@AntonioAEMartins
Copy link
Collaborator

AntonioAEMartins commented Nov 26, 2024

@payam-zahedi and @HosamHasanRamadan,
I hope this message finds you both well.

Over the past few days, I've been working on the Stacked Expandable concept. Attached to this comment is a video showing my progress:

Screen.Recording.2024-11-26.at.18.45.29.mov

Main Idea Behind the Implementation

Below is the core implementation concept:

OverlayEntry _createOverlayEntry() {
   ValueNotifier<bool> _isHovering = ValueNotifier<bool>(false);
   
   return OverlayEntry(
      opaque: false,
      builder: (context) {
         return Align(
            alignment: alignment,
            child: MouseRegion(...),
         );
      },
   );
}

I'm using the following elements to position the Toasts and achieve the expected animations and behavior:

  • Stack
  • AnimatedPositioned
  • AnimatedOpacity
  • TweenAnimationBuilder

Current Issues

While the implementation is progressing, I’m encountering some problems:

  1. Overlay occupies entire vertical space: When I hover over areas that don’t contain the Toast but are positioned below it, the Toasts expand unexpectedly.
  2. No exit animation: The Toast currently lacks an exit animation.
  3. Hover behavior: When hovering over the Toasts, only the hovered Toast has its expiration time frozen, while the others continue to expire.
  4. Dynamic updates: To ensure the Stack updates correctly when new items are added, I had to add a ValueNotifier<List<ToastificationItem>> to the _notifications list.

@payam-zahedi
Copy link
Owner

Wow really nice

Will you make a PR for that?

@AntonioAEMartins AntonioAEMartins linked a pull request Nov 29, 2024 that will close this issue
@AntonioAEMartins
Copy link
Collaborator

AntonioAEMartins commented Nov 29, 2024

@payam-zahedi I've improved the code quality, but some of the issues are still present:

Current Issues

  1. Overlay occupies entire vertical space: When I hover over areas that don’t contain the Toast but are positioned below it, the Toasts expand unexpectedly.
  2. No exit animation: The Toast currently lacks an exit animation.
  3. Dynamic updates: To ensure the Stack updates correctly when new items are added, I had to add a ValueNotifier<List> to the _notifications list.

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

Successfully merging a pull request may close this issue.

5 participants