diff --git a/rescueapp/lib/start_triage_system/camera_access.dart b/rescueapp/lib/start_triage_system/camera_access.dart new file mode 100644 index 0000000000000000000000000000000000000000..98b153d1044297d1a6c1191a649d5d8798b8abb3 --- /dev/null +++ b/rescueapp/lib/start_triage_system/camera_access.dart @@ -0,0 +1,111 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:image_picker/image_picker.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> { + File image; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + Future getImage() async { + image = await ImagePicker.pickImage( + source: ImageSource.camera, + ); + } + + return Scaffold( + appBar: AppBar( + title: Text("KatApp"), + backgroundColor: Colors.blue, + actions: <Widget>[], + ), + body: Builder( + builder: (BuildContext context) { + return Center( + child: new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: <Widget>[ + SizedBox( + height: 40, + child: Container( + alignment: Alignment.center, + child: Text('Bitte machen Sie ein Foto des Patienten', + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 22, + color: Colors.blue[900])), + )), + SizedBox( + height: 50, + ), + SizedBox( + height: 50, + width: 130, + child: RaisedButton( + child: + Icon(Icons.camera_alt, color: Colors.black, size: 35), + color: Colors.grey, + onPressed: getImage), + ), + SizedBox( + height: 50, + ), + SizedBox( + height: 200.0, + width: 300.0, + child: image == null + ? Center(child: new Text('Sorry nichts ausgewählt!!')) + : Center(child: new Image.file(image)), + ), + SizedBox( + height: 50, + ), + SizedBox( + height: 50, + width: 200, + child: RaisedButton( + child: Text('Absenden', + style: TextStyle(color: Colors.white, fontSize: 20)), + color: Colors.red, + 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); + }))), + ], + ), + ); + }, + ), + ); + } +}