added service item notes

This commit is contained in:
Daniel Borges 2019-08-11 16:17:39 -03:00
parent d333ada7ca
commit d01d9a8965
2 changed files with 37 additions and 12 deletions

View File

@ -27,8 +27,9 @@ class ServiceItem {
final Plugin plugin;
bool selected;
final String title;
String notes;
ServiceItem({this.id, String plugin, this.selected, this.title})
ServiceItem({this.id, String plugin, this.selected, this.title, this.notes})
: plugin = Plugin(plugin);
ServiceItem.fromJson(Map<String, dynamic> json)

View File

@ -36,20 +36,44 @@ class _ServiceListViewState extends State<ServiceListView> {
@override
void initState() {
serviceItems = [
ServiceItem(id: '1', plugin: 'songs', selected: true, title: 'Oceans'),
ServiceItem(
id: '2', plugin: 'bibles', selected: false, title: 'John 3:16'),
id: '1',
plugin: 'songs',
selected: true,
title: 'Oceans',
notes: 'First music before the presentation.',
),
ServiceItem(
id: '3',
plugin: 'presentations',
selected: false,
title: 'Sunday service.pdf'),
id: '2',
plugin: 'bibles',
selected: false,
title: 'John 3:16',
notes: 'This is the item notes.',
),
ServiceItem(
id: '4', plugin: 'images', selected: false, title: 'Slogan.jpg'),
id: '3',
plugin: 'presentations',
selected: false,
title: 'Sunday service.pdf',
),
ServiceItem(
id: '5', plugin: 'media', selected: false, title: 'Video.mp4'),
id: '4',
plugin: 'images',
selected: false,
title: 'Slogan.jpg',
),
ServiceItem(
id: '6', plugin: 'custom', selected: false, title: 'Custom alert'),
id: '5',
plugin: 'media',
selected: false,
title: 'Video.mp4',
),
ServiceItem(
id: '6',
plugin: 'custom',
selected: false,
title: 'Custom alert',
),
];
// serviceItems = [];
super.initState();
@ -89,8 +113,8 @@ class _ServiceListViewState extends State<ServiceListView> {
),
),
title: Text(item.title),
subtitle: Text(AppLocalizations.of(context)
.translate('plugin_${item.plugin.id}_singular')),
subtitle:
item.notes != null && item.notes != "" ? Text(item.notes) : null,
trailing: IconButton(
icon: Icon(Icons.delete),
onPressed: () {},