getTreatmentsWithConfigByFlagSets method

  1. @override
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSets({
  1. required String matchingKey,
  2. required String? bucketingKey,
  3. required List<String> flagSets,
  4. Map<String, dynamic> attributes = const {},
  5. EvaluationOptions evaluationOptions = const EvaluationOptions.empty(),
})

Implementation

@override
Future<Map<String, SplitResult>> getTreatmentsWithConfigByFlagSets(
    {required String matchingKey,
    required String? bucketingKey,
    required List<String> flagSets,
    Map<String, dynamic> attributes = const {},
    EvaluationOptions evaluationOptions =
        const EvaluationOptions.empty()}) async {
  final params = _withEvalOptions(
    matchingKey,
    bucketingKey,
    base: {
      'flagSets': flagSets,
      'attributes': attributes,
    },
    evaluationOptions: evaluationOptions,
  );
  Map? treatments = await methodChannel.invokeMapMethod(
      'getTreatmentsWithConfigByFlagSets', params);

  return treatments?.map((key, value) =>
          MapEntry(key, SplitResult(value['treatment'], value['config']))) ??
      {};
}