mirror of
https://gitlab.com/openlp/openlp-mobile-remote.git
synced 2024-12-22 11:52:49 +00:00
search page layout
This commit is contained in:
parent
714ff20f0b
commit
8eeb37c28c
9
lib/src/resources/openlp_icons.dart
Normal file
9
lib/src/resources/openlp_icons.dart
Normal file
@ -0,0 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class OpenLPIcons {
|
||||
final IconData songs = Icons.audiotrack;
|
||||
final IconData biblies = Icons.book;
|
||||
final IconData presentations = Icons.present_to_all;
|
||||
final IconData media = Icons.ondemand_video;
|
||||
final IconData custom = Icons.video_label;
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'service_item_search.dart';
|
||||
|
||||
class _ServiceItem {
|
||||
IconData icon;
|
||||
String title;
|
||||
@ -23,6 +25,7 @@ class ServiceItemBottomSheet extends StatelessWidget {
|
||||
title: Text(item.title),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
showSearch(context: context, delegate: ServiceItemSearch());
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
|
86
lib/src/widgets/service_item_search.dart
Normal file
86
lib/src/widgets/service_item_search.dart
Normal file
@ -0,0 +1,86 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ServiceItemSearch extends SearchDelegate {
|
||||
@override
|
||||
List<Widget> buildActions(BuildContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildLeading(BuildContext context) {
|
||||
return IconButton(
|
||||
icon: Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
close(context, null);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void _showOptions(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Text(
|
||||
query,
|
||||
style: Theme.of(context).textTheme.title,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Go live'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
close(context, null);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Add to service'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Add & Go to service'),
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
close(context, null);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _resultList(BuildContext context) {
|
||||
if (query.isEmpty) {
|
||||
return Container();
|
||||
}
|
||||
return ListView.builder(
|
||||
itemCount: 5,
|
||||
itemBuilder: (context, i) {
|
||||
return ListTile(
|
||||
title: Text(query),
|
||||
onTap: () {
|
||||
_showOptions(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildResults(BuildContext context) {
|
||||
print('buildResults - query: $query');
|
||||
return _resultList(context);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildSuggestions(BuildContext context) {
|
||||
print('buildSuggestions - query: $query');
|
||||
return _resultList(context);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user