closeOverlay method

void closeOverlay({
  1. String? id,
})

Closes the topmost overlay (dialog or bottom sheet) using the given delegate key.

Parameters:

  • id: The key associated with the delegate to use for closing the overlay. If null, the root delegate will be used.

Implementation

void closeOverlay({String? id}) {
  searchDelegate(id).navigatorKey.currentState?.pop();
}