getTreatment method

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

Performs an evaluation for the featureFlagName feature flag.

This method returns the string 'control' if: there was an exception in evaluating the feature flag, 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.

Returns the evaluated treatment, the default treatment of this feature flag, or 'control'.

Implementation

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