Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KatApp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Automate
Agent sessions
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thi Huyen Trang Nguyen
KatApp
Commits
6a5c5b54
Commit
6a5c5b54
authored
Feb 3, 2021
by
Thi Huyen Trang Nguyen
Browse files
Options
Downloads
Patches
Plain Diff
KAT-77-TEST: added image_picker in pubspec.yaml
parent
c6f9dbe1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
rescueapp/lib/start_triage_system/widgets/camera_access.dart
+35
-7
35 additions, 7 deletions
rescueapp/lib/start_triage_system/widgets/camera_access.dart
rescueapp/pubspec.yaml
+1
-0
1 addition, 0 deletions
rescueapp/pubspec.yaml
with
36 additions
and
7 deletions
rescueapp/lib/start_triage_system/widgets/camera_access.dart
+
35
−
7
View file @
6a5c5b54
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'../model/startTriage.dart'
;
import
'../model/startTriage.dart'
;
import
'../enums/start_triage_state.dart'
;
import
'../enums/start_triage_state.dart'
;
import
'lock_screen.dart'
;
import
'lock_screen.dart'
;
...
@@ -21,6 +24,21 @@ class CameraAccess extends StatefulWidget {
...
@@ -21,6 +24,21 @@ class CameraAccess extends StatefulWidget {
}
}
class
_CameraAccessState
extends
State
<
CameraAccess
>
{
class
_CameraAccessState
extends
State
<
CameraAccess
>
{
File
_image
;
final
picker
=
ImagePicker
();
Future
getImage
()
async
{
final
pickedFile
=
await
picker
.
getImage
(
source
:
ImageSource
.
camera
)
;
setState
(()
{
if
(
pickedFile
!=
null
)
{
_image
=
File
(
pickedFile
.
path
);
}
else
{
print
(
''
);
}
});
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
...
@@ -49,13 +67,23 @@ class _CameraAccessState extends State<CameraAccess> {
...
@@ -49,13 +67,23 @@ class _CameraAccessState extends State<CameraAccess> {
height:
50
,
height:
50
,
),
),
SizedBox
(
SizedBox
(
height:
2
50
,
height:
50
,
width:
250
,
width:
250
,
child:
RaisedButton
(
child:
RaisedButton
(
child:
Icon
(
Icons
.
photo_library
,
child:
Icon
(
Icons
.
photo_library
,
color:
Colors
.
black
,
size:
35
),
color:
Colors
.
black
,
size:
35
),
color:
Colors
.
grey
,
color:
Colors
.
white
,
onPressed:
null
),
onPressed:
getImage
),
),
SizedBox
(
height:
50
,
),
SizedBox
(
height:
250
,
width:
250
,
child:
_image
==
null
?
Text
(
''
)
:
Image
.
file
(
_image
),
),
),
SizedBox
(
SizedBox
(
height:
50
,
height:
50
,
...
...
This diff is collapsed.
Click to expand it.
rescueapp/pubspec.yaml
+
1
−
0
View file @
6a5c5b54
...
@@ -23,6 +23,7 @@ environment:
...
@@ -23,6 +23,7 @@ environment:
dependencies
:
dependencies
:
flutter
:
flutter
:
sdk
:
flutter
sdk
:
flutter
image_picker
:
# The following adds the Cupertino Icons font to your application.
# The following adds the Cupertino Icons font to your application.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment