closeBottomSheet<T> method

void closeBottomSheet<T>({
  1. String? id,
  2. T? result,
})

Closes bottom sheet that are currently open.

id is for when using nested navigation.

Implementation

void closeBottomSheet<T>({String? id, T? result}) {
  // Stop if there is no bottomsheet open
  if (isBottomSheetOpen == null || !isBottomSheetOpen!) return;

  closeOverlay(id: id, result: result);
}