Skip to content

Commit

Permalink
Upgrade pkg dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hhanh00 committed Apr 8, 2022
1 parent 8120c72 commit 0aceb11
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 103 deletions.
10 changes: 4 additions & 6 deletions lib/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ Future<void> showAbout(BuildContext context) async {
final template = Template(contentTemplate);
var content = template.renderString({'APP': APP_NAME});
String? versionString;
if (isMobile()) {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
String code = packageInfo.buildNumber;
versionString = "${s.version}: $version+$code";
}
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
String code = packageInfo.buildNumber;
versionString = "${s.version}: $version+$code";
final mq = MediaQuery.of(context);
showDialog(
context: context,
Expand Down
3 changes: 3 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ class MessageLookup extends MessageLookupByLibrary {
"backupWarning": MessageLookupByLibrary.simpleMessage(
"No one can recover your secret keys. If you don\'t have a backup and your phone breaks down, you WILL LOSE YOUR MONEY. You can reach this page by the app menu then Backup"),
"balance": MessageLookupByLibrary.simpleMessage("Balance"),
"barcodeScannerIsNotAvailableOnDesktop":
MessageLookupByLibrary.simpleMessage(
"Barcode scanner is not available on desktop"),
"blue": MessageLookupByLibrary.simpleMessage("Blue"),
"broadcast": MessageLookupByLibrary.simpleMessage("Broadcast"),
"budget": MessageLookupByLibrary.simpleMessage("Budget"),
Expand Down
5 changes: 4 additions & 1 deletion lib/generated/intl/messages_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ class MessageLookup extends MessageLookupByLibrary {
"backupWarning": MessageLookupByLibrary.simpleMessage(
"Nadie puede recuperar sus claves secretas. Si no tiene una copia de seguridad, PERDERÁ SU DINERO si su teléfono se avería. Puede acceder a esta página mediante el menú de la aplicación y luego \'Copia de Seguridad\'"),
"balance": MessageLookupByLibrary.simpleMessage("Saldo"),
"barcodeScannerIsNotAvailableOnDesktop":
MessageLookupByLibrary.simpleMessage(
"El escáner de código de barras no está disponible en el escritorio"),
"blue": MessageLookupByLibrary.simpleMessage("Azul"),
"broadcast": MessageLookupByLibrary.simpleMessage("Transmisión"),
"budget": MessageLookupByLibrary.simpleMessage("Presupuesto"),
Expand Down Expand Up @@ -200,7 +203,7 @@ class MessageLookup extends MessageLookupByLibrary {
"memo": MessageLookupByLibrary.simpleMessage("Nota"),
"mm": MessageLookupByLibrary.simpleMessage("M/M"),
"mobileCharges": MessageLookupByLibrary.simpleMessage(
"On Mobile Data, scanning may incur additional charges. Do you want to proceed?"),
"En datos móviles, el escaneo puede incurrir en cargos adicionales. Quieres proceder?"),
"mode": MessageLookupByLibrary.simpleMessage("Modo"),
"multiPay": MessageLookupByLibrary.simpleMessage("Multi Pagos"),
"multipay": MessageLookupByLibrary.simpleMessage("MultiPagos"),
Expand Down
3 changes: 3 additions & 0 deletions lib/generated/intl/messages_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ class MessageLookup extends MessageLookupByLibrary {
"backupWarning": MessageLookupByLibrary.simpleMessage(
"Vos clés ne sont pas récupérables. Si vous n\'avez pas de sauvegarde, vous pouvez PERDREZ VOTRE ARGENT. Cette page est accessible par Menu ... / Sauvegarde"),
"balance": MessageLookupByLibrary.simpleMessage("Solde"),
"barcodeScannerIsNotAvailableOnDesktop":
MessageLookupByLibrary.simpleMessage(
"Le Barcode scanner est seulement disponible sur mobile"),
"blue": MessageLookupByLibrary.simpleMessage("Bleu"),
"broadcast": MessageLookupByLibrary.simpleMessage("Diffusion"),
"budget": MessageLookupByLibrary.simpleMessage("Budget"),
Expand Down
10 changes: 10 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,6 @@
"disconnected": "Disconnected",
"ledger": "Ledger",
"mobileCharges": "On Mobile Data, scanning may incur additional charges. Do you want to proceed?",
"iHaveMadeABackup": "I have made a backup"
"iHaveMadeABackup": "I have made a backup",
"barcodeScannerIsNotAvailableOnDesktop": "Barcode scanner is not available on desktop"
}
5 changes: 3 additions & 2 deletions lib/l10n/intl_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"pleaseRestartNow": "Please Restart now",
"disconnected": "Disconnected",
"ledger": "Ledger",
"mobileCharges": "On Mobile Data, scanning may incur additional charges. Do you want to proceed?",
"iHaveMadeABackup": "He hecho una copia de seguridad"
"mobileCharges": "En datos móviles, el escaneo puede incurrir en cargos adicionales. Quieres proceder?",
"iHaveMadeABackup": "He hecho una copia de seguridad",
"barcodeScannerIsNotAvailableOnDesktop": "El escáner de código de barras no está disponible en el escritorio"
}
3 changes: 2 additions & 1 deletion lib/l10n/intl_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,6 @@
"disconnected": "Déconnecté",
"ledger": "Ledger",
"mobileCharges": "Sans Wi-fi, les frais peuvent être élevés. Voulez vous continuer?",
"iHaveMadeABackup": "J'ai fait une sauvegarde"
"iHaveMadeABackup": "J'ai fait une sauvegarde",
"barcodeScannerIsNotAvailableOnDesktop": "Le Barcode scanner est seulement disponible sur mobile"
}
18 changes: 12 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ double parseNumber(String? s) {

int stringToAmount(String? s) {
final a = parseNumber(s);
return (Decimal.parse(a.toString()) * ZECUNIT_DECIMAL).toInt();
return (Decimal.parse(a.toString()) * ZECUNIT_DECIMAL).toBigInt().toInt();
}

bool checkNumber(String s) {
Expand All @@ -533,11 +533,17 @@ bool checkNumber(String s) {
int precision(bool? mZEC) => (mZEC == null || mZEC) ? 3 : 8;

Future<String?> scanCode(BuildContext context) async {
final code = await FlutterBarcodeScanner.scanBarcode('#FF0000', S
.of(context)
.cancel, true, ScanMode.QR);
if (code == "-1") return null;
return code;
if (!isMobile()) {
showSnackBar(S.of(context).barcodeScannerIsNotAvailableOnDesktop);
return null;
}
else {
final code = await FlutterBarcodeScanner.scanBarcode('#FF0000', S
.of(context)
.cancel, true, ScanMode.QR);
if (code == "-1") return null;
return code;
}
}

String addressLeftTrim(String address) =>
Expand Down
4 changes: 2 additions & 2 deletions lib/send.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class SendState extends State<SendPage> {
context, () => Navigator.of(context).pop(true),
okLabel: s.approve, cancelValue: false)));
if (approved) {
int maxAmountPerNote = (_maxAmountPerNote * ZECUNIT_DECIMAL).toInt();
int maxAmountPerNote = (_maxAmountPerNote * ZECUNIT_DECIMAL).toBigInt().toInt();
final memo = _memoController.text;
final address = unwrapUA(_address);
final recipient = Recipient(
Expand All @@ -338,7 +338,7 @@ class SendState extends State<SendPage> {
}


int amountInZAT(Decimal v) => (v * ZECUNIT_DECIMAL).toInt();
int amountInZAT(Decimal v) => (v * ZECUNIT_DECIMAL).toBigInt().toInt();

String amountFromZAT(int v) =>
(Decimal.fromInt(v) / ZECUNIT_DECIMAL).toString();
Expand Down
Loading

0 comments on commit 0aceb11

Please sign in to comment.