clearMaterialBanners method

void clearMaterialBanners()

Removes all the MaterialBanners currently in queue by clearing the queue and running normal exit animation on the current MaterialBanner.

Implementation

void clearMaterialBanners() {
  if (_materialBanners.isEmpty || _materialBannerController!.isDismissed) {
    return;
  }
  final ScaffoldFeatureController<MaterialBanner, MaterialBannerClosedReason> currentMaterialBanner = _materialBanners.first;
  _materialBanners.clear();
  _materialBanners.add(currentMaterialBanner);
  hideCurrentMaterialBanner();
}