Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Image State Reset on ScanAfter
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Nov 2, 2021
1 parent eeb8c75 commit 136b164
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/models/app_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class AppState {
_imageAfter = image;
}

void resetAllImages() {
_imageBefore = null;
_imageAfter = null;
}

// * Points Part
// ! Subjected to be change to server-based rather than local
// ! for prototype demonstration only
Expand Down
2 changes: 2 additions & 0 deletions lib/views/scan/scanafter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class _ScanAfterPageState extends State<ScanAfterPage> {
pointRecieved = (percent * percent / 100).floor();
appState.addPoints(pointRecieved);

appState.resetAllImages();

final url = Uri.parse(
"https://food-waste-quotes.vercel.app/api/quote?percent=$percent&lang=${MyApp.of(context).localeStrSimp}",
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.117+1170000
version: 1.0.118+1180000

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down

0 comments on commit 136b164

Please sign in to comment.