settings screen layout

This commit is contained in:
Daniel Borges 2019-08-07 15:55:02 -03:00
parent dac62f2c35
commit 074e61fab8
2 changed files with 59 additions and 9 deletions

View File

@ -1,4 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class Settings extends StatefulWidget { class Settings extends StatefulWidget {
@override @override
@ -35,12 +37,22 @@ class _SettingState extends State<Settings> {
ListTile( ListTile(
title: Text('Server IP'), title: Text('Server IP'),
subtitle: Text(serverIp), subtitle: Text(serverIp),
onTap: () {}, onTap: () {
showDialog<String>(
context: context,
builder: (context) => _InputDialog('Type the IP'),
);
},
), ),
ListTile( ListTile(
title: Text('Server port'), title: Text('Server port'),
subtitle: Text('$serverPort'), subtitle: Text('$serverPort'),
onTap: () {}, onTap: () {
showDialog<String>(
context: context,
builder: (context) => _InputDialog('Type the port'),
);
},
), ),
CheckboxListTile( CheckboxListTile(
title: Text('Use HTTPS'), title: Text('Use HTTPS'),
@ -65,21 +77,62 @@ class _SettingState extends State<Settings> {
enabled: needsAuth, enabled: needsAuth,
title: Text('User ID'), title: Text('User ID'),
subtitle: Text(userId), subtitle: Text(userId),
onTap: () {}, onTap: () {
showDialog<String>(
context: context,
builder: (context) => _InputDialog('Type the username'),
);
},
), ),
ListTile( ListTile(
enabled: needsAuth, enabled: needsAuth,
title: Text('User password'), title: Text('User password'),
subtitle: Text(userPassword), subtitle: Text(userPassword),
onTap: () {}, onTap: () {
showDialog<String>(
context: context,
builder: (context) => _InputDialog('Type the password'),
);
},
), ),
Divider(), Divider(),
ListTile( ListTile(
title: Text('About OpenLP'), title: Text('About OpenLP'),
onTap: () {}, onTap: () {
launch('https://openlp.org/');
},
), ),
], ],
), ),
); );
} }
} }
class _InputDialog extends StatelessWidget {
final String title;
_InputDialog(this.title);
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(this.title),
contentPadding: EdgeInsets.all(15),
content: TextField(autofocus: true),
actions: <Widget>[
FlatButton(
child: Text('CANCEL'),
onPressed: () {
Navigator.pop(context);
},
),
FlatButton(
child: Text('OK'),
onPressed: () {
Navigator.pop(context, '');
},
),
],
);
}
}

View File

@ -19,10 +19,7 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
url_launcher: ^5.1.2
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: