Skip to content
Snippets Groups Projects
Commit d7605fc2 authored by Thi Huyen Trang Nguyen's avatar Thi Huyen Trang Nguyen
Browse files

KAT-51: Added photopage in camera_access.dart

parent 3557a9a8
No related branches found
No related tags found
No related merge requests found
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);
}))),
],
),
);
},
),
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment