closeCurrentSnackbar method

Future<void> closeCurrentSnackbar({
  1. bool withAnimations = true,
})

Closes the currently visible snackbar, if any.

When withAnimations is false, the snackbar is removed immediately, skipping its exit animation.

Implementation

Future<void> closeCurrentSnackbar({bool withAnimations = true}) async {
  await SnackbarController.closeCurrentSnackbar(
    withAnimations: withAnimations,
  );
}