remoteConfigGetBool method

  1. @override
Future<bool> remoteConfigGetBool(
  1. String key,
  2. bool defaultValue, {
  3. HackleUser? user,
})
override

Implementation

@override
Future<bool> remoteConfigGetBool(
  String key,
  bool defaultValue, {
  HackleUser? user,
}) async {
  try {
    final Map<String, Object?> arguments = {
      Argument.remoteConfigKey.value: key,
      Argument.remoteConfigDefaultValue.value: defaultValue,
      Argument.user.value: user?.toMap(),
    };

    final bool result = await methodChannel.invokeMethod(
      Method.remoteConfigGetBool.value,
      arguments,
    );

    return result;
  } catch (e) {
    return defaultValue;
  }
}