isFeatureOn method

  1. @override
Future<bool> isFeatureOn(
  1. int featureKey, {
  2. HackleUser? user,
})
override

Implementation

@override
Future<bool> isFeatureOn(
  int featureKey, {
  HackleUser? user,
}) async {
  try {
    final Map<String, Object?> arguments = {
      Argument.featureKey.value: featureKey,
      Argument.user.value: user?.toMap(),
    };

    final bool isFeatureOnResult = await methodChannel.invokeMethod(
      Method.isFeatureOn.value,
      arguments,
    );

    return isFeatureOnResult;
  } catch (e) {
    log("Failed to isFeatureOn", level: 3, error: e);
    return false;
  }
}