diff --git a/lib/about.dart b/lib/about.dart index d4dea043b..bb837981d 100644 --- a/lib/about.dart +++ b/lib/about.dart @@ -14,12 +14,10 @@ Future 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, diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 0608bca3a..b0890b589 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -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"), diff --git a/lib/generated/intl/messages_es.dart b/lib/generated/intl/messages_es.dart index 32f0d7f92..b0279958d 100644 --- a/lib/generated/intl/messages_es.dart +++ b/lib/generated/intl/messages_es.dart @@ -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"), @@ -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"), diff --git a/lib/generated/intl/messages_fr.dart b/lib/generated/intl/messages_fr.dart index a4145f920..8ddf8973b 100644 --- a/lib/generated/intl/messages_fr.dart +++ b/lib/generated/intl/messages_fr.dart @@ -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"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 529ea8498..2960c74bb 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -2101,6 +2101,16 @@ class S { args: [], ); } + + /// `Barcode scanner is not available on desktop` + String get barcodeScannerIsNotAvailableOnDesktop { + return Intl.message( + 'Barcode scanner is not available on desktop', + name: 'barcodeScannerIsNotAvailableOnDesktop', + desc: '', + args: [], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 67a2b1306..753d9a59c 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -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" } diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index d81305863..21733fed0 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -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" } diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index baa552d86..ae11e0ffa 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -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" } diff --git a/lib/main.dart b/lib/main.dart index cc1228e76..371586cca 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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) { @@ -533,11 +533,17 @@ bool checkNumber(String s) { int precision(bool? mZEC) => (mZEC == null || mZEC) ? 3 : 8; Future 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) => diff --git a/lib/send.dart b/lib/send.dart index 2e2728cb4..b00aadd15 100644 --- a/lib/send.dart +++ b/lib/send.dart @@ -318,7 +318,7 @@ class SendState extends State { 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( @@ -338,7 +338,7 @@ class SendState extends State { } - 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(); diff --git a/pubspec.lock b/pubspec.lock index ab50f366b..1b3842889 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "31.0.0" + version: "38.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.8.0" + version: "3.4.1" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.2.1" + version: "3.3.0" args: dependency: transitive description: @@ -43,13 +43,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" build: dependency: transitive description: @@ -84,14 +77,14 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.7" + version: "2.1.8" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.2.2" + version: "7.2.3" built_collection: dependency: transitive description: @@ -134,13 +127,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" clock: dependency: transitive description: @@ -175,7 +161,7 @@ packages: name: connectivity_plus url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "2.2.1" connectivity_plus_linux: dependency: transitive description: @@ -252,21 +238,21 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.2" dbus: dependency: transitive description: name: dbus url: "https://pub.dartlang.org" source: hosted - version: "0.7.1" + version: "0.7.3" decimal: dependency: "direct main" description: name: decimal url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "2.1.0" equatable: dependency: transitive description: @@ -274,13 +260,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.3" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" ffi: dependency: transitive description: @@ -301,7 +280,7 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "4.5.0" + version: "4.5.1" fixnum: dependency: transitive description: @@ -315,14 +294,14 @@ packages: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "0.50.1" flex_color_scheme: dependency: "direct main" description: name: flex_color_scheme url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "4.2.0" flutter: dependency: "direct main" description: flutter @@ -357,14 +336,14 @@ packages: name: flutter_colorpicker url: "https://pub.dartlang.org" source: hosted - version: "0.6.1" + version: "1.0.3" flutter_form_builder: dependency: "direct main" description: name: flutter_form_builder url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "7.1.1" flutter_keyboard_visibility: dependency: transitive description: @@ -404,7 +383,7 @@ packages: name: flutter_markdown url: "https://pub.dartlang.org" source: hosted - version: "0.6.9" + version: "0.6.9+1" flutter_mobx: dependency: "direct main" description: @@ -418,7 +397,7 @@ packages: name: flutter_native_splash url: "https://pub.dartlang.org" source: hosted - version: "1.3.2" + version: "2.1.3+1" flutter_palette: dependency: "direct main" description: @@ -446,19 +425,14 @@ packages: name: flutter_speed_dial url: "https://pub.dartlang.org" source: hosted - version: "5.0.0+1" + version: "5.1.0" flutter_svg: dependency: "direct main" description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.22.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" + version: "1.0.3" flutter_typeahead: dependency: "direct main" description: @@ -554,14 +528,14 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.4.0" json_serializable: dependency: "direct dev" description: name: json_serializable url: "https://pub.dartlang.org" source: hosted - version: "5.0.2" + version: "6.1.5" k_chart: dependency: "direct main" description: @@ -606,6 +580,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" material_design_icons_flutter: dependency: "direct main" description: @@ -640,7 +621,7 @@ packages: name: mobx_codegen url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5+2" mustache_template: dependency: "direct main" description: @@ -717,14 +698,14 @@ packages: name: package_info_plus url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.4.2" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" package_info_plus_macos: dependency: transitive description: @@ -745,14 +726,14 @@ packages: name: package_info_plus_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" palette: dependency: transitive description: @@ -773,14 +754,14 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1+1" + version: "1.0.0" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "1.0.0" path_provider: dependency: "direct main" description: @@ -885,14 +866,14 @@ packages: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" qr: dependency: transitive description: @@ -948,7 +929,7 @@ packages: name: rational url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "2.2.0" rflutter_alert: dependency: "direct main" description: @@ -983,7 +964,7 @@ packages: name: share_plus url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "4.0.3" share_plus_linux: dependency: transitive description: @@ -1004,7 +985,7 @@ packages: name: share_plus_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.2" share_plus_web: dependency: transitive description: @@ -1081,7 +1062,7 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" shelf_web_socket: dependency: transitive description: @@ -1135,7 +1116,7 @@ packages: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.2.1" sqflite_common_ffi: dependency: "direct main" description: @@ -1184,7 +1165,7 @@ packages: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.0+2" term_glyph: dependency: transitive description: @@ -1192,13 +1173,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.3" timing: dependency: transitive description: @@ -1296,7 +1270,7 @@ packages: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.9" url_launcher_windows: dependency: transitive description: @@ -1352,7 +1326,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.5.1" xdg_directories: dependency: transitive description: @@ -1375,5 +1349,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.15.0 <3.0.0" - flutter: ">=2.8.0" + dart: ">=2.16.0 <3.0.0" + flutter: ">=2.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index 7b313e9b7..e7e501eba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.2.2+216 +version: 1.2.2+217 environment: sdk: ">=2.12.0 <3.0.0" @@ -40,12 +40,12 @@ dependencies: flutter_markdown: ^0.6.6 package_info_plus: ^1.4.0 velocity_x: ^3.3.0 - decimal: ^1.3.0 - flutter_form_builder: ^6.1.0+1 + decimal: ^2.1.0 + flutter_form_builder: ^7.1.1 url_launcher: ^6.0.10 - flex_color_scheme: ^3.0.1 - flutter_colorpicker: ^0.6.0 - fl_chart: ^0.40.0 + flex_color_scheme: ^4.2.0 + flutter_colorpicker: ^1.0.3 + fl_chart: ^0.50.1 k_chart: git: url: https://github.com/hhanh00/k_chart.git @@ -58,7 +58,7 @@ dependencies: mustache_template: ^2.0.0 rate_my_app: ^1.1.1 flutter_palette: ^1.1.0+1 - flutter_svg: ^0.22.0 + flutter_svg: ^1.0.3 flutter_typeahead: ^3.2.0 flutter_barcode_scanner: git: @@ -67,7 +67,7 @@ dependencies: flutter_speed_dial: ^5.0.0 currency_text_input_formatter: ^2.1.2 sensors_plus: ^1.1.0 - connectivity_plus: ^1.1.0 + connectivity_plus: ^2.2.1 uni_links: ^0.5.1 quick_actions: ^0.6.0 csv: ^5.0.0 @@ -80,15 +80,13 @@ dependencies: cupertino_icons: ^1.0.3 dev_dependencies: - flutter_test: - sdk: flutter build_runner: ^2.1.2 mobx_codegen: ^2.0.3 - json_serializable: ^5.0.0 + json_serializable: ^6.1.5 flutter_launcher_icons: any flutter_app_name: any change_app_package_name: any - flutter_native_splash: ^1.2.3 + flutter_native_splash: ^2.1.3+1 flutter_app_name: name: "YWallet"