ente/lib/ui/shared_collection_page.dart

43 lines
1.3 KiB
Dart
Raw Normal View History

2020-10-13 21:46:46 +00:00
import 'package:flutter/material.dart';
import 'package:photos/db/files_db.dart';
import 'package:photos/models/selected_files.dart';
import 'package:photos/models/shared_collection.dart';
import 'package:photos/ui/gallery.dart';
import 'package:photos/ui/gallery_app_bar_widget.dart';
class SharedCollectionPage extends StatefulWidget {
final SharedCollection collection;
const SharedCollectionPage(this.collection, {Key key}) : super(key: key);
@override
_SharedCollectionPageState createState() => _SharedCollectionPageState();
}
class _SharedCollectionPageState extends State<SharedCollectionPage> {
final _selectedFiles = SelectedFiles();
@override
Widget build(Object context) {
var gallery = Gallery(
asyncLoader: (lastFile, limit) => FilesDB.instance.getAllInCollection(
widget.collection.id,
lastFile == null
? DateTime.now().microsecondsSinceEpoch
: lastFile.creationTime,
limit),
// onRefresh: () => FolderSharingService.instance.syncDiff(widget.folder),
tagPrefix: "shared_collection",
selectedFiles: _selectedFiles,
);
return Scaffold(
appBar: GalleryAppBarWidget(
GalleryAppBarType.shared_collection,
widget.collection.name,
_selectedFiles,
),
body: gallery,
);
}
}