Newer
Older
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'datamodel.dart';
class AddEvent extends StatelessWidget {
@override
Widget build(BuildContext context) {
/* Get singletons to access relevant data here.*/
final EventTypeStoreInstance eventTypes = EventTypeStoreInstance();
final EventCurrentInstance currentEvent = EventCurrentInstance();
return Scaffold(
appBar: AppBar(title: const Text("Add Event")),
body:
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
TextFormField(
decoration: const InputDecoration(
labelText: 'Label'
),
),
DropdownButtonFormField(
decoration: const InputDecoration(
labelText: 'Event Type',
),
items:
eventTypes.store.map((EventType event) {
return DropdownMenuItem(
value: event.name,
child: Text(event.name),
);
}).toList(),
currentEvent.store.type = value.toString();
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
}
),
DropdownButtonFormField(
decoration: const InputDecoration(
labelText: 'URN',
),
items: [
DropdownMenuItem(
child: Text('ADCP'),
value: 'ADCP',
),
DropdownMenuItem(
child: Text('EM712'),
value: 'EM712',
)
],
onChanged: (value) {
}
),
TextFormField(
decoration: const InputDecoration(
labelText: 'Description'
),
),
TextFormField(
decoration: const InputDecoration(
labelText: 'Latitude'
),
),
TextFormField(
decoration: const InputDecoration(
labelText: 'Longitude'
),
),
TextFormField(
decoration: const InputDecoration(
labelText: 'Elevation'
),
)
]),
bottomNavigationBar: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: const [
FloatingActionButton(
heroTag: null,
onPressed: null,
tooltip: 'Get GNSS from device',
child: Icon(Icons.my_location),
),
SizedBox(width: 50),
FloatingActionButton(
heroTag: null,
onPressed: null,
tooltip: 'Add Event',
child: Icon(Icons.add),
),
SizedBox(width: 20),
],
),
);
}
}