shared_collection_page.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:flutter/material.dart';
  2. import 'package:photos/db/files_db.dart';
  3. import 'package:photos/models/selected_files.dart';
  4. import 'package:photos/models/shared_collection.dart';
  5. import 'package:photos/ui/gallery.dart';
  6. import 'package:photos/ui/gallery_app_bar_widget.dart';
  7. class SharedCollectionPage extends StatefulWidget {
  8. final SharedCollection collection;
  9. const SharedCollectionPage(this.collection, {Key key}) : super(key: key);
  10. @override
  11. _SharedCollectionPageState createState() => _SharedCollectionPageState();
  12. }
  13. class _SharedCollectionPageState extends State<SharedCollectionPage> {
  14. final _selectedFiles = SelectedFiles();
  15. @override
  16. Widget build(Object context) {
  17. var gallery = Gallery(
  18. asyncLoader: (lastFile, limit) => FilesDB.instance.getAllInCollection(
  19. widget.collection.id,
  20. lastFile == null
  21. ? DateTime.now().microsecondsSinceEpoch
  22. : lastFile.creationTime,
  23. limit),
  24. // onRefresh: () => FolderSharingService.instance.syncDiff(widget.folder),
  25. tagPrefix: "shared_collection",
  26. selectedFiles: _selectedFiles,
  27. );
  28. return Scaffold(
  29. appBar: GalleryAppBarWidget(
  30. GalleryAppBarType.shared_collection,
  31. widget.collection.name,
  32. _selectedFiles,
  33. ),
  34. body: gallery,
  35. );
  36. }
  37. }