download method

Future<void>? download(
  1. FirebaseRemoteModel? model,
  2. FirebaseModelDownloadConditions? conditions
)

Initiates the download of remoteModel if the download hasn't begun.

If the model's download is already in progress, new download will not be initiated.

If the model is already downloaded to the device, and there is no update, the task will immediately succeed.

If the model is already downloaded to the device, and there is update, a download for the updated version will be attempted.

If the model update is failed to schedule, no error is raised, and the caller should use the existing model.

Implementation

Future<void> download(FirebaseRemoteModel model,
    FirebaseModelDownloadConditions conditions) async {
  assert(model != null);
  assert(conditions != null);
  await channel.invokeMethod('FirebaseModelManager#download', {
    'modelName': model.modelName,
    'conditions': conditions.toMap(),
  });
}