diff --git a/lib/addevent.dart b/lib/addevent.dart index 66fe92b2209c332fa0cdabf4336b03137d785047..6977889120c538b11a787dd6a430f045dece3127 100644 --- a/lib/addevent.dart +++ b/lib/addevent.dart @@ -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: [