diff --git a/rescueapp/lib/start_triage_system/after_opening_airways.dart b/rescueapp/lib/start_triage_system/after_opening_airways.dart index 55f05386b5fab9e36d39eef87dc7dbaf712102bf..fd175e21969e4be2738c932af474014a2b17cf82 100644 --- a/rescueapp/lib/start_triage_system/after_opening_airways.dart +++ b/rescueapp/lib/start_triage_system/after_opening_airways.dart @@ -1,9 +1,12 @@ import 'package:flutter/material.dart'; +import 'triage_data.dart'; import 'camera_access.dart'; class AfterOpeningAirways extends StatefulWidget { - AfterOpeningAirways({Key key, this.title}) : super(key: key); + AfterOpeningAirways(bool isSpontaneousBreathingPresent, {Key key, this.title}) + : super(key: key); + final String title; @override @@ -11,6 +14,8 @@ class AfterOpeningAirways extends StatefulWidget { } class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> { + CategoryT1A categoryT1A = new CategoryT1A(true); + CategoryT4 categoryT4 = new CategoryT4(false); @override Widget build(BuildContext context) { return Scaffold( @@ -117,11 +122,12 @@ class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> { color: Colors.blue[900])), color: Colors.blue, onPressed: () { + categoryT1A.isAfterOpeningAirways = true; Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CameraAccess()), - ); + context, + MaterialPageRoute( + builder: (context) => + CameraAccess(categoryT1A))); }))), SizedBox( height: 10, @@ -138,10 +144,11 @@ class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> { color: Colors.blue[900])), color: Colors.blue, onPressed: () { + categoryT4.isAfterOpeningAirways = false; Navigator.push( context, MaterialPageRoute( - builder: (context) => CameraAccess()), + builder: (context) => CameraAccess(categoryT4)), ); }))), SizedBox( diff --git a/rescueapp/lib/start_triage_system/ambulatory.dart b/rescueapp/lib/start_triage_system/ambulatory.dart index 29d975a482b0de6187898e6d12de403f9500e613..e561c93991b840f7096a1988ad7a3b53018d602c 100644 --- a/rescueapp/lib/start_triage_system/ambulatory.dart +++ b/rescueapp/lib/start_triage_system/ambulatory.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'triage_data.dart'; import 'camera_access.dart'; import 'spontaneous_breathing_present.dart'; @@ -11,6 +12,8 @@ class Ambulatory extends StatefulWidget { } class _AmbulatoryState extends State<Ambulatory> { + CategoryT3 get categoryT3 => new CategoryT3(); + Category get category => new Category(null, null); @override Widget build(BuildContext context) { return Scaffold( @@ -62,7 +65,8 @@ class _AmbulatoryState extends State<Ambulatory> { context, MaterialPageRoute( builder: (context) => - CameraAccess()), + CameraAccess( + categoryT3)), ); } ))), SizedBox( @@ -73,18 +77,24 @@ class _AmbulatoryState extends State<Ambulatory> { height: 50, child: Container( child: RaisedButton( - child: new Text('Nein', + child + : new Text('Nein', style: TextStyle( fontSize: 20, fontWeight: FontWeight.w600, color: Colors.blue[900])), color: Colors.blue, onPressed: () { + setState(() { + category.isAmbulatory=false; + }); + Navigator.push( context, MaterialPageRoute( builder: (context) => - SpontaneousBreathingPresent()), + SpontaneousBreathingPresent(category.isAmbulatory)), + ); }))), SizedBox( diff --git a/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart b/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart index a7df8916816bd9d2a18e8ca2a72d7e2314d2eed2..69c5f2962091d18cdf263163286ca58268d26067 100644 --- a/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart +++ b/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart @@ -1,9 +1,14 @@ import 'package:flutter/material.dart'; +import 'camera_access.dart'; +import 'triage_data.dart'; import 'circulation.dart'; class BreathingFrequencyPerMinute extends StatefulWidget { - BreathingFrequencyPerMinute({Key key, this.title}) : super(key: key); + + + BreathingFrequencyPerMinute(bool isSpontaneousBreathingPresent, {Key key, this.title}) : super(key: key); final String title; + @override _BreathingFrequencyPerMinuteState createState() => _BreathingFrequencyPerMinuteState(); @@ -11,6 +16,9 @@ class BreathingFrequencyPerMinute extends StatefulWidget { class _BreathingFrequencyPerMinuteState extends State<BreathingFrequencyPerMinute> { + Category2 get category2 => new Category2 (null, null); + CategoryT1B get categoryT1B => new CategoryT1B (false); + @override Widget build(BuildContext context) { return Scaffold( @@ -113,7 +121,13 @@ class _BreathingFrequencyPerMinuteState fontWeight: FontWeight.w600, color: Colors.blue[900])), color: Colors.blue, - onPressed: null))), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CameraAccess(categoryT1B)), + ); + }))), SizedBox( height: 10, ), @@ -129,10 +143,13 @@ class _BreathingFrequencyPerMinuteState color: Colors.blue[900])), color: Colors.blue, onPressed: () { + setState(() { + category2. isBreathingFrequencyPerMinute= false; + }); Navigator.push( context, MaterialPageRoute( - builder: (context) => CapillaryFillingTime()), + builder: (context) => CapillaryFillingTime(category2.isBreathingFrequencyPerMinute)), ); }))), SizedBox( diff --git a/rescueapp/lib/start_triage_system/camera_access.dart b/rescueapp/lib/start_triage_system/camera_access.dart index c35c347216fed764a7930d0427425f538e5f11da..2e8cd7e6f355e7fe774f5ce9f7e1bfe2428dd313 100644 --- a/rescueapp/lib/start_triage_system/camera_access.dart +++ b/rescueapp/lib/start_triage_system/camera_access.dart @@ -1,25 +1,20 @@ import 'package:flutter/material.dart'; - +import 'triage_data.dart'; import 'lock_screen.dart'; class CameraAccess extends StatefulWidget { - - CameraAccess({Key key, this.title}) : super(key: key); final String title; + final Category category; + + CameraAccess(this.category, {Key key, this.title}) : super(key: key); @override _CameraAccessState createState() => _CameraAccessState(); } class _CameraAccessState extends State<CameraAccess> { - @override - void initState() { - super.initState(); - } - @override Widget build(BuildContext context) { - return Scaffold( appBar: AppBar( title: Text("KatApp"), @@ -49,12 +44,11 @@ class _CameraAccessState extends State<CameraAccess> { height: 250, width: 250, child: RaisedButton( - child: - Icon(Icons.photo_library, color: Colors.black, size: 35), + child: Icon(Icons.photo_library, + color: Colors.black, size: 35), color: Colors.grey, onPressed: null), ), - SizedBox( height: 50, ), @@ -62,18 +56,89 @@ class _CameraAccessState extends State<CameraAccess> { height: 50, width: 200, child: RaisedButton( - child: Text('Absenden', - style: TextStyle(color: Colors.white, fontSize: 20)), - color: Colors.red, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - LockScreen()), - ); - }, - ), + child: Text('Absenden', + style: TextStyle(color: Colors.white, fontSize: 20)), + color: Colors.red, + onPressed: () { + Category category = widget.category; + if (category is CategoryT1A) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T1A", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'), + )); + } else if (category is CategoryT1B) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T1B", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'))); + } else if (category is CategoryT1C) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T1C", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'), + )); + } else if (category is CategoryT1D) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T1D", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'), + )); + } else if (category is CategoryT2) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T2", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'), + )); + } else if (category is CategoryT3) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T3", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'), + )); + } else if (category is CategoryT4) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LockScreen( + categorygroup: "Kategorie T4", + patientID: '1', + place: + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + dateTime: '15.07.2020/11:13'), + )); + } + }), ), SizedBox( height: 20, @@ -99,4 +164,4 @@ class _CameraAccessState extends State<CameraAccess> { ), ); } -} +} \ No newline at end of file diff --git a/rescueapp/lib/start_triage_system/circulation.dart b/rescueapp/lib/start_triage_system/circulation.dart index 15394d13e1f3cb1b64b56539d6112a143c4fb8d1..a6796d0bcc8a05e1267e7baeafb949e56fe4b4c1 100644 --- a/rescueapp/lib/start_triage_system/circulation.dart +++ b/rescueapp/lib/start_triage_system/circulation.dart @@ -1,14 +1,21 @@ import 'package:flutter/material.dart'; +import 'camera_access.dart'; +import 'triage_data.dart'; import 'neurology.dart'; class CapillaryFillingTime extends StatefulWidget { - CapillaryFillingTime({Key key, this.title}) : super(key: key); + CapillaryFillingTime(bool isBreathingFrequencyPerMinute, {Key key, this.title}) : super(key: key); final String title; + @override _CapillaryFillingTimeState createState() => _CapillaryFillingTimeState(); } class _CapillaryFillingTimeState extends State<CapillaryFillingTime> { + Category2 get category2 => new Category2 (false, null); + CategoryT1C get categoryT1C => new CategoryT1C (); + + @override Widget build(BuildContext context) { return Scaffold( @@ -130,7 +137,13 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> { fontWeight: FontWeight.w600, color: Colors.blue[900])), color: Colors.blue, - onPressed: null))), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CameraAccess(categoryT1C)), + ); + }))), SizedBox( height: 10, ), @@ -146,10 +159,13 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> { color: Colors.blue[900])), color: Colors.blue, onPressed: () { + setState(() { + category2.isCirculation = false; + }); Navigator.push( context, MaterialPageRoute( - builder: (context) => Neurology()), + builder: (context) => Neurology(category2.isCirculation )), ); }))), SizedBox( diff --git a/rescueapp/lib/start_triage_system/lock_screen.dart b/rescueapp/lib/start_triage_system/lock_screen.dart index 0d6c18afc24b0d4ccbeb4d99b2a8f61e5133b124..ed10fcb1c99d28827ef2343fc7044d2e0b07de96 100644 --- a/rescueapp/lib/start_triage_system/lock_screen.dart +++ b/rescueapp/lib/start_triage_system/lock_screen.dart @@ -1,17 +1,26 @@ import 'package:flutter/material.dart'; + class LockScreen extends StatefulWidget { - LockScreen({Key key, this.title}) : super(key: key); + + LockScreen( {Key key, this.title, @required this.categorygroup, @required this.patientID,@required this.place,@required this.dateTime, }) : super(key: key); final String title; + final String categorygroup; + final String patientID; + final String place; + final String dateTime; + + @override _LockScreenState createState() => _LockScreenState(); } class _LockScreenState extends State<LockScreen> { + final Color myColor = Colors.white; @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.green, + backgroundColor: Colors.green, appBar: AppBar( title: Text('KatApp'), ), @@ -22,8 +31,9 @@ class _LockScreenState extends State<LockScreen> { SizedBox( height: 200, child: Container( + alignment: Alignment.center, - child: Text('Kategorie T3', + child: Text(widget.categorygroup, style: TextStyle( fontSize: 50, fontWeight: FontWeight.w900, @@ -45,7 +55,7 @@ class _LockScreenState extends State<LockScreen> { height: 40, child: Container( alignment: Alignment.centerLeft, - child: Text('1', + child: Text(widget.patientID, style: TextStyle( fontSize: 20, color: Colors.blue[900], @@ -66,7 +76,7 @@ class _LockScreenState extends State<LockScreen> { height: 90, child: Container( alignment: Alignment.centerLeft, - child: Text('Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + child: Text(widget.place, style: TextStyle( fontSize: 20, color: Colors.blue[900], @@ -88,7 +98,7 @@ class _LockScreenState extends State<LockScreen> { height: 50, child: Container( alignment: Alignment.centerLeft, - child: Text('15.07.2020/11:13', + child: Text(widget.dateTime, style: TextStyle( fontSize: 20, color: Colors.blue[900], diff --git a/rescueapp/lib/start_triage_system/neurology.dart b/rescueapp/lib/start_triage_system/neurology.dart index 5a4aa1623f6c859db1083c05385f7fd2fbf1763d..1f08fcd6a7f7389993ca7b8ac7c0a2fcab7bd2ed 100644 --- a/rescueapp/lib/start_triage_system/neurology.dart +++ b/rescueapp/lib/start_triage_system/neurology.dart @@ -1,13 +1,18 @@ import 'package:flutter/material.dart'; +import 'camera_access.dart'; +import 'triage_data.dart'; class Neurology extends StatefulWidget { - Neurology({Key key, this.title}) : super(key: key); + Neurology(bool isCirculation, {Key key, this.title}) : super(key: key); final String title; + @override _NeurologyState createState() => _NeurologyState(); } class _NeurologyState extends State<Neurology> { + CategoryT2 get categoryT2 => new CategoryT2 (false); + CategoryT1D get categoryT1D => new CategoryT1D (false); @override Widget build(BuildContext context) { return Scaffold( @@ -154,7 +159,16 @@ class _NeurologyState extends State<Neurology> { fontWeight: FontWeight.w600, color: Colors.blue[900])), color: Colors.blue, - onPressed: null))), + onPressed: () { + setState(() { + categoryT1D.isNeurology = true; + }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CameraAccess(categoryT2)), + ); + }))), SizedBox( height: 10, ), @@ -169,7 +183,16 @@ class _NeurologyState extends State<Neurology> { fontWeight: FontWeight.w600, color: Colors.blue[900])), color: Colors.blue, - onPressed: null))), + onPressed: () { + setState(() { + categoryT1D.isNeurology = false; + }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CameraAccess(categoryT1D)), + ); + }))), SizedBox( height: 20, ), diff --git a/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart b/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart index 75b3fe827f7b16d98f1ad325f908b8bca849fc32..7d3afbe0f1dabf6d879fe0e11b6aaa006d76a0e2 100644 --- a/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart +++ b/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart @@ -1,10 +1,17 @@ import 'package:flutter/material.dart'; +import 'triage_data.dart'; + import 'after_opening_airways.dart'; import 'breathing_frequency_per_minute.dart'; class SpontaneousBreathingPresent extends StatefulWidget { - SpontaneousBreathingPresent({Key key, this.title}) : super(key: key); + SpontaneousBreathingPresent( + bool isAmbulatory, { + Key key, + this.title, + }) : super(key: key); final String title; + @override _SpontaneousBreathingPresentState createState() => _SpontaneousBreathingPresentState(); @@ -12,6 +19,13 @@ class SpontaneousBreathingPresent extends StatefulWidget { class _SpontaneousBreathingPresentState extends State<SpontaneousBreathingPresent> { + Category get category => new Category(false, null); + + @override + void initState() { + super.initState(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -96,12 +110,17 @@ class _SpontaneousBreathingPresentState color: Colors.blue[900])), color: Colors.blue, onPressed: () { + setState(() { + category.isSpontaneousBreathingPresent = true; + }); Navigator.push( context, MaterialPageRoute( - builder: (context) => BreathingFrequencyPerMinute()), + builder: (context) => + BreathingFrequencyPerMinute(category + .isSpontaneousBreathingPresent = true)), ); - } ))), + }))), SizedBox( height: 10, ), @@ -120,7 +139,10 @@ class _SpontaneousBreathingPresentState Navigator.push( context, MaterialPageRoute( - builder: (context) => AfterOpeningAirways()), + builder: (context) => AfterOpeningAirways( + category + .isSpontaneousBreathingPresent = false)), + ); }))), SizedBox( diff --git a/rescueapp/lib/start_triage_system/triage_data.dart b/rescueapp/lib/start_triage_system/triage_data.dart new file mode 100644 index 0000000000000000000000000000000000000000..77c135e3b9ed85b05b8e0ddc6543fa293ce28661 --- /dev/null +++ b/rescueapp/lib/start_triage_system/triage_data.dart @@ -0,0 +1,56 @@ +// Superclasses ---------------------------------------------------------------- + +class Category { + bool isAmbulatory; + bool isSpontaneousBreathingPresent; + + Category(this.isAmbulatory, this.isSpontaneousBreathingPresent); +} + +class Category2 extends Category { + bool isBreathingFrequencyPerMinute; + bool isCirculation; + + Category2(this.isBreathingFrequencyPerMinute, this.isCirculation) + : super(false, true); +} + +// Subclasses ------------------------------------------------------------------ + +class CategoryT1A extends Category { + bool isAfterOpeningAirways = true; + + CategoryT1A(this.isAfterOpeningAirways) : super(false, false); +} + +class CategoryT1B extends Category { + bool isBreathingFrequencyPerMinute = true; + + CategoryT1B( + this.isBreathingFrequencyPerMinute, + ) : super(false, true); +} + +class CategoryT1C extends Category2 { + CategoryT1C() : super(false, true); +} + +class CategoryT1D extends Category2 { + bool isNeurology = false; + CategoryT1D(this.isNeurology) : super(false, false); +} + +class CategoryT2 extends Category2 { + bool isNeurology = true; + CategoryT2(this.isNeurology) : super(false, false); +} + +class CategoryT3 extends Category { + CategoryT3() : super(true, null); +} + +class CategoryT4 extends Category { + bool isAfterOpeningAirways = false; + + CategoryT4(this.isAfterOpeningAirways) : super(false, false); +}