mergeParams method

Map<String?, List<PickerEntity>> mergeParams(
  1. Map<String?, List<PickerEntity>> params,
  2. Map<String?, List<PickerEntity>> selectedParams
)

Implementation

Map<String?, List<PickerEntity>> mergeParams(
    Map<String?, List<PickerEntity>> params,
    Map<String?, List<PickerEntity>> selectedParams) {
  selectedParams.forEach((String? key, List<PickerEntity> value) {
    if (params.containsKey(key)) {
      params[key]?.addAll(value);
    } else {
      params.addAll(selectedParams);
    }
  });
  return params;
}