Is there any way to dismiss the snackbar in all ways (both horizontal and vertical) in Flutter?

18 views Asked by At
class DismissibleSnackBar extends SnackBar {
  final Color backgroundColor;
  final Duration duration;

  const DismissibleSnackBar({
    Key? key,
    required this.backgroundColor,
    required this.duration,
    required Widget content,
  }) : super(
          key: key,
          content: content,
          backgroundColor: backgroundColor,
          duration: duration,
          dismissDirection: DismissDirection.vertical,
        );
}

I tried building a custom widget, but then it has an error with passing into

  ScaffoldMessenger.of(context)
                              .showSnackBar(DismissibleSnackBar(

Basically, I tried everything

0

There are 0 answers