setBool method

Future<void> setBool(
  1. String arg_key,
  2. bool arg_value
)

Implementation

Future<void> setBool(String arg_key, bool arg_value) async {
  final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
      'dev.flutter.pigeon.UserDefaultsApi.setBool', codec,
      binaryMessenger: _binaryMessenger);
  final Map<Object?, Object?>? replyMap = await channel
      .send(<Object>[arg_key, arg_value]) as Map<Object?, Object?>?;
  if (replyMap == null) {
    throw PlatformException(
      code: 'channel-error',
      message: 'Unable to establish connection on channel.',
      details: null,
    );
  } 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;
  }
}