Add option to share a result from face search

This commit is contained in:
Vishnu Mohandas 2020-07-15 22:57:41 +05:30
parent c07a103450
commit 99b150477c
2 changed files with 16 additions and 14 deletions

View file

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:photos/face_search_manager.dart';
import 'package:photos/models/face.dart';
import 'package:photos/ui/circular_network_image_widget.dart';
import 'package:photos/ui/gallery.dart';
import 'package:photos/ui/gallery_app_bar_widget.dart';
class FaceSearchResultsPage extends StatelessWidget {
final FaceSearchManager _faceSearchManager = FaceSearchManager.instance;
@ -12,19 +12,19 @@ class FaceSearchResultsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
var gallery = Gallery(
asyncLoader: (offset, limit) =>
_faceSearchManager.getFaceSearchResults(face, offset, limit),
tagPrefix: "face_search_results",
);
return Scaffold(
appBar: AppBar(
title: Text("Search results"),
actions: <Widget>[
CircularNetworkImageWidget(face.getThumbnailUrl(), 20),
],
appBar: GalleryAppBarWidget(
gallery,
GalleryAppBarType.search_results,
"Search results",
),
body: Container(
child: Gallery(
asyncLoader: (offset, limit) =>
_faceSearchManager.getFaceSearchResults(face, offset, limit),
tagPrefix: "face_search_results",
),
child: gallery,
),
);
}

View file

@ -17,6 +17,7 @@ enum GalleryAppBarType {
homepage,
local_folder,
remote_folder,
search_results,
}
class GalleryAppBarWidget extends StatefulWidget
@ -29,9 +30,9 @@ class GalleryAppBarWidget extends StatefulWidget
GalleryAppBarWidget(
this.gallery,
this.type,
this.title,
this.title, [
this.path,
);
]);
@override
_GalleryAppBarWidgetState createState() => _GalleryAppBarWidgetState();
@ -117,7 +118,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
List<Widget> _getActions(BuildContext context) {
List<Widget> actions = List<Widget>();
if (_selectedFiles.isNotEmpty) {
if (widget.type != GalleryAppBarType.remote_folder) {
if (widget.type != GalleryAppBarType.remote_folder &&
widget.type != GalleryAppBarType.search_results) {
actions.add(IconButton(
icon: Icon(Icons.delete),
onPressed: () {