screenshots_blurry_state.dart 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. import '../image_picker/image_picker_util.dart';
  2. import '../people_photo/photo_group.dart';
  3. class ScreenshotsBlurryState {
  4. static final PhotoGroup screenshotsPhotoGroup = PhotoGroup(
  5. isSelected: false,
  6. images: ImagePickerUtil.screenshotPhotos,
  7. );
  8. static final PhotoGroup blurryPhotoGroup = PhotoGroup(
  9. isSelected: false,
  10. images: ImagePickerUtil.blurryPhotos,
  11. );
  12. static void removePhotosData(Set<String> selectedPhotosIds) {
  13. screenshotsPhotoGroup.images
  14. .removeWhere((element) => selectedPhotosIds.contains(element.id));
  15. screenshotsPhotoGroup.selectedPhotosIds
  16. .removeWhere((element) => selectedPhotosIds.contains(element));
  17. blurryPhotoGroup.images
  18. .removeWhere((element) => selectedPhotosIds.contains(element.id));
  19. blurryPhotoGroup.selectedPhotosIds
  20. .removeWhere((element) => selectedPhotosIds.contains(element));
  21. // 如果images为空,删除该 album
  22. if (screenshotsPhotoGroup.images.isEmpty &&
  23. blurryPhotoGroup.images.isEmpty) {
  24. return;
  25. }
  26. }
  27. }