JulyWitch / animated_snack_bar

Easily show beautiful snack bars directly using overlays. Create custom snack bars and show them with awesome animations.
https://pub.dev/packages/animated_snack_bar
GNU General Public License v3.0
16 stars 12 forks source link

Remove the SnackBar manually #14

Closed kh-abir closed 10 months ago

kh-abir commented 1 year ago

I was building a custom-type AnimatedSnacKBar. How can I remove the snack bar manually onTap?

Haris2v commented 1 year ago

Yeah, I'm also looking for same functionality. Manual snackBar functionality is really needed in many cases

JulyWitch commented 10 months ago

Hello, Sorry for the late reply, I'll add this functionality in the next release

JulyWitch commented 10 months ago

Dear @kh-abir and @Haris2v This functionality is added in v0.4.0, Please open a new issue if you notice any weird behavior.

Here is an snippet of how you can delete a snack bar manually

final snackbar = AnimatedSnackBar(
    builder: ((context) {
        return Container(
            padding: const EdgeInsets.all(8),
            height: 50,
            child: const Text('A custom snackbar'),
        );
    }),
);
snackbar.show(context);

snackbar.remove()