stopLoading method

void stopLoading()

Ends the loading process and notifies listeners.

Implementation

void stopLoading() {
  // Close the stream controller if exists
  stream?.close();
  // Clear stream reference
  stream = null;
  // Notify listeners about state change
  notifyListeners();
}