Skip to content
Snippets Groups Projects
Commit 450cf339 authored by Maximilian Betz's avatar Maximilian Betz
Browse files

some more ui improvements

parent 2c04e441
No related branches found
No related tags found
No related merge requests found
......@@ -95,9 +95,7 @@ class _AddEventPageState extends State<AddEvent> {
}catch(e){
debugPrint('Canceling location stream failed');
}
super.dispose();
//TODO: only if initialized positionStream.cancel();
}
void _storeCurrentEvent() {
......@@ -120,7 +118,6 @@ class _AddEventPageState extends State<AddEvent> {
}
//TODO: add field validators for freetext fields. Check allowed characters in sensor.awi.de
@override
Widget build(BuildContext context) {
/* Get singletons to access relevant data here.*/
......@@ -128,7 +125,6 @@ class _AddEventPageState extends State<AddEvent> {
final ConfigurationStoreInstance configuration = ConfigurationStoreInstance();
String gnssStatusText = "";
if (true == syncGNSSData){
// Update current event coordinates from GNSS stream
eventsStore.currentEvent.latitude = lat;
......@@ -153,14 +149,16 @@ class _AddEventPageState extends State<AddEvent> {
if (configuration.initialized == true) {
return Scaffold(
appBar: AppBar(title: const Text("Add Event")),
body:
body: SingleChildScrollView( child:
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const SizedBox(height: 10.0),
TextFormField(
initialValue: eventsStore.currentEvent.label,
autovalidateMode: AutovalidateMode.onUserInteraction,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Label',
errorText: 'Only: a-z , A-Z , _ , 0-9 , ,(Comma) , ( , ) , + , - , . , :'
),
......@@ -177,10 +175,12 @@ class _AddEventPageState extends State<AddEvent> {
}
},
),
const SizedBox(height: 10.0),
DropdownButtonFormField(
value: eventsStore.currentEvent.type,
isExpanded: true,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Event Type',
),
items:
......@@ -194,10 +194,12 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore.currentEvent.type = value.toString();
}
),
const SizedBox(height: 10.0),
DropdownButtonFormField(
value: eventsStore.currentEvent.urn,
isExpanded: true,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'URN',
),
items:
......@@ -213,18 +215,22 @@ class _AddEventPageState extends State<AddEvent> {
configuration.getDeviceIdFromUrn(value.toString());
}
),
const SizedBox(height: 10.0),
TextFormField(
minLines: 3,
maxLines: 3,
initialValue: eventsStore.currentEvent.description,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Description'
),
onChanged: (value) {
eventsStore.currentEvent.description = value;
},
),
const SizedBox(height: 10.0),
Row(
mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Flexible(child:
TextFormField(
......@@ -264,6 +270,7 @@ class _AddEventPageState extends State<AddEvent> {
),
]
),
const SizedBox(height: 10.0),
TextFormField(
readOnly: false,
enabled: !syncGNSSData,
......@@ -277,6 +284,7 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore.currentEvent.latitude = value;
}
),
const SizedBox(height: 10.0),
TextFormField(
readOnly: false,
enabled: !syncGNSSData,
......@@ -291,6 +299,7 @@ class _AddEventPageState extends State<AddEvent> {
eventsStore.currentEvent.longitude = value;
}
),
const SizedBox(height: 10.0),
TextFormField(
readOnly: false,
enabled: !syncGNSSData,
......@@ -305,6 +314,7 @@ class _AddEventPageState extends State<AddEvent> {
}
),
]),
),
bottomNavigationBar: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment