diff --git a/lib/data_model.dart b/lib/data_model.dart new file mode 100644 index 0000000000000000000000000000000000000000..9d7d211be989f282d2510d27a6e314537a77d6c4 --- /dev/null +++ b/lib/data_model.dart @@ -0,0 +1,29 @@ + + +class Event{ + final int id; + final String urn; + final String label; + final String type; + final String description; + final String status; + + Event({ + required this.id, + required this.urn, + required this.label, + required this.type, + required this.description, + required this.status + }); +} + +class EventType{ + final String name; + final int id; + + EventType({ + required this.name, + required this.id +}); +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index c9b0d475b4ce4b8c69d2cf0e5e7ec021c5e22338..4b08806c0a149d29cd3a1bb54cc2c4184d88148b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'data_model.dart'; void main() { runApp(MaterialApp( @@ -81,85 +82,88 @@ class AddEvent extends StatelessWidget { } class ViewEvents extends StatelessWidget { + 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(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(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(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(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(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(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(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(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(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(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(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(id: 8311, 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 Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("View Added Events"), ), - body: InteractiveViewer( - minScale: 0.1, - child: DataTable( - columns: const <DataColumn>[ - DataColumn( - label: Text( - 'URN', - style: TextStyle(fontStyle: FontStyle.italic), + body: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: DataTable( + columns: const <DataColumn>[ + DataColumn( + label: Text( + 'Id', + style: TextStyle(fontStyle: FontStyle.italic), + ), ), - ), - DataColumn( - label: Text( - 'Label', - style: TextStyle(fontStyle: FontStyle.italic), + DataColumn( + label: Text( + 'URN', + style: TextStyle(fontStyle: FontStyle.italic), + ), ), - ), - DataColumn( - label: Text( - 'Type', - style: TextStyle(fontStyle: FontStyle.italic), + DataColumn( + label: Text( + 'Label', + style: TextStyle(fontStyle: FontStyle.italic), + ), ), - ), - DataColumn( - label: Text( - 'Description', - style: TextStyle(fontStyle: FontStyle.italic), + DataColumn( + label: Text( + 'Type', + style: TextStyle(fontStyle: FontStyle.italic), + ), ), - ), - DataColumn( - label: Text( - 'Status', - style: TextStyle(fontStyle: FontStyle.italic), + DataColumn( + label: Text( + 'Description', + style: TextStyle(fontStyle: FontStyle.italic), + ), ), - ), - ], - rows: const <DataRow>[ - DataRow( - cells: <DataCell>[ - DataCell(Text('station:neumayer_iii:awi_snow_sampler_1')), - DataCell(Text('SML_KO21_SC01')), - DataCell(Text('Deployment')), - DataCell(Text('Remi tool Tag1 1 Traverse')), - DataCell(Text('PENDING')), - ], - ), - DataRow( - cells: <DataCell>[ - DataCell(Text('radar_system:awi_pres_1')), - DataCell(Text('MP_A_01+100m')), - DataCell(Text('Information')), - DataCell(Text('100 m NNW of MP_A_01 3 metal bars 2 m wide 20 cm apart 30 cm deep')), - DataCell(Text('EXPORTED')), - ], - ), - DataRow( - cells: <DataCell>[ - DataCell(Text('radar_system:awi_pres_1')), - DataCell(Text('MP_A_01')), - DataCell(Text('Deployment')), - DataCell(Text('position 2,35 m south of point midway TX RX')), - DataCell(Text('EXPORTED')), - ], - ), - DataRow( - cells: <DataCell>[ - DataCell(Text('station:neumayer_iii:level_measure_1')), - DataCell(Text('1')), - DataCell(Text('Information')), - DataCell(Text('Test measurements of snow deposition in cm follow')), - DataCell(Text('PENDING')), - ], - ), - ], + DataColumn( + label: Text( + 'Status', + style: TextStyle(fontStyle: FontStyle.italic), + ), + ), + ], + rows: <DataRow>[ + for (var event in events) DataRow( + cells: <DataCell>[ + DataCell(Text(event.id.toString())), + DataCell(Text(event.urn)), + DataCell(Text(event.label)), + DataCell(Text(event.type)), + DataCell(Text(event.description)), + DataCell(Text(event.status)), + ], + ), + ], + ), ), ), );