Parcourir la source

Reuse collection page

Vishnu Mohandas il y a 4 ans
Parent
commit
f94d086ed8
2 fichiers modifiés avec 1 ajouts et 53 suppressions
  1. 0 51
      lib/ui/shared_collection_page.dart
  2. 1 2
      lib/ui/shared_collections_gallery.dart

+ 0 - 51
lib/ui/shared_collection_page.dart

@@ -1,51 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:photos/core/event_bus.dart';
-import 'package:photos/db/files_db.dart';
-import 'package:photos/events/collection_updated_event.dart';
-import 'package:photos/models/collection_items.dart';
-import 'package:photos/models/selected_files.dart';
-import 'package:photos/ui/gallery.dart';
-import 'package:photos/ui/gallery_app_bar_widget.dart';
-
-class SharedCollectionPage extends StatelessWidget {
-  final CollectionWithThumbnail c;
-  final _selectedFiles = SelectedFiles();
-
-  SharedCollectionPage(this.c, {Key key}) : super(key: key);
-
-  @override
-  Widget build(Object context) {
-    var gallery = Gallery(
-      asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) {
-        return FilesDB.instance.getFilesInCollection(
-            c.collection.id, creationStartTime, creationEndTime,
-            limit: limit, asc: asc);
-      },
-      reloadEvent: Bus.instance
-          .on<CollectionUpdatedEvent>()
-          .where((event) => event.collectionID == c.collection.id),
-      tagPrefix: "shared_collection",
-      selectedFiles: _selectedFiles,
-      initialFiles: [c.thumbnail],
-    );
-    return Scaffold(
-      body: Stack(
-        children: [
-          Padding(
-            padding: const EdgeInsets.only(top: 80),
-            child: gallery,
-          ),
-          Container(
-            height: 80,
-            child: GalleryAppBarWidget(
-              GalleryAppBarType.shared_collection,
-              c.collection.name,
-              _selectedFiles,
-              collection: c.collection,
-            ),
-          )
-        ],
-      ),
-    );
-  }
-}

+ 1 - 2
lib/ui/shared_collections_gallery.dart

@@ -15,7 +15,6 @@ import 'package:photos/services/collections_service.dart';
 import 'package:photos/ui/collection_page.dart';
 import 'package:photos/ui/collection_page.dart';
 import 'package:photos/ui/collections_gallery_widget.dart';
 import 'package:photos/ui/collections_gallery_widget.dart';
 import 'package:photos/ui/loading_widget.dart';
 import 'package:photos/ui/loading_widget.dart';
-import 'package:photos/ui/shared_collection_page.dart';
 import 'package:photos/ui/thumbnail_widget.dart';
 import 'package:photos/ui/thumbnail_widget.dart';
 import 'package:photos/utils/navigation_util.dart';
 import 'package:photos/utils/navigation_util.dart';
 import 'package:photos/utils/share_util.dart';
 import 'package:photos/utils/share_util.dart';
@@ -419,7 +418,7 @@ class IncomingCollectionItem extends StatelessWidget {
         ],
         ],
       ),
       ),
       onTap: () {
       onTap: () {
-        routeToPage(context, SharedCollectionPage(c));
+        routeToPage(context, CollectionPage(c, tagPrefix: "shared_collection"));
       },
       },
     );
     );
   }
   }