addStyleImage method Null safety

Future<void> addStyleImage(
  1. String arg_imageId,
  2. double arg_scale,
  3. MbxImage arg_image,
  4. bool arg_sdf,
  5. List<ImageStretches?> arg_stretchX,
  6. List<ImageStretches?> arg_stretchY,
  7. ImageContent? arg_content
)

Implementation

Future<void> addStyleImage(
    String arg_imageId,
    double arg_scale,
    MbxImage arg_image,
    bool arg_sdf,
    List<ImageStretches?> arg_stretchX,
    List<ImageStretches?> arg_stretchY,
    ImageContent? arg_content) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.StyleManager.addStyleImage', codec,
      binaryMessenger: _binaryMessenger);
  final Map<Object?, Object?>? replyMap = await channel.send(<Object?>[
    arg_imageId,
    arg_scale,
    arg_image,
    arg_sdf,
    arg_stretchX,
    arg_stretchY,
    arg_content
  ]) as Map<Object?, Object?>?;
  if (replyMap == null) {
    throw PlatformException(
      code: 'channel-error',
      message: 'Unable to establish connection on channel.',
    );
  } else if (replyMap['error'] != null) {
    final Map<Object?, Object?> error =
        (replyMap['error'] as Map<Object?, Object?>?)!;
    throw PlatformException(
      code: (error['code'] as String?)!,
      message: error['message'] as String?,
      details: error['details'],
    );
  } else {
    return;
  }
}