addStyleImportFromJSON method
Adds new import to current style, loaded from a JSON string.
@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. @param importPosition The import will be positioned according to the ImportPosition parameters. If not specified, then the import is moved to the top of the import stack.
Implementation
Future<void> addStyleImportFromJSON(
String importId,
String json, {
Map<String, Object>? config,
ImportPosition? importPosition,
}) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.mapbox_maps_flutter.StyleManager.addStyleImportFromJSON$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, importPosition]);
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;
}
}