getCurrentSelectionEntityParams function

Map<String, String> getCurrentSelectionEntityParams(
  1. TSelectionEntity selectionEntity
)

Implementation

Map<String, String> getCurrentSelectionEntityParams(
    TSelectionEntity selectionEntity) {
  Map<String, String> params = {};
  String? parentKey = selectionEntity.key;
  List<String?> selectedEntity = selectionEntity.children
      .where((TSelectionEntity f) => f.isSelected)
      .where((TSelectionEntity f) => !SelectionUtil.isEmpty(f.value))
      .map((TSelectionEntity f) => f.value)
      .toList();
  String selectedParams =
      selectedEntity.isEmpty ? '' : selectedEntity.join(',');
  if (!SelectionUtil.isEmpty(selectedParams) && !SelectionUtil.isEmpty(parentKey)) {
    params[parentKey!] = selectedParams;
  }
  return params;
}