emitProgress static method

void emitProgress(
  1. String modelId,
  2. double fraction
)

Emits a DownloadProgress event. Called by the model resolver during streaming downloads; safe to call from any isolate that runs the resolver (Flutter UI isolate in practice).

Implementation

static void emitProgress(String modelId, double fraction) {
  if (_downloadProgressController.isClosed) return;
  _downloadProgressController.add(
    DownloadProgress(modelId: modelId, fraction: fraction.clamp(0.0, 1.0)),
  );
}