Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
fix(camera) : fixed error on camera cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
Vande Perre Nathan authored and PiotrFLEURY committed Sep 22, 2020
1 parent a5cd081 commit 2625d32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Analytics : Added new analytics
- Wishlist color : wishslist color is now fixed on a new wishlist
- Item image : items with old images now have an icon
- Camera : fixed error on camera cancel

### Security

Expand Down
25 changes: 16 additions & 9 deletions lib/pages/items_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,25 @@ class EditItemPageState extends State<EditItemPage> {
}

Future<void> pickImage() async {
await _imageService
.pickCamera(30, 720, 720)
.then((image) => pickedImage = File(image.path));
String path;

setState(() {
_itemImage = Image(
image: FileImage(pickedImage),
fit: BoxFit.cover,
);
await _imageService.pickCamera(30, 720, 720).then((image) {
if (image != null && image.path != null) {
path = image.path;
}
});

imageType = "Picked";
if (path != null) {
pickedImage = File(path);
setState(() {
_itemImage = Image(
image: FileImage(pickedImage),
fit: BoxFit.cover,
);
});

imageType = "Picked";
}
}

int getTypeIndex() {
Expand Down

0 comments on commit 2625d32

Please sign in to comment.