setStyleURI method

Future<void> setStyleURI(
  1. String uri
)

Load style from provided URI.

This is an asynchronous call. To check the result of this operation the user must register an observer observing MapLoaded or MapLoadingError events. In case of successful style load, StyleLoaded event will be also emitted.

@param uri URI where the style should be loaded from.

Implementation

Future<void> setStyleURI(String uri) async {
  final String pigeonVar_channelName =
      'dev.flutter.pigeon.mapbox_maps_flutter.StyleManager.setStyleURI$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel =
      BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final Future<Object?> pigeonVar_sendFuture =
      pigeonVar_channel.send(<Object?>[uri]);
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_sendFuture as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else {
    return;
  }
}