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

dropdown menu not yet working

parent d679e89e
No related branches found
No related tags found
No related merge requests found
class Event{ class Event{
final int id; int id;
final String urn; String urn;
final String label; String label;
final String type; String type;
final String description; String description;
final String status; String status;
Event({ Event({
required this.id, required this.id,
...@@ -19,8 +19,8 @@ class Event{ ...@@ -19,8 +19,8 @@ class Event{
} }
class EventType{ class EventType{
final String name; String name;
final int id; int id;
EventType({ EventType({
required this.name, required this.name,
......
...@@ -82,26 +82,34 @@ class AddEvent extends StatelessWidget { ...@@ -82,26 +82,34 @@ class AddEvent extends StatelessWidget {
} }
class ViewEvents extends StatelessWidget { class ViewEvents extends StatelessWidget {
// Add some dummy events:
List<Event> events = [] List<Event> events = []
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) ..add(Event(
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) id: 8311,
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) urn: 'station:neumayer_iii:awi_snow_sampler_1',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) label: 'SML_KO21_SC01',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) type: 'Deployment',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) description: 'Remi tool Tag1 1 Traverse',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) status: 'PENDING'))
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) ..add(Event(
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) id: 8311,
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) urn: 'station:neumayer_iii:awi_snow_sampler_1',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) label: 'SML_KO21_SC01',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) type: 'Deployment',
..add(Event(id: 8311, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING')) description: 'Remi tool Tag1 1 Traverse',
; status: 'PENDING'))
..add(Event(
id: 8311,
urn: 'station:neumayer_iii:awi_snow_sampler_1',
label: 'SML_KO21_SC01',
type: 'Deployment',
description: 'Remi tool Tag1 1 Traverse',
status: 'PENDING'));
//for (var i = 0; i<100; i++){
// events.add(Event(id: i, urn: 'station:neumayer_iii:awi_snow_sampler_1', label: 'SML_KO21_SC01', type: 'Deployment', description: 'Remi tool Tag1 1 Traverse', status: 'PENDING'));
//}
String testString ='blabalala';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
...@@ -152,16 +160,46 @@ class ViewEvents extends StatelessWidget { ...@@ -152,16 +160,46 @@ class ViewEvents extends StatelessWidget {
), ),
], ],
rows: <DataRow>[ rows: <DataRow>[
for (var event in events) DataRow( for (var event in events)
cells: <DataCell>[ DataRow(
DataCell(Text(event.id.toString())), cells: <DataCell>[
DataCell(Text(event.urn)), DataCell(Text(event.id.toString())),
DataCell(Text(event.label)), DataCell(Text(event.urn)),
DataCell(Text(event.type)), DataCell(
DataCell(Text(event.description)), TextFormField(
DataCell(Text(event.status)), initialValue: event.label,
], onFieldSubmitted: (val) {
), event.label = val; //Update Database
},
),
),
DataCell(Text(event.type)),
DataCell(
TextFormField(
initialValue: event.description,
onFieldSubmitted: (val) {
event.description = val; //Update Database
},
),
),
DataCell(
DropdownButtonFormField(
//value: Text('abe'),
items: <DropdownMenuItem>[
DropdownMenuItem(
child: Text('abs'),
value: Text('1'),
),
DropdownMenuItem(
child: Text('abc'),
value: Text('1'),
),
],
onChanged: null,
),
),
],
),
], ],
), ),
), ),
......
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