updateStyleImportWithJSON method

Future<void> updateStyleImportWithJSON(
  1. String importId,
  2. String json, {
  3. Map<String, Object>? config,
})

Updates an existing import in the style. The function replaces the content of the import, with the content loaded from the provided data value. The configuration values of the import are merged with the configuration provided in the update.

@param importId Identifier of import to update. @param json The JSON string to be loaded directly as the import. @param config A map containing the configuration options of the import.

Implementation

Future<void> updateStyleImportWithJSON(
  String importId,
  String json, {
  Map<String, Object>? config,
}) async {
  final String pigeonVar_channelName =
      'dev.flutter.pigeon.mapbox_maps_flutter.StyleManager.updateStyleImportWithJSON$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel =
      BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final Future<Object?> pigeonVar_sendFuture =
      pigeonVar_channel.send(<Object?>[importId, json, config]);
  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;
  }
}