diff --git a/rescueapp/lib/main.dart b/rescueapp/lib/main.dart index 9b73427b26ee5712b88432f7edd4f4939f3596d8..d4d433aeb482d4d5f7d538ec51190c0a095f9c0b 100644 --- a/rescueapp/lib/main.dart +++ b/rescueapp/lib/main.dart @@ -1,69 +1,18 @@ import 'package:flutter/material.dart'; -import 'start_triage_system/ambulatory.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/views/home_view.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { + // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( - title: 'KatApp', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: MyHomePage()); - } -} - -class MyHomePage extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp Homepage'), - ), - body: Center( - child: Column( - children: <Widget>[ - SizedBox( - height: 250, - ), - SizedBox( - width: 200, - 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()), - ); - }, - ))), - SizedBox( - height: 20, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: Text('REAL', - style: TextStyle(fontSize: 22, color: Colors.white)), - color: Colors.red, - onPressed: null )), - ), - ], - ), - ), + title: Strings.appTitle, + home: HomeView(), ); } } diff --git a/rescueapp/lib/start_triage_system/after_opening_airways.dart b/rescueapp/lib/start_triage_system/after_opening_airways.dart deleted file mode 100644 index 55f05386b5fab9e36d39eef87dc7dbaf712102bf..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/after_opening_airways.dart +++ /dev/null @@ -1,169 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'camera_access.dart'; - -class AfterOpeningAirways extends StatefulWidget { - AfterOpeningAirways({Key key, this.title}) : super(key: key); - final String title; - - @override - _AfterOpeningAirwaysState createState() => _AfterOpeningAirwaysState(); -} - -class _AfterOpeningAirwaysState extends State<AfterOpeningAirways> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp'), - ), - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 10), - child: Column( - children: <Widget>[ - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ist der Patient gehfähig?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Nein', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('A:Spontanatmung vorhanden?', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Nein', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 110, - ), - SizedBox( - height: 50, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - top: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Kategorie A', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 50, - width: 500, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - bottom: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Nach Öffnung der Atemwege?', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 50, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Ja', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CameraAccess()), - ); - }))), - SizedBox( - height: 10, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Nein', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CameraAccess()), - ); - }))), - SizedBox( - height: 50, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Zurück', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.white)), - color: Colors.blue[900], - onPressed: () { - Navigator.pop(context); - }))), - ], - ), - ), - ); - } -} diff --git a/rescueapp/lib/start_triage_system/ambulatory.dart b/rescueapp/lib/start_triage_system/ambulatory.dart deleted file mode 100644 index 29d975a482b0de6187898e6d12de403f9500e613..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/ambulatory.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'package:flutter/material.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; - - @override - _AmbulatoryState createState() => _AmbulatoryState(); -} - -class _AmbulatoryState extends State<Ambulatory> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp'), - ), - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 10), - child: Column( - children: <Widget>[ - SizedBox( - height: 150, - ), - SizedBox( - height: 100, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - top: BorderSide(color: Colors.red, width: 2), - bottom: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Ist der Patient gehfähig?', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 120, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Ja', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - CameraAccess()), - ); - } ))), - SizedBox( - height: 10, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Nein', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - SpontaneousBreathingPresent()), - ); - }))), - SizedBox( - height: 100, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Zurück', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.white)), - color: Colors.blue[900], - onPressed: () { - Navigator.pop(context); - }))), - ], - ), - ), - ); - } -} diff --git a/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart b/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart deleted file mode 100644 index a7df8916816bd9d2a18e8ca2a72d7e2314d2eed2..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/breathing_frequency_per_minute.dart +++ /dev/null @@ -1,160 +0,0 @@ -import 'package:flutter/material.dart'; -import 'circulation.dart'; - -class BreathingFrequencyPerMinute extends StatefulWidget { - BreathingFrequencyPerMinute({Key key, this.title}) : super(key: key); - final String title; - @override - _BreathingFrequencyPerMinuteState createState() => - _BreathingFrequencyPerMinuteState(); -} - -class _BreathingFrequencyPerMinuteState - extends State<BreathingFrequencyPerMinute> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp'), - ), - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 10), - child: Column( - children: <Widget>[ - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ist der Patient gehfähig?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Nein', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Spontanatmung vorhanden?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ja', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 150, - ), - SizedBox( - height: 50, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - top: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Kategorie B', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 50, - width: 500, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - bottom: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Atemfrequenz pro Minute:', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 70, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('> 30', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: null))), - SizedBox( - height: 10, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('≤ 30', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CapillaryFillingTime()), - ); - }))), - SizedBox( - height: 70, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Zurück', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.white)), - color: Colors.blue[900], - onPressed: () { - Navigator.pop(context); - }))), - ], - ), - ), - ); - } -} diff --git a/rescueapp/lib/start_triage_system/circulation.dart b/rescueapp/lib/start_triage_system/circulation.dart deleted file mode 100644 index 15394d13e1f3cb1b64b56539d6112a143c4fb8d1..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/circulation.dart +++ /dev/null @@ -1,177 +0,0 @@ -import 'package:flutter/material.dart'; -import 'neurology.dart'; - -class CapillaryFillingTime extends StatefulWidget { - CapillaryFillingTime({Key key, this.title}) : super(key: key); - final String title; - @override - _CapillaryFillingTimeState createState() => _CapillaryFillingTimeState(); -} - -class _CapillaryFillingTimeState extends State<CapillaryFillingTime> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp'), - ), - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 10), - child: Column( - children: <Widget>[ - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ist der Patient gehfähig?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Nein', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Spontanatmung vorhanden?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ja', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Atemfrequenz pro Minute:', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('≤ 30', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 150, - ), - SizedBox( - height: 50, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - top: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Kategorie C', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 50, - width: 500, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - bottom: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Kapilläre Füllungszeit:', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 70, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('> 2s', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: null))), - SizedBox( - height: 10, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('≤ 2s', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => Neurology()), - ); - }))), - SizedBox( - height: 70, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Zurück', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.white)), - color: Colors.blue[900], - onPressed: () { - Navigator.pop(context); - }))), - ], - ), - ), - ); - } -} diff --git a/rescueapp/lib/start_triage_system/configs/color_pallet.dart b/rescueapp/lib/start_triage_system/configs/color_pallet.dart new file mode 100644 index 0000000000000000000000000000000000000000..feabd9de9e64ffdb6ae93c651412139bb80f84d2 --- /dev/null +++ b/rescueapp/lib/start_triage_system/configs/color_pallet.dart @@ -0,0 +1,16 @@ +import 'package:flutter/Material.dart'; + +class ColorPallet { + static const Color darkGrey = Color(0xFF616161); + static const Color lightGrey = Color(0xFFEEEEEE); + static const Color defaultButtonColor = darkGrey; + static const Color yesButtonColor = Colors.green; + static const Color noButtonColor = Colors.red; + static const Color backButtonColor = Colors.grey; + static const Color appBarColor = Colors.blue; + + static const Color colorCategoryA = Colors.red; + static const Color colorCategoryB = Colors.yellow; + static const Color colorCategoryC = Colors.green; + static const Color colorCategoryD = Colors.black; +} diff --git a/rescueapp/lib/start_triage_system/configs/layout.dart b/rescueapp/lib/start_triage_system/configs/layout.dart new file mode 100644 index 0000000000000000000000000000000000000000..e11e53cfd366ab3454df2c00a8313db2bf37b160 --- /dev/null +++ b/rescueapp/lib/start_triage_system/configs/layout.dart @@ -0,0 +1,71 @@ +import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; + +class Layout { + static const TextStyle defaultText = TextStyle( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.w600, + ); + + static const TextStyle categoryText = TextStyle( + fontSize: 40, + color: Colors.black, + fontWeight: FontWeight.w600, + ); + + static const TextStyle categoryTextWhite = TextStyle( + fontSize: 40, + color: Colors.white, + fontWeight: FontWeight.w600, + ); + + static const TextStyle infoText = TextStyle( + fontSize: 20, + color: Colors.black, + fontWeight: FontWeight.w300, + ); + + static const TextStyle infoTextWhite = TextStyle( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.w300, + ); + + static const TextStyle lockScreenButtonText = TextStyle( + fontSize: 15, + color: Colors.white, + fontWeight: FontWeight.w600, + ); + + static const TextStyle questionText = TextStyle( + fontSize: 30, + color: Colors.black, + fontWeight: FontWeight.w600, + ); + + static const TextStyle showText = TextStyle( + fontSize: 20, + color: Colors.black, + ); + + static BoxDecoration containerDecorationStyle([Color color]) { + return BoxDecoration( + color: color, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + topRight: Radius.circular(10), + bottomLeft: Radius.circular(10), + bottomRight: Radius.circular(10), + ), + boxShadow: [ + BoxShadow( + color: Colors.grey, + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ); + } +} diff --git a/rescueapp/lib/start_triage_system/configs/strings.dart b/rescueapp/lib/start_triage_system/configs/strings.dart new file mode 100644 index 0000000000000000000000000000000000000000..9df4f85db543ce6be3479597368f7c3b9c56a799 --- /dev/null +++ b/rescueapp/lib/start_triage_system/configs/strings.dart @@ -0,0 +1,21 @@ +class Strings { + static const String exerciseAppBarTitle = 'KatApp - Übung'; + static const String appTitle = 'KatApp'; + static const String appBarTitleHome = 'KatApp Homepage'; + static const String categoryA = 'Kategorie A'; + static const String categoryB = 'Kategorie B'; + static const String categoryC = 'Kategorie C'; + static const String categoryD = 'Kategorie D'; + + // Questions + static const String ambulatoryQuestion = 'Ist der Patient gehfähig?'; + static const String spontaneousBreathingPresentQuestion = + 'Spontanatmung vorhanden?'; + static const String breathingFrequencyPerMinuteQuestion = + 'Atemfrequenz pro Minute:'; + static const String circulationQuestion = 'Kapilläre Füllungszeit:'; + static const String neurologyQuestion = + 'Folgt der Patient den Aufforderungen?'; + static const String afterOpeningAirwaysQuestion = + 'Nach Öffnung der Atemwege?'; +} diff --git a/rescueapp/lib/start_triage_system/custom_widgets/app_bar_widget.dart b/rescueapp/lib/start_triage_system/custom_widgets/app_bar_widget.dart new file mode 100644 index 0000000000000000000000000000000000000000..ff02b1f217ae71923fe029696f676b200a0997ed --- /dev/null +++ b/rescueapp/lib/start_triage_system/custom_widgets/app_bar_widget.dart @@ -0,0 +1,25 @@ +import 'package:flutter/Material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; + +class AppBarWidget extends StatelessWidget with PreferredSizeWidget { + @override + final Size preferredSize; + final String title; + final Color backgroundColor; + + AppBarWidget({ + this.title, + this.preferredSize, + this.backgroundColor = ColorPallet.appBarColor, + }); + + @override + Widget build(BuildContext context) { + return AppBar( + centerTitle: true, + title: Text(title), + backgroundColor: backgroundColor, + ); + } +} diff --git a/rescueapp/lib/start_triage_system/custom_widgets/base_site_widget.dart b/rescueapp/lib/start_triage_system/custom_widgets/base_site_widget.dart new file mode 100644 index 0000000000000000000000000000000000000000..8178e9bdad6a920d589aa286258f2531bbeb6bc6 --- /dev/null +++ b/rescueapp/lib/start_triage_system/custom_widgets/base_site_widget.dart @@ -0,0 +1,50 @@ +import 'package:flutter/Material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/app_bar_widget.dart'; + +class BaseSiteWidget extends StatelessWidget { + final Widget topRow; + final Widget bottomRow; + final String appBarTitle; + final Color appBarColor; + + const BaseSiteWidget({ + this.topRow, + this.bottomRow, + this.appBarTitle = Strings.exerciseAppBarTitle, + this.appBarColor, + }); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: ColorPallet.lightGrey, + appBar: AppBarWidget( + preferredSize: Size( + MediaQuery.of(context).size.width, + 40, + ), + backgroundColor: appBarColor, + title: appBarTitle, + ), + body: SingleChildScrollView( + child: Column( + children: <Widget>[ + Container( + alignment: Alignment.center, + height: MediaQuery.of(context).size.height * 0.2, + constraints: new BoxConstraints( + minHeight: 200, + ), + child: topRow, + ), + Container( + child: bottomRow, + ), + ], + ), + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/custom_widgets/bottom_widget.dart b/rescueapp/lib/start_triage_system/custom_widgets/bottom_widget.dart new file mode 100644 index 0000000000000000000000000000000000000000..04979c1d2a76d8f7eb7220e9698be6c8b733e705 --- /dev/null +++ b/rescueapp/lib/start_triage_system/custom_widgets/bottom_widget.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_button_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/question_widget.dart'; +import 'package:rescueapp/start_triage_system/helpers/big_spacer.dart'; +import 'package:rescueapp/start_triage_system/helpers/small_spacer.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; + +class BottomWidget extends StatelessWidget { + final String question; + final String yesButtonTitle; + final String noButtonTitle; + final StatelessWidget yesButtonNav; + final StatelessWidget noButtonNav; + final TextStyle yesButtonTextStyle; + final TextStyle noButtonTextStyle; + final Color yesButtonColor; + final Color noButtonColor; + + const BottomWidget( + {@required this.question, + this.yesButtonTitle = 'Ja', + this.noButtonTitle = 'Nein', + @required this.yesButtonNav, + @required this.noButtonNav, + this.yesButtonTextStyle = Layout.defaultText, + this.noButtonTextStyle = Layout.defaultText, + this.yesButtonColor = ColorPallet.defaultButtonColor, + this.noButtonColor = ColorPallet.defaultButtonColor}); + + @override + Widget build(BuildContext context) { + return Column( + children: <Widget>[ + BigSpacer(), + Question(question), + BigSpacer(), + CustomRaisedButton( + buttonText: yesButtonTitle, + nextPage: yesButtonNav, + textStyle: yesButtonTextStyle, + buttonColor: yesButtonColor, + ), + SmallSpacer(), + CustomRaisedButton( + buttonText: noButtonTitle, + nextPage: noButtonNav, + textStyle: noButtonTextStyle, + buttonColor: noButtonColor, + ), + SmallSpacer(), + CustomRaisedButton( + buttonText: 'Zurück', + textStyle: Layout.defaultText, + buttonColor: ColorPallet.backButtonColor, + backButton: true, + ), + ], + ); + } +} diff --git a/rescueapp/lib/start_triage_system/custom_widgets/custom_button_widget.dart b/rescueapp/lib/start_triage_system/custom_widgets/custom_button_widget.dart new file mode 100644 index 0000000000000000000000000000000000000000..c1854f2ae4d07b89774bad6f0c3f4952c5193c8b --- /dev/null +++ b/rescueapp/lib/start_triage_system/custom_widgets/custom_button_widget.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; + +class CustomRaisedButton extends StatelessWidget { + final String buttonText; + final StatelessWidget nextPage; + final TextStyle textStyle; + final Color buttonColor; + final bool backButton; + + const CustomRaisedButton({ + @required this.buttonText, + @required this.textStyle, + @required this.buttonColor, + StatelessWidget this.nextPage, + this.backButton = false, + }); + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * 0.08, + width: MediaQuery.of(context).size.width * 0.3, + constraints: new BoxConstraints( + minHeight: 60, + minWidth: 150, + ), + decoration: Layout.containerDecorationStyle(), + child: RaisedButton( + child: Text( + buttonText, + style: textStyle, + ), + color: buttonColor, + onPressed: () { + backButton ? back(context) : forward(context); + }, + ), + ); + } + + Future forward(BuildContext context) { + return Navigator.push( + context, + MaterialPageRoute( + builder: (context) => nextPage, + ), + ); + } + + void back(BuildContext context) { + return Navigator.pop(context); + } +} diff --git a/rescueapp/lib/start_triage_system/custom_widgets/custom_show_text.dart b/rescueapp/lib/start_triage_system/custom_widgets/custom_show_text.dart new file mode 100644 index 0000000000000000000000000000000000000000..03c23b5d2a6b9616e0da47e124316e64add7c6e6 --- /dev/null +++ b/rescueapp/lib/start_triage_system/custom_widgets/custom_show_text.dart @@ -0,0 +1,27 @@ +import 'package:flutter/Material.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; + +class CustomShowTextWidget extends StatelessWidget { + final String questionText; + final String answerText; + + const CustomShowTextWidget({this.questionText, this.answerText}); + + @override + Widget build(BuildContext context) { + return Row( + children: <Widget>[ + Container( + width: MediaQuery.of(context).size.width, + child: Center( + child: Text( + questionText + ' - ' + answerText, + style: Layout.showText, + textAlign: TextAlign.center, + ), + ), + ), + ], + ); + } +} diff --git a/rescueapp/lib/start_triage_system/custom_widgets/question_widget.dart b/rescueapp/lib/start_triage_system/custom_widgets/question_widget.dart new file mode 100644 index 0000000000000000000000000000000000000000..d3cb38dcfc64021596c24f6de8b67666ccb9b172 --- /dev/null +++ b/rescueapp/lib/start_triage_system/custom_widgets/question_widget.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; + +class Question extends StatelessWidget { + final String question; + + const Question( + @required String this.question, + ); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width / 1.5, + decoration: Layout.containerDecorationStyle(Colors.white), + child: Text( + question, + style: Layout.questionText, + textAlign: TextAlign.center, + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/helpers/big_spacer.dart b/rescueapp/lib/start_triage_system/helpers/big_spacer.dart new file mode 100644 index 0000000000000000000000000000000000000000..5f179e5ec00451a5c9ca1f1e61de369877bd1d64 --- /dev/null +++ b/rescueapp/lib/start_triage_system/helpers/big_spacer.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class BigSpacer extends StatelessWidget { + const BigSpacer(); + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * 0.05, + ); + } +} diff --git a/rescueapp/lib/start_triage_system/helpers/small_spacer.dart b/rescueapp/lib/start_triage_system/helpers/small_spacer.dart new file mode 100644 index 0000000000000000000000000000000000000000..74328920fe449813bf787561d1a088df315fa663 --- /dev/null +++ b/rescueapp/lib/start_triage_system/helpers/small_spacer.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class SmallSpacer extends StatelessWidget { + const SmallSpacer(); + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height / 50, + ); + } +} diff --git a/rescueapp/lib/start_triage_system/neurology.dart b/rescueapp/lib/start_triage_system/neurology.dart deleted file mode 100644 index 5a4aa1623f6c859db1083c05385f7fd2fbf1763d..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/neurology.dart +++ /dev/null @@ -1,195 +0,0 @@ -import 'package:flutter/material.dart'; - -class Neurology extends StatefulWidget { - Neurology({Key key, this.title}) : super(key: key); - final String title; - @override - _NeurologyState createState() => _NeurologyState(); -} - -class _NeurologyState extends State<Neurology> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp'), - ), - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 10), - child: Column( - children: <Widget>[ - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ist der Patient gehfähig?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Nein', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Spontanatmung vorhanden?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ja', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Atemfrequenz pro Minute:', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('≤ 30', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Kreislauf:', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Kapilläre Füllungszeit <= 2s ', - textAlign: TextAlign.right, - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 50, - ), - SizedBox( - height: 50, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - top: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Kategorie D', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 80, - width: 500, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - bottom: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text( - 'Neurologie - folgt der Patient den Aufforderungen?', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 30, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Ja', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: null))), - SizedBox( - height: 10, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Nein', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: null))), - SizedBox( - height: 20, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Zurück', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.white)), - color: Colors.blue[900], - onPressed: () { - Navigator.pop(context); - }))), - ], - ), - ), - ); - } -} diff --git a/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart b/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart deleted file mode 100644 index 75b3fe827f7b16d98f1ad325f908b8bca849fc32..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/spontaneous_breathing_present.dart +++ /dev/null @@ -1,148 +0,0 @@ -import 'package:flutter/material.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; - @override - _SpontaneousBreathingPresentState createState() => - _SpontaneousBreathingPresentState(); -} - -class _SpontaneousBreathingPresentState - extends State<SpontaneousBreathingPresent> { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('KatApp'), - ), - body: Padding( - padding: EdgeInsets.symmetric(horizontal: 40, vertical: 10), - child: Column( - children: <Widget>[ - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Ist der Patient gehfähig?', - style: TextStyle(fontSize: 20, color: Colors.blue[900])), - )), - SizedBox( - height: 40, - child: Container( - decoration: BoxDecoration(color: Colors.grey[500]), - alignment: Alignment.center, - child: Text('Nein', - style: TextStyle( - fontSize: 20, - color: Colors.blue[900], - backgroundColor: Colors.grey[500])), - )), - SizedBox( - height: 150, - ), - SizedBox( - height: 50, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - top: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Kategorie A', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 50, - width: 500, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - border: Border( - left: BorderSide(color: Colors.red, width: 2), - right: BorderSide(color: Colors.red, width: 2), - bottom: BorderSide(color: Colors.red, width: 2), - ), - ), - child: Text('Spontanatmung vorhanden?', - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.w700, - color: Colors.blue[900], - backgroundColor: Colors.white)), - )), - SizedBox( - height: 70, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Ja', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => BreathingFrequencyPerMinute()), - ); - } ))), - SizedBox( - height: 10, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Nein', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.blue[900])), - color: Colors.blue, - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AfterOpeningAirways()), - ); - }))), - SizedBox( - height: 70, - ), - SizedBox( - width: 200, - height: 50, - child: Container( - child: RaisedButton( - child: new Text('Zurück', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - color: Colors.white)), - color: Colors.blue[900], - onPressed: () { - Navigator.pop(context); - }))), - ], - ), - ), - ); - } -} diff --git a/rescueapp/lib/start_triage_system/triage_data.dart b/rescueapp/lib/start_triage_system/triage_data.dart deleted file mode 100644 index 77c135e3b9ed85b05b8e0ddc6543fa293ce28661..0000000000000000000000000000000000000000 --- a/rescueapp/lib/start_triage_system/triage_data.dart +++ /dev/null @@ -1,56 +0,0 @@ -// 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); -} diff --git a/rescueapp/lib/start_triage_system/views/after_opening_airways_view.dart b/rescueapp/lib/start_triage_system/views/after_opening_airways_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..022766f0db5fc50467aa5c541d94ba2045ff7587 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/after_opening_airways_view.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/base_site_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/bottom_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_show_text.dart'; +import 'package:rescueapp/start_triage_system/views/camera_access_view.dart'; +import 'package:rescueapp/start_triage_system/views/lock_screen_view.dart'; + +class AfterOpeningAirwaysView extends StatelessWidget { + const AfterOpeningAirwaysView(); + + @override + Widget build(BuildContext context) { + return BaseSiteWidget( + appBarTitle: Strings.categoryA, + topRow: Container( + child: Column( + children: <Widget>[ + CustomShowTextWidget( + questionText: Strings.ambulatoryQuestion, + answerText: 'NEIN', + ), + CustomShowTextWidget( + questionText: Strings.spontaneousBreathingPresentQuestion, + answerText: 'NEIN', + ), + ], + ), + ), + bottomRow: BottomWidget( + question: Strings.afterOpeningAirwaysQuestion, + yesButtonNav: CameraAccessView(), + noButtonNav: LockScreenView(), + yesButtonColor: ColorPallet.yesButtonColor, + noButtonColor: ColorPallet.noButtonColor, + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/views/ambulatory_view.dart b/rescueapp/lib/start_triage_system/views/ambulatory_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..2a956bbbebd88369dcf3ac2cc8dca62ddd153481 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/ambulatory_view.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/base_site_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/bottom_widget.dart'; +import 'package:rescueapp/start_triage_system/views/camera_access_view.dart'; +import 'package:rescueapp/start_triage_system/views/spontaneous_breathing_present_view.dart'; + +class AmbulatoryView extends StatelessWidget { + const AmbulatoryView(); + + @override + Widget build(BuildContext context) { + return BaseSiteWidget( + topRow: null, + bottomRow: BottomWidget( + question: Strings.ambulatoryQuestion, + yesButtonNav: CameraAccessView(), + noButtonNav: SpontaneousBreathingPresentView(), + yesButtonColor: ColorPallet.yesButtonColor, + noButtonColor: ColorPallet.noButtonColor, + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/views/breathing_frequency_per_minute_view.dart b/rescueapp/lib/start_triage_system/views/breathing_frequency_per_minute_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..2d4272eed7af72a3fa846b4f13d8f4d9eae17678 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/breathing_frequency_per_minute_view.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/base_site_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/bottom_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_show_text.dart'; +import 'package:rescueapp/start_triage_system/views/circulation_view.dart'; +import 'package:rescueapp/start_triage_system/views/lock_screen_view.dart'; + +class BreathingFrequencyPerMinuteView extends StatelessWidget { + const BreathingFrequencyPerMinuteView(); + + @override + Widget build(BuildContext context) { + return BaseSiteWidget( + appBarTitle: Strings.categoryB, + topRow: Container( + child: Column( + children: <Widget>[ + CustomShowTextWidget( + questionText: Strings.ambulatoryQuestion, + answerText: 'NEIN', + ), + CustomShowTextWidget( + questionText: Strings.spontaneousBreathingPresentQuestion, + answerText: 'JA', + ), + ], + ), + ), + bottomRow: BottomWidget( + question: Strings.breathingFrequencyPerMinuteQuestion, + yesButtonTitle: '> 30', + noButtonTitle: '≤ 30', + yesButtonNav: LockScreenView(), + noButtonNav: CirculationView(), + yesButtonColor: ColorPallet.yesButtonColor, + noButtonColor: ColorPallet.noButtonColor, + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/camera_access.dart b/rescueapp/lib/start_triage_system/views/camera_access_view.dart similarity index 78% rename from rescueapp/lib/start_triage_system/camera_access.dart rename to rescueapp/lib/start_triage_system/views/camera_access_view.dart index c35c347216fed764a7930d0427425f538e5f11da..3c4beade1d65846e2e8a91e83ee7a3200ff95ae5 100644 --- a/rescueapp/lib/start_triage_system/camera_access.dart +++ b/rescueapp/lib/start_triage_system/views/camera_access_view.dart @@ -1,25 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/views/lock_screen_view.dart'; -import 'lock_screen.dart'; - -class CameraAccess extends StatefulWidget { - - CameraAccess({Key key, this.title}) : super(key: key); - final String title; - - @override - _CameraAccessState createState() => _CameraAccessState(); -} - -class _CameraAccessState extends State<CameraAccess> { - @override - void initState() { - super.initState(); - } +class CameraAccessView extends StatelessWidget { + const CameraAccessView(); @override Widget build(BuildContext context) { - return Scaffold( appBar: AppBar( title: Text("KatApp"), @@ -49,12 +35,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, ), @@ -66,12 +51,7 @@ class _CameraAccessState extends State<CameraAccess> { style: TextStyle(color: Colors.white, fontSize: 20)), color: Colors.red, onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - LockScreen()), - ); + forward (context); }, ), ), @@ -98,5 +78,10 @@ class _CameraAccessState extends State<CameraAccess> { }, ), ); + } + Future forward (BuildContext context) {return Navigator.push( + context, + MaterialPageRoute( + builder:(context) => LockScreenView()));} } diff --git a/rescueapp/lib/start_triage_system/views/circulation_view.dart b/rescueapp/lib/start_triage_system/views/circulation_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..94f007ffbaf7ee911622c4143a39f65e82201f61 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/circulation_view.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/base_site_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/bottom_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_show_text.dart'; +import 'package:rescueapp/start_triage_system/views/lock_screen_view.dart'; +import 'package:rescueapp/start_triage_system/views/neurology_view.dart'; + +class CirculationView extends StatelessWidget { + const CirculationView(); + + @override + Widget build(BuildContext context) { + return BaseSiteWidget( + appBarTitle: Strings.categoryC, + topRow: Container( + child: Column( + children: <Widget>[ + CustomShowTextWidget( + questionText: Strings.ambulatoryQuestion, + answerText: 'NEIN', + ), + CustomShowTextWidget( + questionText: Strings.spontaneousBreathingPresentQuestion, + answerText: 'JA', + ), + CustomShowTextWidget( + questionText: Strings.breathingFrequencyPerMinuteQuestion, + answerText: '≤ 30', + ), + ], + ), + ), + bottomRow: BottomWidget( + question: Strings.circulationQuestion, + yesButtonTitle: '> 2s', + noButtonTitle: '≤ 2s', + yesButtonNav: LockScreenView(), + noButtonNav: NeurologyView(), + yesButtonColor: ColorPallet.yesButtonColor, + noButtonColor: ColorPallet.noButtonColor, + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/views/home_view.dart b/rescueapp/lib/start_triage_system/views/home_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..5c44767169f0758201c991f755f2d5d0ca05b4e2 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/home_view.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/app_bar_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_button_widget.dart'; +import 'package:rescueapp/start_triage_system/helpers/small_spacer.dart'; +import 'package:rescueapp/start_triage_system/views/ambulatory_view.dart'; + +class HomeView extends StatelessWidget { + const HomeView(); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: ColorPallet.lightGrey, + appBar: AppBarWidget( + preferredSize: Size( + MediaQuery.of(context).size.width, + 40, + ), + title: Strings.appBarTitleHome, + ), + body: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: <Widget>[ + Container( + child: CustomRaisedButton( + buttonText: 'ÜBUNG', + textStyle: Layout.defaultText, + nextPage: AmbulatoryView(), + buttonColor: Colors.green, + ), + ), + SmallSpacer(), + Container( + child: CustomRaisedButton( + buttonText: 'REAL', + textStyle: Layout.defaultText, + nextPage: null, + buttonColor: ColorPallet.darkGrey, + ), + ), + ], + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/lock_screen.dart b/rescueapp/lib/start_triage_system/views/lock_screen_view.dart similarity index 77% rename from rescueapp/lib/start_triage_system/lock_screen.dart rename to rescueapp/lib/start_triage_system/views/lock_screen_view.dart index 0d6c18afc24b0d4ccbeb4d99b2a8f61e5133b124..49f5baa35ae029151ef4525a95ee83bf86ea4462 100644 --- a/rescueapp/lib/start_triage_system/lock_screen.dart +++ b/rescueapp/lib/start_triage_system/views/lock_screen_view.dart @@ -1,13 +1,26 @@ -import 'package:flutter/material.dart'; +import 'package:flutter/Material.dart'; +import 'package:intl/intl.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/app_bar_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_button_widget.dart'; +import 'package:rescueapp/start_triage_system/helpers/big_spacer.dart'; +import 'package:rescueapp/start_triage_system/helpers/small_spacer.dart'; -class LockScreen extends StatefulWidget { - LockScreen({Key key, this.title}) : super(key: key); - final String title; - @override - _LockScreenState createState() => _LockScreenState(); -} +class LockScreenView extends StatelessWidget { + final Color screenColor; + final String category; + final TextStyle styleCategory; + final TextStyle styleInfos; + + const LockScreenView({ + this.screenColor, + this.category, + this.styleCategory = Layout.categoryText, + this.styleInfos = Layout.infoText, + }); -class _LockScreenState extends State<LockScreen> { @override Widget build(BuildContext context) { return Scaffold( @@ -53,7 +66,8 @@ class _LockScreenState extends State<LockScreen> { )), SizedBox( height: 20, - ), SizedBox( + ), + SizedBox( width: 250, height: 40, child: Container( @@ -66,7 +80,8 @@ class _LockScreenState extends State<LockScreen> { height: 90, child: Container( alignment: Alignment.centerLeft, - child: Text('Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', + child: Text( + 'Hochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen', style: TextStyle( fontSize: 20, color: Colors.blue[900], @@ -88,7 +103,9 @@ class _LockScreenState extends State<LockScreen> { height: 50, child: Container( alignment: Alignment.centerLeft, - child: Text('15.07.2020/11:13', + child: Text( + DateFormat('HH:mm:ss / dd.MM.yyyy') + .format(DateTime.now()), style: TextStyle( fontSize: 20, color: Colors.blue[900], diff --git a/rescueapp/lib/start_triage_system/views/lock_screen_view_backup.dart b/rescueapp/lib/start_triage_system/views/lock_screen_view_backup.dart new file mode 100644 index 0000000000000000000000000000000000000000..dc20f81102e750945428ee306e11ccb8d5a4a456 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/lock_screen_view_backup.dart @@ -0,0 +1,70 @@ +import 'package:flutter/Material.dart'; +import 'package:intl/intl.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/layout.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/app_bar_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_button_widget.dart'; +import 'package:rescueapp/start_triage_system/helpers/big_spacer.dart'; +import 'package:rescueapp/start_triage_system/helpers/small_spacer.dart'; + +class LockScreenView extends StatelessWidget { + final Color screenColor; + final String category; + final TextStyle styleCategory; + final TextStyle styleInfos; + + const LockScreenView({ + this.screenColor, + this.category, + this.styleCategory = Layout.categoryText, + this.styleInfos = Layout.infoText, + }); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: screenColor, + appBar: AppBarWidget( + preferredSize: Size( + MediaQuery.of(context).size.width, + 40, + ), + title: Strings.exerciseAppBarTitle, + ), + body: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: <Widget>[ + Text(category, style: styleCategory), + BigSpacer(), + Text( + 'PatientenID:\n1\n\nStandort:\nHochschule Reutlingen \nAlteburgstraße 150 \n72762 Reutlingen\n\nDatum / Uhrzeit:\n' + + DateFormat('dd.MM.yyyy / HH:mm:ss').format(DateTime.now()), + style: styleInfos, + ), + BigSpacer(), + Container( + child: CustomRaisedButton( + buttonText: 'Zweite Sichtung', + textStyle: Layout.lockScreenButtonText, + nextPage: null, + buttonColor: ColorPallet.appBarColor, + ), + ), + SmallSpacer(), + Container( + child: CustomRaisedButton( + buttonText: 'Eingabe ändern', + textStyle: Layout.lockScreenButtonText, + backButton: true, + buttonColor: ColorPallet.backButtonColor, + ), + ), + ], + ), + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/views/neurology_view.dart b/rescueapp/lib/start_triage_system/views/neurology_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..338847596f161ae8b5efe4b42d269cfe3221b4ff --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/neurology_view.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/base_site_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/bottom_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_show_text.dart'; +import 'package:rescueapp/start_triage_system/views/lock_screen_view.dart'; + +class NeurologyView extends StatelessWidget { + const NeurologyView(); + + @override + Widget build(BuildContext context) { + return BaseSiteWidget( + appBarTitle: Strings.categoryD, + topRow: Container( + child: Column( + children: <Widget>[ + CustomShowTextWidget( + questionText: Strings.ambulatoryQuestion, + answerText: 'NEIN', + ), + CustomShowTextWidget( + questionText: Strings.spontaneousBreathingPresentQuestion, + answerText: 'JA', + ), + CustomShowTextWidget( + questionText: Strings.breathingFrequencyPerMinuteQuestion, + answerText: '≤ 30', + ), + CustomShowTextWidget( + questionText: Strings.circulationQuestion, + answerText: '≤ 2s', + ), + ], + ), + ), + bottomRow: BottomWidget( + question: Strings.neurologyQuestion, + yesButtonNav: LockScreenView(), + noButtonNav: LockScreenView(), + yesButtonColor: ColorPallet.yesButtonColor, + noButtonColor: ColorPallet.noButtonColor, + ), + ); + } +} diff --git a/rescueapp/lib/start_triage_system/views/spontaneous_breathing_present_view.dart b/rescueapp/lib/start_triage_system/views/spontaneous_breathing_present_view.dart new file mode 100644 index 0000000000000000000000000000000000000000..04e14286b4563155fa1e48ec833f4e71b2e1b691 --- /dev/null +++ b/rescueapp/lib/start_triage_system/views/spontaneous_breathing_present_view.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; +import 'package:rescueapp/start_triage_system/configs/color_pallet.dart'; +import 'package:rescueapp/start_triage_system/configs/strings.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/base_site_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/bottom_widget.dart'; +import 'package:rescueapp/start_triage_system/custom_widgets/custom_show_text.dart'; +import 'package:rescueapp/start_triage_system/views/after_opening_airways_view.dart'; +import 'package:rescueapp/start_triage_system/views/breathing_frequency_per_minute_view.dart'; + +class SpontaneousBreathingPresentView extends StatelessWidget { + const SpontaneousBreathingPresentView(); + + @override + Widget build(BuildContext context) { + return BaseSiteWidget( + appBarTitle: Strings.categoryA, + topRow: Container( + child: Column( + children: <Widget>[ + CustomShowTextWidget( + questionText: Strings.ambulatoryQuestion, + answerText: 'NEIN', + ), + ], + ), + ), + bottomRow: BottomWidget( + question: Strings.spontaneousBreathingPresentQuestion, + yesButtonNav: BreathingFrequencyPerMinuteView(), + noButtonNav: AfterOpeningAirwaysView(), + yesButtonColor: ColorPallet.yesButtonColor, + noButtonColor: ColorPallet.noButtonColor, + ), + ); + } +} diff --git a/rescueapp/pubspec.lock b/rescueapp/pubspec.lock index 4202e05a031b5b5aed61663f1f2222bc01ebde85..fe277883a694dcc4dae1c0a9c0a08013bfd1a320 100644 --- a/rescueapp/pubspec.lock +++ b/rescueapp/pubspec.lock @@ -67,6 +67,13 @@ packages: description: flutter source: sdk version: "0.0.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" matcher: dependency: transitive description: diff --git a/rescueapp/pubspec.yaml b/rescueapp/pubspec.yaml index ddda1624f5e6bd259ab2054fe915c6c6d9f48cb5..bbf0bc0c7c358667c8ac80bbfe2afeabed6f3805 100644 --- a/rescueapp/pubspec.yaml +++ b/rescueapp/pubspec.yaml @@ -28,6 +28,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 + intl: ^0.16.1 dev_dependencies: flutter_test: @@ -73,4 +74,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + # see https://flutter.dev/custom-fonts/#from-packages \ No newline at end of file