From a7614f5724ae1e0e99a356ec71e63ebcd51c1807 Mon Sep 17 00:00:00 2001
From: Trang Nguyen <thi_huyen_trang.nguyen@student.reutlingen-university.de>
Date: Mon, 18 Jan 2021 00:06:50 +0100
Subject: [PATCH] newBranchTEST: just for test
---
rescueapp/lib/main.dart | 40 +++++++-----
.../after_opening_airways.dart | 34 +++++++---
.../lib/start_triage_system/ambulatory.dart | 55 ++++++++++++----
.../breathing_frequency_per_minute.dart | 36 +++++++++--
.../start_triage_system/camera_access.dart | 48 +++++++-------
.../lib/start_triage_system/circulation.dart | 37 ++++++++---
.../lib/start_triage_system/lock_screen.dart | 25 +++++---
.../lib/start_triage_system/neurology.dart | 47 +++++++++++---
.../spontaneous_breathing_present.dart | 63 +++++++++++++++----
9 files changed, 289 insertions(+), 96 deletions(-)
diff --git a/rescueapp/lib/main.dart b/rescueapp/lib/main.dart
index 9b73427..9133bc6 100644
--- a/rescueapp/lib/main.dart
+++ b/rescueapp/lib/main.dart
@@ -1,11 +1,15 @@
+import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'start_triage_system/ambulatory.dart';
+import 'package:rescueapp/start_triage_system/ambulatory.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
+
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
+ // This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
@@ -13,7 +17,9 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.blue,
),
- home: MyHomePage());
+ home: MyHomePage()
+ //home: MyHomePage(title: 'KatApp Home Page'),
+ );
}
}
@@ -22,7 +28,7 @@ class MyHomePage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
- title: Text('KatApp Homepage'),
+ title: Text('KatApp Hompage'),
),
body: Center(
child: Column(
@@ -35,19 +41,19 @@ class MyHomePage extends StatelessWidget {
height: 50,
child: Container(
child: RaisedButton(
- child: Text('ÜBUNG',
- style: TextStyle(
- fontSize: 22,
- color: Colors.white,
- )),
- color: Colors.green,
- onPressed: () {
- Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => Ambulatory()),
- );
- },
- ))),
+ child: Text('ÜBUNG',
+ style: TextStyle(
+ fontSize: 22,
+ color: Colors.white,
+ )),
+ color: Colors.green,
+ onPressed: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(builder: (context) => Ambulatory(new StartTriage())),
+ );
+ },
+ ))),
SizedBox(
height: 20,
),
@@ -59,7 +65,7 @@ class MyHomePage extends StatelessWidget {
child: Text('REAL',
style: TextStyle(fontSize: 22, color: Colors.white)),
color: Colors.red,
- onPressed: null )),
+ onPressed: null)),
),
],
),
diff --git a/rescueapp/lib/start_triage_system/after_opening_airways.dart b/rescueapp/lib/start_triage_system/after_opening_airways.dart
index 55f0538..456a72d 100644
--- a/rescueapp/lib/start_triage_system/after_opening_airways.dart
+++ b/rescueapp/lib/start_triage_system/after_opening_airways.dart
@@ -1,16 +1,25 @@
+
import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
import 'camera_access.dart';
class AfterOpeningAirways extends StatefulWidget {
- AfterOpeningAirways({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+ AfterOpeningAirways(StartTriage startTriage, {Key key, this.title}): super(key: key){
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+
+
+ }
@override
_AfterOpeningAirwaysState createState() => _AfterOpeningAirwaysState();
}
class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> {
+
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -34,7 +43,7 @@ class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Nein',
+ child: new Text (widget.startTriage.getIsAmbulatory() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -56,7 +65,7 @@ class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Nein',
+ child: new Text (widget.startTriage.getIsSpontaneousBreathingPresent() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -117,11 +126,16 @@ class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> {
color: Colors.blue[900])),
color: Colors.blue,
onPressed: () {
+ setState(() {
+ widget.startTriage
+ .setIsAfterOpeningAirways(true);
+ });
Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => CameraAccess()),
- );
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ CameraAccess(
+ widget.startTriage)));
}))),
SizedBox(
height: 10,
@@ -138,10 +152,14 @@ class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> {
color: Colors.blue[900])),
color: Colors.blue,
onPressed: () {
+ setState(() {
+ widget.startTriage.setIsAfterOpeningAirways(false);
+ });
Navigator.push(
context,
MaterialPageRoute(
- builder: (context) => CameraAccess()),
+ builder: (context) => CameraAccess(widget.startTriage))
+ // widget.startTriage.isAfterOpeningAirways)),
);
}))),
SizedBox(
diff --git a/rescueapp/lib/start_triage_system/ambulatory.dart b/rescueapp/lib/start_triage_system/ambulatory.dart
index 29d975a..05474da 100644
--- a/rescueapp/lib/start_triage_system/ambulatory.dart
+++ b/rescueapp/lib/start_triage_system/ambulatory.dart
@@ -1,16 +1,27 @@
+import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
import 'camera_access.dart';
import 'spontaneous_breathing_present.dart';
class Ambulatory extends StatefulWidget {
- Ambulatory({Key key, this.title}) : super(key: key);
+
final String title;
+ StartTriage startTriage;
+ TriageCategory triageCategory;
+ Ambulatory(StartTriage startTriage, {Key key, this.title, this.triageCategory}) : super(key: key) {
+ startTriage.setState(this);
+ this.startTriage = startTriage;
- @override
+
+ }
+ @override
_AmbulatoryState createState() => _AmbulatoryState();
}
class _AmbulatoryState extends State<Ambulatory> {
+
+
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -51,19 +62,31 @@ class _AmbulatoryState extends State<Ambulatory> {
height: 50,
child: Container(
child: RaisedButton(
- child: new Text('Ja',
+
+ child: new Text( 'Ja',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.blue[900])),
- color: Colors.blue,
+ color: Colors.blue ,
onPressed: () {
- Navigator.push(
+ setState(() {
+ widget.startTriage.setIsAmbulatory(true);
+ print('test2');
+
+ print(widget.startTriage.getIsAmbulatory());
+ //_isAmbulatory = widget.startTriage.isAmbulatory = true;
+ // widget.startTriage.setIsAmbulatory(true);
+ });
+ Navigator.push(
context,
MaterialPageRoute(
- builder: (context) =>
- CameraAccess()),
- );
+ builder: (context) => CameraAccess(widget.startTriage),
+
+ ),
+ ); print('test3');
+ print(widget.startTriage.getIsAmbulatory());
+ //CameraAccess(widget.startTriage)
} ))),
SizedBox(
height: 10,
@@ -73,20 +96,28 @@ 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(() {
+ widget.startTriage.setIsAmbulatory(false);
+ });
+
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
- SpontaneousBreathingPresent()),
- );
- }))),
+ SpontaneousBreathingPresent(widget.startTriage),
+ ),
+ ); print('test4');
+ print(widget.startTriage.getIsAmbulatory());
+
+ }))),
SizedBox(
height: 100,
),
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 a7df891..83d011a 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,18 @@
+
import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
+import 'camera_access.dart';
+
import 'circulation.dart';
class BreathingFrequencyPerMinute extends StatefulWidget {
- BreathingFrequencyPerMinute({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+ BreathingFrequencyPerMinute(StartTriage startTriage, {Key key, this.title}) : super(key: key){
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+ }
+
@override
_BreathingFrequencyPerMinuteState createState() =>
_BreathingFrequencyPerMinuteState();
@@ -34,7 +43,7 @@ class _BreathingFrequencyPerMinuteState
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Nein',
+ child: new Text (widget.startTriage.getIsAmbulatory() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -53,7 +62,7 @@ class _BreathingFrequencyPerMinuteState
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Ja',
+ child: new Text (widget.startTriage.getIsSpontaneousBreathingPresent() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -113,7 +122,19 @@ class _BreathingFrequencyPerMinuteState
fontWeight: FontWeight.w600,
color: Colors.blue[900])),
color: Colors.blue,
- onPressed: null))),
+ onPressed: () {
+ setState(() {
+ widget.startTriage.setBreathingFrequencyPerMinute(true);
+
+
+ });
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => CameraAccess(widget.startTriage))
+ //widget.startTriage.isBreathingFrequencyPerMinute)),
+ );
+ }))),
SizedBox(
height: 10,
),
@@ -129,11 +150,16 @@ class _BreathingFrequencyPerMinuteState
color: Colors.blue[900])),
color: Colors.blue,
onPressed: () {
+ setState(() {
+ widget.startTriage.setBreathingFrequencyPerMinute(false);
+ });
Navigator.push(
context,
MaterialPageRoute(
- builder: (context) => CapillaryFillingTime()),
+ builder: (context) => CapillaryFillingTime(widget.startTriage)),
+
);
+
}))),
SizedBox(
height: 70,
diff --git a/rescueapp/lib/start_triage_system/camera_access.dart b/rescueapp/lib/start_triage_system/camera_access.dart
index c35c347..bc47ac7 100644
--- a/rescueapp/lib/start_triage_system/camera_access.dart
+++ b/rescueapp/lib/start_triage_system/camera_access.dart
@@ -1,25 +1,31 @@
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
import 'lock_screen.dart';
class CameraAccess extends StatefulWidget {
-
- CameraAccess({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+ TriageCategory triageCategory;
+
+ CameraAccess(StartTriage startTriage,
+ {Key key, this.title, }) : super(key: key){
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+ }
@override
_CameraAccessState createState() => _CameraAccessState();
}
class _CameraAccessState extends State<CameraAccess> {
- @override
- void initState() {
- super.initState();
- }
+
@override
Widget build(BuildContext context) {
+ body(){
+ }
return Scaffold(
appBar: AppBar(
title: Text("KatApp"),
@@ -49,12 +55,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 +67,17 @@ 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: () {
+ widget.startTriage.getTriageCategory();
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => LockScreen(widget.startTriage)),
+ );
+ }),
),
SizedBox(
height: 20,
diff --git a/rescueapp/lib/start_triage_system/circulation.dart b/rescueapp/lib/start_triage_system/circulation.dart
index 15394d1..c76cb86 100644
--- a/rescueapp/lib/start_triage_system/circulation.dart
+++ b/rescueapp/lib/start_triage_system/circulation.dart
@@ -1,14 +1,22 @@
import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
+import 'camera_access.dart';
import 'neurology.dart';
class CapillaryFillingTime extends StatefulWidget {
- CapillaryFillingTime({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+ CapillaryFillingTime(StartTriage startTriage, {Key key, this.title}) : super(key: key){
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+ }
+
@override
_CapillaryFillingTimeState createState() => _CapillaryFillingTimeState();
}
class _CapillaryFillingTimeState extends State<CapillaryFillingTime> {
+
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -32,7 +40,7 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Nein',
+ child: new Text (widget.startTriage.getIsAmbulatory() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -51,7 +59,7 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Ja',
+ child:new Text (widget.startTriage.getIsSpontaneousBreathingPresent() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -70,14 +78,14 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('≤ 30',
+ child: new Text (widget.startTriage.getIsBreathingFrequencyPerMinute() ? '> 30': '≤ 30',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
backgroundColor: Colors.grey[500])),
)),
SizedBox(
- height: 150,
+ height: 70,
),
SizedBox(
height: 50,
@@ -130,7 +138,17 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> {
fontWeight: FontWeight.w600,
color: Colors.blue[900])),
color: Colors.blue,
- onPressed: null))),
+ onPressed: () {
+ setState(() {
+ widget.startTriage.setIsCirculation(true);
+ });
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => CameraAccess(widget.startTriage))
+ //widget.startTriage.isCirculation)),
+ );
+ }))),
SizedBox(
height: 10,
),
@@ -146,10 +164,15 @@ class _CapillaryFillingTimeState extends State<CapillaryFillingTime> {
color: Colors.blue[900])),
color: Colors.blue,
onPressed: () {
+ setState(() {
+ widget.startTriage.setIsCirculation(false);
+ });
Navigator.push(
context,
MaterialPageRoute(
- builder: (context) => Neurology()),
+ builder: (context) => Neurology(
+ widget.startTriage
+ )),
);
}))),
SizedBox(
diff --git a/rescueapp/lib/start_triage_system/lock_screen.dart b/rescueapp/lib/start_triage_system/lock_screen.dart
index 0d6c18a..6b7c960 100644
--- a/rescueapp/lib/start_triage_system/lock_screen.dart
+++ b/rescueapp/lib/start_triage_system/lock_screen.dart
@@ -1,17 +1,28 @@
+
import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
+
class LockScreen extends StatefulWidget {
- LockScreen({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+ TriageCategory triageCategory;
+
+ LockScreen(StartTriage startTriage, {Key key, this.title}) : super(key: key){
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+ }
+
@override
_LockScreenState createState() => _LockScreenState();
}
class _LockScreenState extends State<LockScreen> {
+
@override
Widget build(BuildContext context) {
return Scaffold(
- backgroundColor: Colors.green,
+ backgroundColor: widget.startTriage.getTriageCategory().getColor(),
appBar: AppBar(
title: Text('KatApp'),
),
@@ -23,11 +34,11 @@ class _LockScreenState extends State<LockScreen> {
height: 200,
child: Container(
alignment: Alignment.center,
- child: Text('Kategorie T3',
+ child: Text(widget.startTriage.getTriageCategory().getCategory(),
style: TextStyle(
fontSize: 50,
fontWeight: FontWeight.w900,
- color: Colors.blue[1000])),
+ color: Colors.white)),
)),
SizedBox(
width: 250,
@@ -45,7 +56,7 @@ class _LockScreenState extends State<LockScreen> {
height: 40,
child: Container(
alignment: Alignment.centerLeft,
- child: Text('1',
+ child: Text('',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -66,7 +77,7 @@ class _LockScreenState extends State<LockScreen> {
height: 90,
child: Container(
alignment: Alignment.centerLeft,
- child: Text('Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen',
+ child: Text('',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -88,7 +99,7 @@ class _LockScreenState extends State<LockScreen> {
height: 50,
child: Container(
alignment: Alignment.centerLeft,
- child: Text('15.07.2020/11:13',
+ child: Text('',
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 5a4aa16..bc5e53c 100644
--- a/rescueapp/lib/start_triage_system/neurology.dart
+++ b/rescueapp/lib/start_triage_system/neurology.dart
@@ -1,13 +1,24 @@
+
import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
+import 'camera_access.dart';
class Neurology extends StatefulWidget {
- Neurology({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+
+ Neurology(StartTriage startTriage,{Key key, this.title}) : super(key: key){
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+ }
+
@override
_NeurologyState createState() => _NeurologyState();
}
class _NeurologyState extends State<Neurology> {
+
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -31,7 +42,7 @@ class _NeurologyState extends State<Neurology> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Nein',
+ child: new Text (widget.startTriage.getIsAmbulatory() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -50,7 +61,7 @@ class _NeurologyState extends State<Neurology> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Ja',
+ child: new Text (widget.startTriage.getIsSpontaneousBreathingPresent() ? 'Ja': 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -69,7 +80,7 @@ class _NeurologyState extends State<Neurology> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('≤ 30',
+ child: new Text (widget.startTriage.getIsBreathingFrequencyPerMinute() ? '>30': '≤ 30',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -91,7 +102,7 @@ class _NeurologyState extends State<Neurology> {
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Kapilläre Füllungszeit <= 2s ',
+ child: new Text (widget.startTriage.getIsCirculation() ? 'Kapilläre Füllungszeit > 2s': 'Kapilläre Füllungszeit ≤ 2s',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
@@ -154,7 +165,18 @@ class _NeurologyState extends State<Neurology> {
fontWeight: FontWeight.w600,
color: Colors.blue[900])),
color: Colors.blue,
- onPressed: null))),
+ onPressed: () {
+ setState(() {
+ widget.startTriage.setIsNeurology(true);
+ });
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ CameraAccess(widget.startTriage))
+ //widget.startTriage.isNeurology)),
+ );
+ }))),
SizedBox(
height: 10,
),
@@ -169,7 +191,18 @@ class _NeurologyState extends State<Neurology> {
fontWeight: FontWeight.w600,
color: Colors.blue[900])),
color: Colors.blue,
- onPressed: null))),
+ onPressed: () {
+ setState(() {
+ widget.startTriage.setIsNeurology(false);
+ });
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ CameraAccess(widget.startTriage))
+ //widget.startTriage.isNeurology)),
+ );
+ }))),
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 75b3fe8..7f48f35 100644
--- a/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart
+++ b/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart
@@ -1,10 +1,21 @@
import 'package:flutter/material.dart';
+import 'package:rescueapp/start_triage_system/startTriage.dart';
+
import 'after_opening_airways.dart';
import 'breathing_frequency_per_minute.dart';
class SpontaneousBreathingPresent extends StatefulWidget {
- SpontaneousBreathingPresent({Key key, this.title}) : super(key: key);
final String title;
+ StartTriage startTriage;
+
+ SpontaneousBreathingPresent(
+ StartTriage startTriage, {
+ Key key,
+ this.title,
+ }) : super(key: key) {
+ startTriage.setState(this);
+ this.startTriage = startTriage;
+ }
@override
_SpontaneousBreathingPresentState createState() =>
_SpontaneousBreathingPresentState();
@@ -12,6 +23,11 @@ class SpontaneousBreathingPresent extends StatefulWidget {
class _SpontaneousBreathingPresentState
extends State<SpontaneousBreathingPresent> {
+ @override
+ void initState() {
+ super.initState();
+ }
+
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -35,7 +51,8 @@ class _SpontaneousBreathingPresentState
child: Container(
decoration: BoxDecoration(color: Colors.grey[500]),
alignment: Alignment.center,
- child: Text('Nein',
+ child: new Text(
+ widget.startTriage.getIsAmbulatory() ? 'Ja' : 'Nein',
style: TextStyle(
fontSize: 20,
color: Colors.blue[900],
@@ -96,12 +113,24 @@ class _SpontaneousBreathingPresentState
color: Colors.blue[900])),
color: Colors.blue,
onPressed: () {
+ setState(() {
+ widget.startTriage
+ .setIsSpontaneousBreathingPresent(true);
+ print('testSPON');
+ print(widget.startTriage
+ .getIsSpontaneousBreathingPresent());
+ // _isSpontaneousBreathingPresent = widget.startTriage.isSpontaneousBreathingPresent = true;
+ });
Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => BreathingFrequencyPerMinute()),
- );
- } ))),
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ BreathingFrequencyPerMinute(
+ widget.startTriage)));
+ print('testAFTER');
+ print(widget.startTriage
+ .getIsSpontaneousBreathingPresent());
+ }))),
SizedBox(
height: 10,
),
@@ -117,11 +146,23 @@ class _SpontaneousBreathingPresentState
color: Colors.blue[900])),
color: Colors.blue,
onPressed: () {
+ setState(() {
+ widget.startTriage
+ .setIsSpontaneousBreathingPresent(false);
+ print('testSPON2');
+ print(widget.startTriage
+ .getIsSpontaneousBreathingPresent());
+ // _isSpontaneousBreathingPresent = widget.startTriage.isSpontaneousBreathingPresent = true;
+ });
Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => AfterOpeningAirways()),
- );
+ context,
+ MaterialPageRoute(
+ builder: (context) =>
+ AfterOpeningAirways(
+ widget.startTriage)));
+ print('testAFTER2');
+ print(widget.startTriage
+ .getIsSpontaneousBreathingPresent());
}))),
SizedBox(
height: 70,
--
GitLab