remoteConfigGetInt method

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

Implementation

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

    final int result = await methodChannel.invokeMethod(
      Method.remoteConfigGetInt.value,
      arguments,
    );

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