virtualStick method

Future<void> virtualStick(
  1. bool arg_enabled,
  2. double arg_pitch,
  3. double arg_roll,
  4. double arg_yaw,
  5. double arg_verticalThrottle,
)

Implementation

Future<void> virtualStick(bool arg_enabled, double arg_pitch, double arg_roll,
    double arg_yaw, double arg_verticalThrottle) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.DjiHostApi.virtualStick', codec,
      binaryMessenger: _binaryMessenger);
  final Map<Object?, Object?>? replyMap = await channel.send(<Object?>[
    arg_enabled,
    arg_pitch,
    arg_roll,
    arg_yaw,
    arg_verticalThrottle
  ]) 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;
  }
}