ente/lib/ui/face_search_results_page.dart

39 lines
1.1 KiB
Dart
Raw Normal View History

2020-04-05 14:00:44 +00:00
import 'package:flutter/material.dart';
2020-10-03 17:56:18 +00:00
import 'package:photos/services/face_search_service.dart';
2020-05-01 18:20:12 +00:00
import 'package:photos/models/face.dart';
import 'package:photos/models/selected_files.dart';
2020-06-02 14:24:37 +00:00
import 'package:photos/ui/gallery.dart';
import 'package:photos/ui/gallery_app_bar_widget.dart';
2020-04-05 14:00:44 +00:00
class FaceSearchResultsPage extends StatelessWidget {
2020-10-03 17:56:18 +00:00
final FaceSearchService _faceSearchManager = FaceSearchService.instance;
2020-06-03 13:53:53 +00:00
final Face face;
final selectedFiles = SelectedFiles();
2020-04-05 14:00:44 +00:00
2020-06-03 13:53:53 +00:00
FaceSearchResultsPage(this.face, {Key key}) : super(key: key);
2020-04-05 14:00:44 +00:00
@override
Widget build(BuildContext context) {
var gallery = Gallery(
asyncLoader: (lastFile, limit) => _faceSearchManager.getFaceSearchResults(
face,
lastFile == null
? DateTime.now().microsecondsSinceEpoch
: lastFile.creationTime,
limit),
tagPrefix: "face_search_results",
selectedFiles: selectedFiles,
);
2020-04-05 14:00:44 +00:00
return Scaffold(
appBar: GalleryAppBarWidget(
GalleryAppBarType.search_results,
"Search results",
selectedFiles,
2020-04-05 14:00:44 +00:00
),
body: Container(
child: gallery,
2020-04-05 14:00:44 +00:00
),
);
}
}