getTreatmentsWithConfig method

  1. @override
Future<Map<String, SplitResult>> getTreatmentsWithConfig({
  1. required String matchingKey,
  2. required String? bucketingKey,
  3. required List<String> splitNames,
  4. Map<String, dynamic> attributes = const {},
})

Implementation

@override
Future<Map<String, SplitResult>> getTreatmentsWithConfig(
    {required String matchingKey,
    required String? bucketingKey,
    required List<String> splitNames,
    Map<String, dynamic> attributes = const {}}) async {
  Map? treatments = await methodChannel.invokeMapMethod(
      'getTreatmentsWithConfig',
      _buildParameters(matchingKey, bucketingKey,
          {'splitName': splitNames, 'attributes': attributes}));

  return treatments?.map((key, value) =>
          MapEntry(key, SplitResult(value['treatment'], value['config']))) ??
      {for (var item in splitNames) item: _controlResult};
}