setOfflineRegionDownloadState method
- OfflineRegionDownloadState arg_state
Sets the download state of an offline region A region is either inactive (not downloading, but previously-downloaded resources are available for use), or active (resources are being downloaded or will be downloaded, if necessary, when network access is available).
If the region is already in the given state, this call is ignored.
@param state The new state to set.
Implementation
Future<void> setOfflineRegionDownloadState(
OfflineRegionDownloadState arg_state) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.mapbox_maps_flutter.OfflineRegion.setOfflineRegionDownloadState',
codec,
binaryMessenger: _binaryMessenger);
final List<Object?>? replyList =
await channel.send(<Object?>[arg_state.index]) as List<Object?>?;
if (replyList == null) {
throw PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel.',
);
} else if (replyList.length > 1) {
throw PlatformException(
code: replyList[0]! as String,
message: replyList[1] as String?,
details: replyList[2],
);
} else {
return;
}
}