cancelAll static method

void cancelAll()

Cancels all displayed flushbars.

This method removes all currently displayed flushbars, effectively hiding them from the screen.

Throws an exception if FlashyProxy.buildContext is null.

Implementation

static void cancelAll() {
  if (FlashyProxy.buildContext == null) {
    throw Exception("FlashyProxy.buildContext is null, please use FlashyFlushbarProvider");
  }
  for (final overlayEntry in FlashyProxy.entries.values) {
    if (overlayEntry.mounted) {
      overlayEntry.remove();
    }
  }
  FlashyProxy.entries.clear();
}