|
|
@@ -94,51 +94,49 @@ class PhotoPreviewController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// 获取参数
|
|
|
void _getArgs() {
|
|
|
photosType = parameters?['photosType'];
|
|
|
currentImageId = parameters?['currentImageId'];
|
|
|
}
|
|
|
|
|
|
+ void _assignPhotosAndSelections(BasePhotoController controller) {
|
|
|
+ listAssetEntity.assignAll(controller.getAllPhotos());
|
|
|
+ selectedPhotosIds.assignAll(controller.selectedPhotosIds);
|
|
|
+ selectedFileCount.value = selectedPhotosIds.length;
|
|
|
+ }
|
|
|
+
|
|
|
void _initData() {
|
|
|
listAssetEntity.clear();
|
|
|
selectedPhotosIds.clear();
|
|
|
|
|
|
switch (photosType) {
|
|
|
+
|
|
|
case PhotosType.peoplePhotos:
|
|
|
final PeoplePhotoController controller =
|
|
|
- Get.find<PeoplePhotoController>();
|
|
|
- listAssetEntity.assignAll(controller.getAllPhotos());
|
|
|
- selectedPhotosIds.assignAll(controller.selectedPhotosIds);
|
|
|
- selectedFileCount.value = selectedPhotosIds.length;
|
|
|
+ Get.find<PeoplePhotoController>();
|
|
|
+ _assignPhotosAndSelections(controller);
|
|
|
break;
|
|
|
case PhotosType.screenshots:
|
|
|
final ScreenShotsController controller =
|
|
|
Get.find<ScreenShotsController>();
|
|
|
- listAssetEntity.assignAll(controller.getAllPhotos());
|
|
|
- selectedPhotosIds.assignAll(controller.selectedPhotosIds);
|
|
|
- selectedFileCount.value = selectedPhotosIds.length;
|
|
|
+ _assignPhotosAndSelections(controller);
|
|
|
break;
|
|
|
case PhotosType.similarPhotos:
|
|
|
final SimilarPhotoController controller =
|
|
|
Get.find<SimilarPhotoController>();
|
|
|
- listAssetEntity.assignAll(controller.getAllPhotos());
|
|
|
- selectedPhotosIds.assignAll(controller.selectedPhotosIds);
|
|
|
- selectedFileCount.value = selectedPhotosIds.length;
|
|
|
+ _assignPhotosAndSelections(controller);
|
|
|
break;
|
|
|
case PhotosType.locationPhotos:
|
|
|
final LocationsSinglePhotoController controller =
|
|
|
Get.find<LocationsSinglePhotoController>();
|
|
|
- listAssetEntity.assignAll(controller.getAllPhotos());
|
|
|
- selectedPhotosIds.assignAll(controller.selectedPhotosIds);
|
|
|
- selectedFileCount.value = selectedPhotosIds.length;
|
|
|
+ _assignPhotosAndSelections(controller);
|
|
|
break;
|
|
|
case PhotosType.blurryPhotos:
|
|
|
final ScreenShotsController controller =
|
|
|
Get.find<ScreenShotsController>();
|
|
|
- listAssetEntity.assignAll(controller.getAllPhotos());
|
|
|
- selectedPhotosIds.assignAll(controller.selectedPhotosIds);
|
|
|
- selectedFileCount.value = selectedPhotosIds.length;
|
|
|
+ _assignPhotosAndSelections(controller);
|
|
|
break;
|
|
|
}
|
|
|
|