Update search interface
This commit is contained in:
parent
e0d6c831bc
commit
60d7079e77
3 changed files with 28 additions and 17 deletions
|
@ -4,6 +4,7 @@ import 'package:photos/face_search_manager.dart';
|
|||
import 'package:photos/models/face.dart';
|
||||
import 'package:photos/models/photo.dart';
|
||||
import 'package:photos/ui/circular_network_image_widget.dart';
|
||||
import 'package:photos/ui/loading_widget.dart';
|
||||
import 'package:photos/ui/thumbnail_widget.dart';
|
||||
import 'package:photos/ui/detail_page.dart';
|
||||
|
||||
|
@ -50,7 +51,7 @@ class FaceSearchResultsPage extends StatelessWidget {
|
|||
crossAxisCount: 4,
|
||||
));
|
||||
} else {
|
||||
return Text("Loading...");
|
||||
return Center(child: loadWidget);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
@ -14,6 +14,7 @@ import 'package:photos/ui/gallery.dart';
|
|||
import 'package:photos/ui/gallery_app_bar_widget.dart';
|
||||
import 'package:photos/ui/loading_widget.dart';
|
||||
import 'package:photos/ui/remote_folder_gallery_widget.dart';
|
||||
import 'package:photos/ui/search_page.dart';
|
||||
import 'package:photos/utils/logging_util.dart';
|
||||
import 'package:shake/shake.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
@ -89,6 +90,21 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
}
|
||||
},
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return SearchPage();
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Icon(Icons.search),
|
||||
elevation: 1,
|
||||
backgroundColor: Colors.white30,
|
||||
foregroundColor: Colors.amber,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ 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/face_search_results_page.dart';
|
||||
import 'package:photos/ui/loading_widget.dart';
|
||||
|
||||
class SearchPage extends StatelessWidget {
|
||||
final FaceSearchManager _faceSearchManager = FaceSearchManager.instance;
|
||||
|
@ -11,21 +12,12 @@ class SearchPage extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Hero(
|
||||
tag: "search",
|
||||
flightShuttleBuilder: (BuildContext flightContext,
|
||||
Animation<double> animation,
|
||||
HeroFlightDirection flightDirection,
|
||||
BuildContext fromHeroContext,
|
||||
BuildContext toHeroContext) =>
|
||||
Material(child: toHeroContext.widget),
|
||||
child: TextField(
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: 'Search your photos',
|
||||
contentPadding: const EdgeInsets.all(0.0),
|
||||
),
|
||||
title: TextField(
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: 'Search your photos',
|
||||
contentPadding: const EdgeInsets.all(0.0),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
|
@ -57,8 +49,10 @@ class SearchPage extends StatelessWidget {
|
|||
return _buildItem(context, snapshot.data[index]);
|
||||
}),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Center(child: Text("Error: " + snapshot.error.toString()));
|
||||
} else {
|
||||
return Text("Loading...");
|
||||
return Center(child: loadWidget);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue