handleSelect method

void handleSelect(
  1. ValueNotifier<List> selectedList,
  2. PlatformFile file
)

Implementation

void handleSelect(
    ValueNotifier<List<dynamic>> selectedList, PlatformFile file) {
  List<PlatformFile> x = List.from(selectedList.value);
  if (x.contains(file)) {
    x.remove(file);
    selectedList.value = x;
  } else {
    x.add(file);
    selectedList.value = x;
  }
}