Просмотр исходного кода

Replaced the CreateCollectionPage with the new CreateCollectionSheet on restore

ashilkn 2 лет назад
Родитель
Сommit
5b37498621

+ 8 - 11
lib/ui/viewer/file/fading_bottom_bar.dart

@@ -3,7 +3,6 @@ import 'dart:io';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
-import 'package:page_transition/page_transition.dart';
 import 'package:photos/core/configuration.dart';
 import 'package:photos/models/file.dart';
 import 'package:photos/models/file_type.dart';
@@ -13,7 +12,8 @@ import 'package:photos/models/trash_file.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/theme/colors.dart';
 import 'package:photos/theme/ente_theme.dart';
-import 'package:photos/ui/create_collection_page.dart';
+import 'package:photos/ui/create_collection_sheet.dart'
+    as create_collection_sheet;
 import 'package:photos/ui/viewer/file/file_info_widget.dart';
 import 'package:photos/utils/delete_file_util.dart';
 import 'package:photos/utils/magic_util.dart';
@@ -238,16 +238,13 @@ class FadingBottomBarState extends State<FadingBottomBar> {
             onPressed: () {
               final selectedFiles = SelectedFiles();
               selectedFiles.toggleSelection(widget.file);
-              Navigator.push(
+              Navigator.pop(context);
+              create_collection_sheet.createCollectionSheet(
+                selectedFiles,
+                null,
                 context,
-                PageTransition(
-                  type: PageTransitionType.bottomToTop,
-                  child: CreateCollectionPage(
-                    selectedFiles,
-                    null,
-                    actionType: CollectionActionType.restoreFiles,
-                  ),
-                ),
+                actionType:
+                    create_collection_sheet.CollectionActionType.restoreFiles,
               );
             },
           ),

+ 7 - 9
lib/ui/viewer/gallery/gallery_overlay_widget.dart

@@ -17,6 +17,8 @@ import 'package:photos/models/selected_files.dart';
 import 'package:photos/services/collections_service.dart';
 import 'package:photos/services/hidden_service.dart';
 import 'package:photos/ui/create_collection_page.dart';
+import 'package:photos/ui/create_collection_sheet.dart'
+    as create_collection_sheet;
 import 'package:photos/utils/delete_file_util.dart';
 import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/magic_util.dart';
@@ -464,16 +466,12 @@ class _OverlayWidgetState extends State<OverlayWidget> {
             Icons.restore,
           ),
           onPressed: () {
-            Navigator.push(
+            create_collection_sheet.createCollectionSheet(
+              widget.selectedFiles,
+              null,
               context,
-              PageTransition(
-                type: PageTransitionType.bottomToTop,
-                child: CreateCollectionPage(
-                  widget.selectedFiles,
-                  null,
-                  actionType: CollectionActionType.restoreFiles,
-                ),
-              ),
+              actionType:
+                  create_collection_sheet.CollectionActionType.restoreFiles,
             );
           },
         ),