setOfflineRegionDownloadState method

Future<void> setOfflineRegionDownloadState(
  1. int regionId,
  2. OfflineRegionDownloadState state
)

Starts or pauses the download of the offline region regionId.

Setting the state that the download already has does nothing. A download stops when the runtime closes.

See mln_runtime_set_offline_region_download_state in the C API reference.

Errors:

  • Status.notFound when the cache file has no region regionId.

Implementation

Future<void> setOfflineRegionDownloadState(
  int regionId,
  OfflineRegionDownloadState state,
) => _run(
  (arena, completion) => raw.mln_runtime_set_offline_region_download_state(
    _handle.raw,
    regionId,
    state.rawValue,
    completion,
    nativeDiagnostic,
  ),
);