This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
319 additions
and
124 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import "package:flutter/material.dart"; | ||
import "package:flutter_gen/gen_l10n/app_localizations.dart"; | ||
import "package:food_busters/styles/styles.dart"; | ||
|
||
AlertDialog exchangeSuccess(AppLocalizations text, BuildContext context) => | ||
AlertDialog( | ||
title: Text(text.exchange.toUpperCase(), textAlign: TextAlign.center), | ||
backgroundColor: lightGreen, | ||
content: Text(text.exchange_complete), | ||
actions: [ | ||
TextButton( | ||
child: Text( | ||
text.window_close, | ||
style: const TextStyle( | ||
color: Colors.black, | ||
), | ||
), | ||
onPressed: () { | ||
Navigator.of(context).pop(); | ||
}, | ||
), | ||
], | ||
); | ||
|
||
AlertDialog exchangeFailed(AppLocalizations text, BuildContext context) => | ||
AlertDialog( | ||
title: Text(text.exchange.toUpperCase(), textAlign: TextAlign.center), | ||
backgroundColor: rose, | ||
content: Text(text.exchange_failed), | ||
actions: [ | ||
TextButton( | ||
child: Text( | ||
text.window_close, | ||
style: const TextStyle( | ||
color: Colors.black, | ||
), | ||
), | ||
onPressed: () { | ||
Navigator.of(context).pop(); | ||
}, | ||
), | ||
], | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import "package:camera/camera.dart"; | ||
|
||
class AppState { | ||
// * Image Part | ||
XFile? _imageBefore; | ||
XFile? _imageAfter; | ||
|
||
XFile? get imageBefore => _imageBefore; | ||
bool get imageBeforeAvailable => _imageBefore != null; | ||
XFile? get imageAfter => _imageAfter; | ||
bool get imageAfterAvailable => _imageAfter != null; | ||
bool get imageReady => imageBeforeAvailable && imageAfterAvailable; | ||
|
||
void setImageBefore(XFile image) { | ||
_imageBefore = image; | ||
} | ||
|
||
void deleteImageBefore() { | ||
_imageBefore = null; | ||
} | ||
|
||
void setImageAfter(XFile image) { | ||
_imageAfter = image; | ||
} | ||
|
||
// * Points Part | ||
// ! Subjected to be change to server-based rather than local, ephemeral | ||
int _points = 18; | ||
|
||
int get points => _points; | ||
|
||
void addPoints(int points) { | ||
_points += points; | ||
} | ||
|
||
bool usePoints(int points) { | ||
if (_points < points) return false; | ||
_points -= points; | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.