mirror of
https://gitlab.com/openlp/openlp-mobile-remote.git
synced 2024-12-22 20:02:53 +00:00
slides list view layout
This commit is contained in:
parent
f9c97303a3
commit
714ff20f0b
14
lib/src/models/slide_item.dart
Normal file
14
lib/src/models/slide_item.dart
Normal file
@ -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<String, dynamic> json)
|
||||||
|
: tag = json['tag'],
|
||||||
|
text = json['text'],
|
||||||
|
html = json['html'],
|
||||||
|
selected = json['selected'];
|
||||||
|
}
|
@ -5,6 +5,7 @@ import 'app_theme.dart';
|
|||||||
import 'widgets/bottom_navigation_bar.dart';
|
import 'widgets/bottom_navigation_bar.dart';
|
||||||
import 'widgets/search_floating_button.dart';
|
import 'widgets/search_floating_button.dart';
|
||||||
import 'widgets/service_listview.dart';
|
import 'widgets/service_listview.dart';
|
||||||
|
import 'widgets/slides_listview.dart';
|
||||||
|
|
||||||
class OpenLPRemoteApp extends StatefulWidget {
|
class OpenLPRemoteApp extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
@ -48,7 +49,7 @@ class _OpenLPRemoteAppState extends State<OpenLPRemoteApp>
|
|||||||
controller: tabController,
|
controller: tabController,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ServiceListView(),
|
ServiceListView(),
|
||||||
Container(),
|
SlideListView(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: SearchFloatingButton(),
|
floatingActionButton: SearchFloatingButton(),
|
||||||
|
@ -13,9 +13,9 @@ class _ServiceListViewState extends State<ServiceListView> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
serviceItems = [
|
serviceItems = [
|
||||||
ServiceItem(id: '1', plugin: 'songs', selected: false, title: 'Oceans'),
|
ServiceItem(id: '1', plugin: 'songs', selected: true, title: 'Oceans'),
|
||||||
ServiceItem(
|
ServiceItem(
|
||||||
id: '2', plugin: 'bibles', selected: true, title: 'John 3:16'),
|
id: '2', plugin: 'bibles', selected: false, title: 'John 3:16'),
|
||||||
ServiceItem(
|
ServiceItem(
|
||||||
id: '3',
|
id: '3',
|
||||||
plugin: 'presentations',
|
plugin: 'presentations',
|
||||||
@ -28,6 +28,7 @@ class _ServiceListViewState extends State<ServiceListView> {
|
|||||||
ServiceItem(
|
ServiceItem(
|
||||||
id: '6', plugin: 'custom', selected: false, title: 'Custom alert'),
|
id: '6', plugin: 'custom', selected: false, title: 'Custom alert'),
|
||||||
];
|
];
|
||||||
|
// serviceItems = [];
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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<SlideListView> {
|
||||||
|
List<SlideItem> 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: () {},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user