getTreatmentWithConfig method

  1. @override
Future<SplitResult> getTreatmentWithConfig(
  1. String featureFlagName, [
  2. Map<String, dynamic> attributes = const {}
])
override

Performs and evaluation and returns a SplitResult object for the featureFlagName feature flag. This object contains the treatment alongside the feature flag's configuration, if any.

This method returns 'control' if: there was an exception in evaluating the treatment, the SDK does not know of the existence of this feature flag, and/or the feature flag was deleted through the Split user interface.

The SDK returns the default treatment of this feature flag if: The feature flag was killed, or the key did not match any of the conditions in the feature flag roll-out plan.

featureFlagName is the feature flag we want to evaluate.

Optionally, a Map can be specified with the attributes parameter to take into account when evaluating.

Implementation

@override
Future<SplitResult> getTreatmentWithConfig(String featureFlagName,
    [Map<String, dynamic> attributes = const {}]) async {
  return _platform.getTreatmentWithConfig(
      matchingKey: _matchingKey,
      bucketingKey: _bucketingKey,
      splitName: featureFlagName,
      attributes: attributes);
}