flushbar icon indicating copy to clipboard operation
flushbar copied to clipboard

How to close the animation?

Open SF-Simon opened this issue 4 years ago • 1 comments

I expect it to behave the same as snackBar, but I don't know how to turn off the animation.

SF-Simon avatar Jun 19 '20 07:06 SF-Simon

What do you mean by turning it off? Not to have it animated at all, or dismissing it before the duration expires?

To "turn off the animation" (I.e. to not have an animation when showing/hiding the Flushbar, use this:

animationDuration: Duration.zero,

To dismiss the Flushbar before the duration expires, use this:

// First, make sure to assign the created Flushbar to a parameter.
Flushbar flushbar = Flushbar(
  animationDuration: Duration.zero,
  ...
);

// Display the Flushbar.
flushbar.show(context);

// Then dismiss it whenever you want.
flushbar.dismiss();

benPesso avatar Oct 01 '20 11:10 benPesso