closeLoadingDialog method

void closeLoadingDialog()

Closes the loading dialog.

This method pops the Navigator stack to close the dialog that was previously shown using showLoadingDialog. It should be called once the long-running task is completed.

Implementation

void closeLoadingDialog() {
  if (dialogContext != null) {
    Navigator.pop(dialogContext!);
    dialogContext = null; // Reset after closing
  }
}