payam-zahedi / toastification

Toastification is a Flutter package for displaying customizable toast messages. It provides predefined widgets for success, error, warning, and info messages, as well as a custom widget for flexibility. With Toastification, you can add and manage multiple toast messages at the same time with ease.
https://payamzahedi.com/toastification/
BSD 3-Clause "New" or "Revised" License
587 stars 45 forks source link

Problems encountered in using toastification #109

Open laterdayi opened 5 months ago

laterdayi commented 5 months ago

I have been using bot_toast before and I want to switch to toastification, but I encountered some problems, I hope the author can solve them

  1. The animation is slow, it seems that the transition animation is very slow,I don't know if it's a performance issue or an animation transition issue
  2. I will close all toast before displaying, but the animation position will be wrong
  3. Blank display when clicked quickly
  4. Supports the configuration style, width, height....

How should these problems be solved

@payam-zahedi

laterdayi commented 5 months ago

bot_toast

Code_7HFzmaqaDQ

toastification

mobile_MzhoQ0LrOh

laterdayi commented 5 months ago
  void handle() {
    toastification.dismissAll();
    toastification.show(
      type: ToastificationType.error,
      style: ToastificationStyle.flatColored,
      title: const Text('Fail),
      alignment: Alignment.bottomCenter,
      showProgressBar: false,
      autoCloseDuration: const Duration(seconds: 4),
      animationBuilder: (
        context,
        c,
        alignment,
        child,
      ) {
        return Transform.translate(
          offset: Tween<Offset>(
            begin: const Offset(0, 40),
            end: const Offset(0, 0),
          ).evaluate(c),
          child: Transform.scale(
            scale: Tween<double>(begin: 0.7, end: 1.0).evaluate(c),
            child: Opacity(
              opacity: c.value,
              child: child,
            ),
          ),
        );
      },
    );
  }
laterdayi commented 5 months ago

I'm expecting the animations to be consistent when I switch to toastification

payam-zahedi commented 5 months ago

Thanks @laterdayi for this issue

Have you tried this?

dissmissAll method has an argument that you can set.


toastification.dismissAll(delayForAnimation: false);
payam-zahedi commented 5 months ago

I have to double check this issue

laterdayi commented 5 months ago

I set the parameters, but these problems still exist @payam-zahedi

toastification.dismissAll(delayForAnimation: false);
    toastification.show(
      type: ToastificationType.error,
      style: ToastificationStyle.flatColored,
      title: const Text('Fail'),
      alignment: Alignment.bottomCenter,
      showProgressBar: false,
      autoCloseDuration: const Duration(seconds: 4),
      animationBuilder: (
        context,
        animation,
        alignment,
        child,
      ) {
        return Transform.translate(
          offset: Tween<Offset>(
            begin: const Offset(0, 40),
            end: const Offset(0, 0),
          ).evaluate(animation),
          child: Transform.scale(
            scale: Tween<double>(begin: 0.7, end: 1.0).evaluate(animation),
            child: Opacity(
              opacity: animation.value,
              child: child,
            ),
          ),
        );
      },
    );
laterdayi commented 5 months ago

https://github.com/payam-zahedi/toastification/assets/122137647/9b39e5c3-ed5c-40df-825a-afa8aaaf67d3

I re-summarized the problem

  1. In the first second of the video, I double-clicked twice. Although I had set dismissAll(delayForAnimation: false), it still toasted twice.
  2. 3-5 seconds into the video, I keep clicking but the toast animation is out of position
  3. In the 6-8 seconds of the video, quick click does not close the animation, does not show the animation, and displays blank
  4. Present on first click, The animation is slow, it seems that the transition animation is very slow, I don't know if it's a performance issue or an
laterdayi commented 5 months ago

https://github.com/payam-zahedi/toastification/assets/122137647/740c5a4d-8b54-49cd-a392-f75e511daeb1

This is about the first time the pop-up is slow, the first time is always slow, after the click is normal speed

laterdayi commented 5 months ago

Is there a plan to fix it? @payam-zahedi

payam-zahedi commented 5 months ago

Hey @laterdayi Basicly this is not a bug,

It's a new feature that we have to add to the package

This is a feature that helps user to only show one toast in screen.

payam-zahedi commented 5 months ago

For now, I'm not sure most of the users need this.

So let's give it more time

laterdayi commented 5 months ago

This should be a series of side effects brought about by manually closing all, resulting in the inability to manually close all

payam-zahedi commented 5 months ago

Let me try it in this weekend to see how we can deal with it

laterdayi commented 5 months ago

Thanks for your help, looking forward to it

Pluto1219 commented 4 months ago

Let me try it in this weekend to see how we can deal with it

I feel that the author has provided such a good plug-in. At present, I feel that the toastification.show pop-up does have a delay of about 300 milliseconds. I hope the author can help us check it. Thank you very much.

maxfrees commented 3 months ago

any update @payam-zahedi