diff --git a/lib/src/models/slide_item.dart b/lib/src/models/slide_item.dart new file mode 100644 index 0000000..dec24a7 --- /dev/null +++ b/lib/src/models/slide_item.dart @@ -0,0 +1,14 @@ +class SlideItem { + final String tag; + final String html; + final String text; + bool selected; + + SlideItem({this.tag, this.html, this.text, this.selected}); + + SlideItem.fromJson(Map json) + : tag = json['tag'], + text = json['text'], + html = json['html'], + selected = json['selected']; +} diff --git a/lib/src/openlp_remote_app.dart b/lib/src/openlp_remote_app.dart index d306bd5..01d6f16 100644 --- a/lib/src/openlp_remote_app.dart +++ b/lib/src/openlp_remote_app.dart @@ -5,6 +5,7 @@ import 'app_theme.dart'; import 'widgets/bottom_navigation_bar.dart'; import 'widgets/search_floating_button.dart'; import 'widgets/service_listview.dart'; +import 'widgets/slides_listview.dart'; class OpenLPRemoteApp extends StatefulWidget { @override @@ -48,7 +49,7 @@ class _OpenLPRemoteAppState extends State controller: tabController, children: [ ServiceListView(), - Container(), + SlideListView(), ], ), floatingActionButton: SearchFloatingButton(), diff --git a/lib/src/widgets/service_listview.dart b/lib/src/widgets/service_listview.dart index 01a70c7..f51762b 100644 --- a/lib/src/widgets/service_listview.dart +++ b/lib/src/widgets/service_listview.dart @@ -13,9 +13,9 @@ class _ServiceListViewState extends State { @override void initState() { serviceItems = [ - ServiceItem(id: '1', plugin: 'songs', selected: false, title: 'Oceans'), + ServiceItem(id: '1', plugin: 'songs', selected: true, title: 'Oceans'), ServiceItem( - id: '2', plugin: 'bibles', selected: true, title: 'John 3:16'), + id: '2', plugin: 'bibles', selected: false, title: 'John 3:16'), ServiceItem( id: '3', plugin: 'presentations', @@ -28,6 +28,7 @@ class _ServiceListViewState extends State { ServiceItem( id: '6', plugin: 'custom', selected: false, title: 'Custom alert'), ]; + // serviceItems = []; super.initState(); } diff --git a/lib/src/widgets/slides_listview.dart b/lib/src/widgets/slides_listview.dart index e69de29..882445b 100644 --- a/lib/src/widgets/slides_listview.dart +++ b/lib/src/widgets/slides_listview.dart @@ -0,0 +1,133 @@ +import 'package:flutter/material.dart'; + +import '../models/slide_item.dart'; + +class SlideListView extends StatefulWidget { + @override + _SlideListViewState createState() => _SlideListViewState(); +} + +class _SlideListViewState extends State { + List slidesItems; + + @override + void initState() { + slidesItems = [ + SlideItem( + tag: '1', + html: '', + selected: false, + text: 'You call me out upon the waters\n' + + 'The great unknown where feet may fail\n' + + 'And there I find You in the mystery\n' + + 'In oceans deep, my faith will stand', + ), + SlideItem( + tag: '2', + html: '', + selected: true, + text: 'And I will call upon Your name\n' + + 'And keep my eyes above the waves\n' + + 'When oceans rise, my soul will rest in Your embrace\n' + + 'I am Yours and You are mine', + ), + SlideItem( + tag: '3', + html: '', + selected: false, + text: 'Your grace abounds in deepest waters\n' + + 'Your sovereign hand\n' + + 'Will be my guide\n' + + 'Where feet may fail and fear surrounds me\n' + + 'You\'ve never failed and You won\'t start now', + ), + SlideItem( + tag: '4', + html: '', + selected: false, + text: 'So I will call upon Your name\n' + + 'And keep my eyes above the waves\n' + + 'When oceans rise, my soul will rest in Your embrace\n' + + 'For I am Yours and You are mine, oh\n' + + 'And You are mine, oh', + ), + SlideItem( + tag: '5', + html: '', + selected: false, + text: 'Spirit lead me where my trust is without borders\n' + + 'Let me walk upon the waters\n' + + 'Wherever You would call me\n' + + 'Take me deeper than my feet could ever wander\n' + + 'And my faith will be made stronger\n' + + 'In the presence of my Savior', + ), + SlideItem( + tag: '6', + html: '', + selected: false, + text: 'Spirit lead me where my trust is without borders\n' + + 'Let me walk upon the waters\n' + + 'Wherever You would call me\n' + + 'Take me deeper than my feet could ever wander\n' + + 'And my faith will be made stronger\n' + + 'In the presence of my Savior', + ), + SlideItem( + tag: '7', + html: '', + selected: false, + text: 'Spirit lead me where my trust is without borders\n' + + 'Let me walk upon the waters\n' + + 'Wherever You would call me\n' + + 'Take me deeper than my feet could ever wander\n' + + 'And my faith will be made stronger\n' + + 'In the presence of my Savior, oh', + ), + SlideItem( + tag: '8', + html: '', + selected: false, + text: 'I will call upon Your name\n' + + 'Keep my eyes above the waves\n' + + 'My soul will rest in Your embrace\n' + + 'I am Yours and You are mine', + ), + ]; + // slidesItems = []; + super.initState(); + } + + @override + Widget build(BuildContext context) { + if (slidesItems.isEmpty) { + return Center( + child: Container( + constraints: BoxConstraints( + maxHeight: 100, + maxWidth: 250, + ), + child: Text( + 'Any service item selected.\n' + + 'Please, select a service item in "SERVICE" tab.', + textAlign: TextAlign.center, + style: TextStyle(color: Colors.black38), + ), + ), + ); + } + return ListView.builder( + padding: EdgeInsets.only(bottom: 35), + itemCount: slidesItems.length, + itemBuilder: (context, i) { + SlideItem item = slidesItems[i]; + return ListTile( + contentPadding: EdgeInsets.all(10), + selected: item.selected, + title: Text(item.text), + onTap: () {}, + ); + }, + ); + } +}