From 655c76bad31e692b177e3fd33b3e22479ff1c09a Mon Sep 17 00:00:00 2001 From: ruben beck Date: Mon, 16 Oct 2023 14:13:16 +0200 Subject: [PATCH 1/6] use onPress to display fiat --- lib/widgets/payment_request_info_dialog.dart | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/widgets/payment_request_info_dialog.dart b/lib/widgets/payment_request_info_dialog.dart index 0985c15c9..f304088f1 100644 --- a/lib/widgets/payment_request_info_dialog.dart +++ b/lib/widgets/payment_request_info_dialog.dart @@ -205,14 +205,9 @@ class PaymentRequestInfoDialogState extends State { return GestureDetector( behavior: HitTestBehavior.translucent, - onLongPressStart: (_) { + onTap: () { setState(() { - _showFiatCurrency = true; - }); - }, - onLongPressEnd: (_) { - setState(() { - _showFiatCurrency = false; + _showFiatCurrency = !_showFiatCurrency; }); }, child: ConstrainedBox( From a850fb1a06ff5565398f57a4c85de00f19828560 Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Mon, 16 Oct 2023 12:57:31 +0300 Subject: [PATCH 2/6] Fixes #1232 --- .../transfer_funds_in_progress_dialog.dart | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/routes/transfer_funds_in_progress_dialog.dart b/lib/routes/transfer_funds_in_progress_dialog.dart index 64357df7e..2f666e47b 100644 --- a/lib/routes/transfer_funds_in_progress_dialog.dart +++ b/lib/routes/transfer_funds_in_progress_dialog.dart @@ -29,15 +29,26 @@ class _TransferFundsInProgressDialog extends StatefulWidget { class _TransferFundsInProgressDialogState extends State<_TransferFundsInProgressDialog> { StreamSubscription _stateSubscription; + ModalRoute _currentRoute; @override void initState() { super.initState(); _stateSubscription = widget.accountStream.listen((state) { - if (state.transferringOnChainDeposit != true) { - _pop(); + if (state.transferringOnChainDeposit != true && _currentRoute.isActive) { + Navigator.of(context).removeRoute(_currentRoute); } - }, onError: (err) => _pop()); + }, onError: (err) { + if (_currentRoute.isActive) { + Navigator.of(context).removeRoute(_currentRoute); + } + }); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + _currentRoute ??= ModalRoute.of(context); } @override @@ -46,13 +57,10 @@ class _TransferFundsInProgressDialogState super.dispose(); } - _pop() { - Navigator.of(context).pop(); - } - @override Widget build(BuildContext context) { final texts = context.texts(); + return createAnimatedLoaderDialog( context, texts.transferring_funds_title, From ea8ea296d97df5e67d86fce3617341150e62b8b1 Mon Sep 17 00:00:00 2001 From: Ademar Alves de Oliveira Date: Mon, 16 Oct 2023 09:41:15 -0300 Subject: [PATCH 3/6] Fix same invoice not read by qrcode scan twice in a row --- android/build.gradle | 6 ++++- lib/routes/home/qr_action_button.dart | 25 +++++++++++--------- lib/routes/qr_scan.dart | 34 ++++++++++++++------------- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 5 files changed, 40 insertions(+), 31 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b95905377..f4e5e47be 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,8 @@ buildscript { + ext { + kotlin_version = "1.9.10" + } + repositories { google() mavenCentral() @@ -7,7 +11,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.1.3' classpath 'com.google.gms:google-services:4.3.15' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/lib/routes/home/qr_action_button.dart b/lib/routes/home/qr_action_button.dart index 65c07cbf7..9f1533598 100644 --- a/lib/routes/home/qr_action_button.dart +++ b/lib/routes/home/qr_action_button.dart @@ -23,9 +23,12 @@ import 'package:breez/widgets/route.dart'; import 'package:breez_translations/breez_translations_locales.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:logging/logging.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:validators/validators.dart'; +final _log = Logger("QrActionButton"); + class QrActionButton extends StatefulWidget { final GlobalKey firstPaymentItemKey; @@ -52,11 +55,11 @@ class _QrActionButtonState extends State { height: 64, child: FloatingActionButton( onPressed: () async { - log.finest("Start qr code scan"); + _log.finest("Start qr code scan"); final navigator = Navigator.of(context); navigator.pushNamed("/qr_scan").then( (scannedString) async { - log.finest("Scanned string: '$scannedString'"); + _log.finest("Scanned string: '$scannedString'"); if (scannedString != null) { if (scannedString.isEmpty) { showFlushbar( @@ -69,7 +72,7 @@ class _QrActionButtonState extends State { // lnurl string if (isLNURL(lower)) { - log.finest("Scanned string is a lnurl"); + _log.finest("Scanned string is a lnurl"); await _handleLNUrl(lnurlBloc, scannedString); return; } @@ -77,7 +80,7 @@ class _QrActionButtonState extends State { // lightning address final v = parseLightningAddress(scannedString); if (v != null) { - log.finest("Scanned string is a lightning address"); + _log.finest("Scanned string is a lightning address"); lnurlBloc.lnurlInputSink.add(v); return; } @@ -85,7 +88,7 @@ class _QrActionButtonState extends State { // bip 21 String lnInvoice = extractBolt11FromBip21(lower); if (lnInvoice != null) { - log.finest( + _log.finest( "Scanned string is a bolt11 extract from bip 21", ); lower = lnInvoice; @@ -94,7 +97,7 @@ class _QrActionButtonState extends State { // regular lightning invoice. if (lower.startsWith("lightning:") || lower.startsWith("ln")) { - log.finest("Scanned string is a regular lightning invoice"); + _log.finest("Scanned string is a regular lightning invoice"); invoiceBloc.decodeInvoiceSink.add(scannedString); return; } @@ -103,7 +106,7 @@ class _QrActionButtonState extends State { BTCAddressInfo btcInvoice = parseBTCAddress(scannedString); if (await _isBTCAddress(btcInvoice.address)) { - log.finest("Scanned string is a bitcoin address"); + _log.finest("Scanned string is a bitcoin address"); String requestAmount; if (btcInvoice.satAmount != null) { final account = @@ -127,7 +130,7 @@ class _QrActionButtonState extends State { var nodeID = parseNodeId(scannedString); if (nodeID != null) { - log.finest("Scanned string is a node id"); + _log.finest("Scanned string is a node id"); navigator.push( FadeInRoute( builder: (_) => SpontaneousPaymentPage( @@ -141,7 +144,7 @@ class _QrActionButtonState extends State { // Open on whenever app the system links to if (await canLaunchUrlString(scannedString)) { - log.finest("Scanned string is a launchable url"); + _log.finest("Scanned string is a launchable url"); _handleWebAddress(scannedString); return; } @@ -153,12 +156,12 @@ class _QrActionButtonState extends State { allowUnderscore: true, ); if (validUrl) { - log.finest("Scanned string is a valid url"); + _log.finest("Scanned string is a valid url"); _handleWebAddress(scannedString); return; } - log.finest("Scanned string is unrecognized"); + _log.finest("Scanned string is unrecognized"); showFlushbar( context, message: texts.qr_action_button_error_code_not_processed, diff --git a/lib/routes/qr_scan.dart b/lib/routes/qr_scan.dart index a108bd1cc..b0688290a 100644 --- a/lib/routes/qr_scan.dart +++ b/lib/routes/qr_scan.dart @@ -1,14 +1,17 @@ +import 'dart:async'; import 'dart:io'; -import 'package:breez/logger.dart'; import 'package:breez/widgets/scan_overlay.dart'; import 'package:breez_translations/breez_translations_locales.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:logging/logging.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; +final _log = Logger("QRScan"); + class QRScan extends StatefulWidget { @override State createState() { @@ -17,10 +20,8 @@ class QRScan extends StatefulWidget { } class QRScanState extends State { - final GlobalKey qrKey = GlobalKey(debugLabel: 'QR'); var popped = false; MobileScannerController cameraController = MobileScannerController( - detectionSpeed: DetectionSpeed.noDuplicates, facing: CameraFacing.back, torchEnabled: false, ); @@ -40,19 +41,22 @@ class QRScanState extends State { Expanded( flex: 5, child: MobileScanner( - key: qrKey, controller: cameraController, onDetect: (capture) { + _log.info("Detected QR code: $capture"); final List barcodes = capture.barcodes; for (final barcode in barcodes) { - log.info("Barcode detected: $barcode"); - if (popped || !mounted) return; + _log.info("Barcode detected: $barcode"); + if (popped || !mounted) { + _log.fine("QR code detected after pop"); + return; + } if (barcode.rawValue == null) { - log.warning("Failed to scan QR code."); + _log.warning("Failed to scan QR code."); } else { popped = true; final String code = barcode.rawValue; - log.info("Popping read QR code $code"); + _log.info("Popping read QR code $code"); Navigator.of(context).pop(code); } } @@ -114,27 +118,25 @@ class ImagePickerButton extends StatelessWidget { onPressed: () async { final scaffoldMessenger = ScaffoldMessenger.of(context); final picker = ImagePicker(); - XFile pickedFile = await picker - .pickImage(source: ImageSource.gallery) - .catchError((err) { - log.warning("Failed to pick image", err); + XFile pickedFile = await picker.pickImage(source: ImageSource.gallery).catchError((err) { + _log.warning("Failed to pick image", err); }); - log.info("Picked image: ${pickedFile.path}"); + _log.info("Picked image: ${pickedFile.path}"); final File file = File(pickedFile.path); try { final found = await cameraController.analyzeImage(file.path); if (!found) { - log.info("No QR code found in image"); + _log.info("No QR code found in image"); scaffoldMessenger.showSnackBar( SnackBar( content: Text(texts.qr_scan_gallery_failed), ), ); } else { - log.info("QR code found in image"); + _log.info("QR code found in image"); } } catch (err) { - log.warning("Failed to analyze image", err); + _log.warning("Failed to analyze image", err); } }, ); diff --git a/pubspec.lock b/pubspec.lock index 05e020002..1f2559625 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1255,10 +1255,10 @@ packages: dependency: "direct main" description: name: mobile_scanner - sha256: "54dd914e1bb5758b3db7aa02e56d65d80285ba0705e0e5fa5cfbb11e27344c4b" + sha256: "2fbc3914fe625e196c64ea8ffc4084cd36781d2be276d4d5923b11af3b5d44ff" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.1" mockito: dependency: "direct dev" description: diff --git a/pubspec.yaml b/pubspec.yaml index 03a4ade2e..a728ef869 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,7 +70,7 @@ dependencies: protobuf: <3.0.0 # Requires Flutter 3.10 provider: ^6.0.5 meta: ^1.9.1 - mobile_scanner: <3.4.0 # Requires Flutter 3.10 / Kotlin upgrade + mobile_scanner: ^3.4.1 # qr_flutter has already fixed the build issue with the qr package but did not publish an updated # version, they will publish as 4.0.1 for now they recommend to use the master but instead of that # we are using an specific commit to avoid unexpected behaviour in future builds. From 50d307a986d66e73bc33f1b168e5a10dc5c18a3c Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Tue, 17 Oct 2023 12:04:37 +0300 Subject: [PATCH 4/6] Remove unused imports --- lib/routes/home/qr_action_button.dart | 5 +++-- lib/routes/qr_scan.dart | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/routes/home/qr_action_button.dart b/lib/routes/home/qr_action_button.dart index 9f1533598..8a13c1932 100644 --- a/lib/routes/home/qr_action_button.dart +++ b/lib/routes/home/qr_action_button.dart @@ -6,7 +6,6 @@ import 'package:breez/bloc/lnurl/lnurl_actions.dart'; import 'package:breez/bloc/lnurl/lnurl_bloc.dart'; import 'package:breez/bloc/user_profile/user_profile_bloc.dart'; import 'package:breez/handlers/lnurl_handler.dart'; -import 'package:breez/logger.dart'; import 'package:breez/routes/spontaneous_payment/spontaneous_payment_page.dart'; import 'package:breez/routes/withdraw_funds/reverse_swap_page.dart'; import 'package:breez/services/injector.dart'; @@ -97,7 +96,9 @@ class _QrActionButtonState extends State { // regular lightning invoice. if (lower.startsWith("lightning:") || lower.startsWith("ln")) { - _log.finest("Scanned string is a regular lightning invoice"); + _log.finest( + "Scanned string is a regular lightning invoice", + ); invoiceBloc.decodeInvoiceSink.add(scannedString); return; } diff --git a/lib/routes/qr_scan.dart b/lib/routes/qr_scan.dart index b0688290a..72e6e7cad 100644 --- a/lib/routes/qr_scan.dart +++ b/lib/routes/qr_scan.dart @@ -1,4 +1,3 @@ -import 'dart:async'; import 'dart:io'; import 'package:breez/widgets/scan_overlay.dart'; @@ -118,9 +117,12 @@ class ImagePickerButton extends StatelessWidget { onPressed: () async { final scaffoldMessenger = ScaffoldMessenger.of(context); final picker = ImagePicker(); - XFile pickedFile = await picker.pickImage(source: ImageSource.gallery).catchError((err) { - _log.warning("Failed to pick image", err); - }); + XFile pickedFile = + await picker.pickImage(source: ImageSource.gallery).catchError( + (err) { + _log.warning("Failed to pick image", err); + }, + ); _log.info("Picked image: ${pickedFile.path}"); final File file = File(pickedFile.path); try { From 842bbf2e651130c141637bfc389f2012fb25b16a Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Tue, 17 Oct 2023 12:16:01 +0300 Subject: [PATCH 5/6] Update dependencies --- ios/Podfile.lock | 44 +++++++------- pubspec.lock | 148 +++++++++++++++++++++++------------------------ 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cb987fbc8..8c3c9f889 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - app_settings (4.3.0): + - app_settings (5.1.1): - Flutter - AppAuth (1.6.2): - AppAuth/Core (= 1.6.2) @@ -70,18 +70,18 @@ PODS: - Firebase/Messaging (10.15.0): - Firebase/CoreOnly - FirebaseMessaging (~> 10.15.0) - - firebase_core (2.16.0): + - firebase_core (2.17.0): - Firebase/CoreOnly (= 10.15.0) - Flutter - - firebase_database (10.2.6): + - firebase_database (10.2.7): - Firebase/Database (= 10.15.0) - firebase_core - Flutter - - firebase_dynamic_links (5.3.6): + - firebase_dynamic_links (5.3.7): - Firebase/DynamicLinks (= 10.15.0) - firebase_core - Flutter - - firebase_messaging (14.6.8): + - firebase_messaging (14.6.9): - Firebase/Messaging (= 10.15.0) - firebase_core - Flutter @@ -89,14 +89,14 @@ PODS: - FirebaseCoreInternal (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Logger (~> 7.8) - - FirebaseCoreInternal (10.15.0): + - FirebaseCoreInternal (10.16.0): - "GoogleUtilities/NSData+zlib (~> 7.8)" - FirebaseDatabase (10.15.0): - FirebaseCore (~> 10.0) - leveldb-library (~> 1.22) - FirebaseDynamicLinks (10.15.0): - FirebaseCore (~> 10.0) - - FirebaseInstallations (10.15.0): + - FirebaseInstallations (10.16.0): - FirebaseCore (~> 10.0) - GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/UserDefaults (~> 7.8) @@ -223,9 +223,9 @@ PODS: - Flutter - PromisesObjC (2.3.1) - ReachabilitySwift (5.0.0) - - SDWebImage (5.18.1): - - SDWebImage/Core (= 5.18.1) - - SDWebImage/Core (5.18.1) + - SDWebImage (5.18.3): + - SDWebImage/Core (= 5.18.3) + - SDWebImage/Core (5.18.3) - share_plus (0.0.1): - Flutter - shared_preferences_foundation (0.0.1): @@ -392,28 +392,28 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: - app_settings: ee4ae4d1c9a907a23b81c40e5c56a5ca8a20a62b + app_settings: 017320c6a680cdc94c799949d95b84cb69389ebc AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570 audio_service: f509d65da41b9521a61f1c404dd58651f265a567 audio_session: 4f3e461722055d21515cf3261b64c973c062f345 clipboard_watcher: 86fb70421aca6f4944e0591a8292605da7784666 connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a - device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea + device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6 DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 ffmpeg-kit-ios-https-gpl: e43266620f2b601959b473be4a09ea190d7d9c40 ffmpeg_kit_flutter_https_gpl: 6434a09be0b21b6ee399e855935684f5e81cb5b7 file_picker: ce3938a0df3cc1ef404671531facef740d03f920 Firebase: 66043bd4579e5b73811f96829c694c7af8d67435 - firebase_core: 77172d0a9d8d19d07606e24406e4c2fc14d3265b - firebase_database: 99bb3411da9863a065d38ef645bf160a2410762a - firebase_dynamic_links: 27625ac999a9353d6e323c07db85c3b55c5c6839 - firebase_messaging: 6aff54d420b7ce7080c26dd131b08bc632666852 + firebase_core: 28e84c2a4fcf6a50ef83f47b145ded8c1fa331e4 + firebase_database: 1af9fdbaef52dd3be040be031db086cd2b450133 + firebase_dynamic_links: 52f5d054c676061cf17f4390f3bad9cc964cfdeb + firebase_messaging: 91ec967913a5d144f951b3c3ac17a57796d38735 FirebaseCore: 2cec518b43635f96afe7ac3a9c513e47558abd2e - FirebaseCoreInternal: 2f4bee5ed00301b5e56da0849268797a2dd31fb4 + FirebaseCoreInternal: 26233f705cc4531236818a07ac84d20c333e505a FirebaseDatabase: f93f1481c7e9e3d77af960cdff82a408d37693e6 FirebaseDynamicLinks: 206d4ed3efd2b722822598017f3980d9fda89815 - FirebaseInstallations: cae95cab0f965ce05b805189de1d4c70b11c76fb + FirebaseInstallations: b822f91a61f7d1ba763e5ccc9d4f2e6f2ed3b3ee FirebaseMessaging: 0c0ae1eb722ef0c07f7801e5ded8dccd1357d6d4 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39 @@ -443,14 +443,14 @@ SPEC CHECKSUMS: nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431 nfc_in_flutter: c656fbfb1ec5b9d021da87b0c87629d62fd5264d nfc_manager: d7da7cb781f7744b94df5fe9dbca904ac4a0939e - package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7 + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 printing: 233e1b73bd1f4a05615548e9b5a324c98588640b PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 - SDWebImage: ebdbcebc7933a45226d9313bd0118bc052ad458b - share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028 + SDWebImage: 96e0c18ef14010b7485210e92fac888587ebb958 + share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f @@ -462,4 +462,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: ef7fa92d8242f8f58d9aa60a4928be7b473f69a9 -COCOAPODS: 1.12.1 +COCOAPODS: 1.13.0 diff --git a/pubspec.lock b/pubspec.lock index 1f2559625..b5026f8ba 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "2d8e8e123ca3675625917f535fcc0d3a50092eef44334168f9b18adc050d4c6e" + sha256: d84d98f1992976775f83083523a34c5d22fea191eec3abb2bd09537fb623c2e0 url: "https://pub.dev" source: hosted - version: "1.3.6" + version: "1.3.7" analyzer: dependency: transitive description: @@ -46,18 +46,18 @@ packages: dependency: "direct main" description: name: app_settings - sha256: "67ca58aba6ec311d89597c2716d2e37da54b8c7cef28b7749e6551c57f88c1f4" + sha256: "09bc7fe0313a507087bec1a3baf555f0576e816a760cbb31813a88890a09d9e5" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.1.1" archive: dependency: "direct main" description: name: archive - sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e + sha256: "7e0d52067d05f2e0324268097ba723b71cb41ac8a6a2b24d1edf9c536b987b03" url: "https://pub.dev" source: hosted - version: "3.3.9" + version: "3.4.6" args: dependency: transitive description: @@ -231,10 +231,10 @@ packages: dependency: transitive description: name: build_resolvers - sha256: d912852cce27c9e80a93603db721c267716894462e7033165178b91138587972 + sha256: "0713a05b0386bd97f9e63e78108805a4feca5898a4b821d6610857f10c91e975" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" build_runner: dependency: "direct dev" description: @@ -263,10 +263,10 @@ packages: dependency: transitive description: name: built_value - sha256: ff627b645b28fb8bdb69e645f910c2458fd6b65f6585c3a53e0626024897dedf + sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74 url: "https://pub.dev" source: hosted - version: "8.6.2" + version: "8.6.3" characters: dependency: transitive description: @@ -311,10 +311,10 @@ packages: dependency: transitive description: name: code_builder - sha256: "315a598c7fbe77f22de1c9da7cfd6fd21816312f16ffa124453b4fc679e540f1" + sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677" url: "https://pub.dev" source: hosted - version: "4.6.0" + version: "4.7.0" collection: dependency: "direct main" description: @@ -367,10 +367,10 @@ packages: dependency: transitive description: name: cross_file - sha256: fd832b5384d0d6da4f6df60b854d33accaaeb63aa9e10e736a87381f08dee2cb + sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c" url: "https://pub.dev" source: hosted - version: "0.3.3+5" + version: "0.3.3+6" crypto: dependency: "direct main" description: @@ -391,10 +391,10 @@ packages: dependency: "direct main" description: name: csv - sha256: "016b31a51a913744a0a1655c74ff13c9379e1200e246a03d96c81c5d9ed297b5" + sha256: "142bdf2b24f4a49e35a0fc4398f21d861c4c0f9015e8054dcacd0bb8e23ee27d" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "5.1.0" cupertino_icons: dependency: transitive description: @@ -432,10 +432,10 @@ packages: dependency: transitive description: name: device_info_plus - sha256: "86add5ef97215562d2e090535b0a16f197902b10c369c558a100e74ea06e8659" + sha256: "7035152271ff67b072a211152846e9f1259cf1be41e34cd3e0b5463d2d6b8419" url: "https://pub.dev" source: hosted - version: "9.0.3" + version: "9.1.0" device_info_plus_platform_interface: dependency: transitive description: @@ -448,10 +448,10 @@ packages: dependency: "direct main" description: name: dio - sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197 + sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7" url: "https://pub.dev" source: hosted - version: "5.3.2" + version: "5.3.3" drag_and_drop_lists: dependency: "direct main" description: @@ -576,10 +576,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "675c209c94a1817649137cbd113fc4c9ae85e48d03dd578629abbec6d8a4d93d" + sha256: "95580fa07c8ca3072a2bb1fecd792616a33f8683477d25b7d29d3a6a399e6ece" url: "https://pub.dev" source: hosted - version: "2.16.0" + version: "2.17.0" firebase_core_platform_interface: dependency: "direct main" description: @@ -600,66 +600,66 @@ packages: dependency: "direct main" description: name: firebase_database - sha256: "7093870701acd690f8c576c37cf376a2f9c07d87de73541e728b943c30062e5f" + sha256: b3b63057fe46a25e055861d8e66ee1e7cf4227ae968f6a69f8bfd8542995e01b url: "https://pub.dev" source: hosted - version: "10.2.6" + version: "10.2.7" firebase_database_platform_interface: dependency: transitive description: name: firebase_database_platform_interface - sha256: "17e3450028761daf45715ea80db8ca22bd95f4a76bdbcab717b20a023ee889b9" + sha256: da370480b52e38a83cd9cc3a4a75652e97432026d068291c6d24060ed4e72cd0 url: "https://pub.dev" source: hosted - version: "0.2.5+6" + version: "0.2.5+7" firebase_database_web: dependency: transitive description: name: firebase_database_web - sha256: bca2860f7fe737cd1b9ba10666a5b8b157f4f6ac906265d6eb298c93f2dbfc4f + sha256: "9e14532089bc2ec0fb3d3f1365c49213e7b4c3367357b69ba7fbf05d51917479" url: "https://pub.dev" source: hosted - version: "0.2.3+6" + version: "0.2.3+7" firebase_dynamic_links: dependency: "direct main" description: name: firebase_dynamic_links - sha256: "3747775b9d9a4500af1be160879068e1f44acff2e51b62727ab5554aa075b117" + sha256: c37784a4b663b9351894c921a991647e9fb7d6c7b1c0cbd0d8a28f8abe0dfb38 url: "https://pub.dev" source: hosted - version: "5.3.6" + version: "5.3.7" firebase_dynamic_links_platform_interface: dependency: transitive description: name: firebase_dynamic_links_platform_interface - sha256: "110d5d35891f7c6a596940b21cb60d38819c0818982094c9e37ede056bef8979" + sha256: "8f445e4c8f4ca7e463f4a75e777c8d72431103dd79e26f71393d66bc21dcd2df" url: "https://pub.dev" source: hosted - version: "0.2.6+6" + version: "0.2.6+7" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: "4544524c22de3ffdc7e0ffaeeba212a04d09e76d0549ae6f42ce285d9d8f0513" + sha256: "67f9d7c87457e71ad78ee81e332f232b8a24f7d5e338f8c958fa7d6e9e0e3636" url: "https://pub.dev" source: hosted - version: "14.6.8" + version: "14.6.9" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: a6e1fae8242a14d5d8f5ab1cf94693511f06bab49ff1d46e3d83c0af3c4becb8 + sha256: "8c7ced3201886ad7ba37f344c1468ccfc08abb3023922e0e5a016eaf38abb96c" url: "https://pub.dev" source: hosted - version: "4.5.7" + version: "4.5.8" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: a9fe837dc2dcdd3e32e6109a6b0ce62592d7a44cb8f69cb5b73190865c5aa28e + sha256: b601322bdb44e2fefe4cc7b85ef0dbb7a2479d4a7653a51340821cf8d60696b5 url: "https://pub.dev" source: hosted - version: "3.5.7" + version: "3.5.8" fixnum: dependency: "direct main" description: @@ -1006,10 +1006,10 @@ packages: dependency: "direct main" description: name: image - sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf + sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271" url: "https://pub.dev" source: hosted - version: "4.0.17" + version: "4.1.3" image_cropper: dependency: "direct main" description: @@ -1046,10 +1046,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "47da2161c2e9f8f8a9cbbd89d466d174333fbdd769aeed848912e0b16d9cb369" + sha256: "0c7b83bbe2980c8a8e36e974f055e11e51675784e13a4762889feed0f3937ff2" url: "https://pub.dev" source: hosted - version: "0.8.8" + version: "0.8.8+1" image_picker_for_web: dependency: transitive description: @@ -1239,10 +1239,10 @@ packages: dependency: "direct main" description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" mime: dependency: transitive description: @@ -1336,10 +1336,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: @@ -1464,10 +1464,10 @@ packages: dependency: transitive description: name: permission_handler_platform_interface - sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2 + sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4" url: "https://pub.dev" source: hosted - version: "3.11.5" + version: "3.12.0" permission_handler_windows: dependency: transitive description: @@ -1488,10 +1488,10 @@ packages: dependency: transitive description: name: platform - sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" plugin_platform_interface: dependency: "direct main" description: @@ -1618,26 +1618,26 @@ packages: dependency: "direct main" description: name: share_plus - sha256: "6cec740fa0943a826951223e76218df002804adb588235a8910dc3d6b0654e11" + sha256: f74fc3f1cbd99f39760182e176802f693fa0ec9625c045561cfad54681ea93dd url: "https://pub.dev" source: hosted - version: "7.1.0" + version: "7.2.1" share_plus_platform_interface: dependency: transitive description: name: share_plus_platform_interface - sha256: "357412af4178d8e11d14f41723f80f12caea54cf0d5cd29af9dcdab85d58aea7" + sha256: df08bc3a07d01f5ea47b45d03ffcba1fa9cd5370fb44b3f38c70e42cced0f956 url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.3.1" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_android: dependency: transitive description: @@ -1658,10 +1658,10 @@ packages: dependency: transitive description: name: shared_preferences_linux - sha256: c2eb5bf57a2fe9ad6988121609e47d3e07bb3bdca5b6f8444e4cf302428a128a + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" shared_preferences_platform_interface: dependency: transitive description: @@ -1682,10 +1682,10 @@ packages: dependency: transitive description: name: shared_preferences_windows - sha256: f763a101313bd3be87edffe0560037500967de9c394a714cd598d945517f694f + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" shelf: dependency: transitive description: @@ -1903,10 +1903,10 @@ packages: dependency: "direct main" description: name: tutorial_coach_mark - sha256: ba60583d1b500111bf5040eb24330862b25162d926f72923b8e45c16621878b0 + sha256: "1f1fd234790afb929dec7391a4d90aa54ffe8c8e4d278d9283df8e3f5ac5d63e" url: "https://pub.dev" source: hosted - version: "1.2.9" + version: "1.2.11" typed_data: dependency: transitive description: @@ -2023,26 +2023,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + sha256: b16dadf7eb610e20da044c141b4a0199a5e8082ca21daba68322756f953ce714 url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.9" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + sha256: a4b01403d5c613db115e30e71eca33f7e9e09f2d3c52c3fb84e16333ecddc539 url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.9" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + sha256: d26c0e2f237476426523eb25512e4c09fa27c6d33ed659a0e69d79e20b5dc47f url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.9" vector_math: dependency: transitive description: @@ -2095,18 +2095,18 @@ packages: dependency: "direct main" description: name: webview_flutter - sha256: "82f6787d5df55907aa01e49bd9644f4ed1cc82af7a8257dd9947815959d2e755" + sha256: c1ab9b81090705c6069197d9fdc1625e587b52b8d70cdde2339d177ad0dbb98e url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "4.4.1" webview_flutter_android: dependency: "direct main" description: name: webview_flutter_android - sha256: ddc167c6676f57c8b367d19fcbee267d6dc6adf81bd6c3cb87981d30746e0a6d + sha256: b0cd33dd7d3dd8e5f664e11a19e17ba12c352647269921a3b568406b001f1dff url: "https://pub.dev" source: hosted - version: "3.10.1" + version: "3.12.0" webview_flutter_platform_interface: dependency: transitive description: @@ -2119,10 +2119,10 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: d2f7241849582da80b79acb03bb936422412ce5c0c79fb5f6a1de5421a5aecc4 + sha256: "30b9af6bdd457b44c08748b9190d23208b5165357cc2eb57914fee1366c42974" url: "https://pub.dev" source: hosted - version: "3.7.4" + version: "3.9.1" win32: dependency: transitive description: From e57bc5ae5bb63384ef02ec698bc24a29411b761a Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Tue, 17 Oct 2023 11:55:20 +0300 Subject: [PATCH 6/6] Display the correct tooltip for warning actions --- lib/bloc/lnurl/lnurl_model.dart | 1 - lib/routes/account_required_actions.dart | 21 ++++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/bloc/lnurl/lnurl_model.dart b/lib/bloc/lnurl/lnurl_model.dart index 564b7e47e..335a3b4e5 100644 --- a/lib/bloc/lnurl/lnurl_model.dart +++ b/lib/bloc/lnurl/lnurl_model.dart @@ -1,4 +1,3 @@ -import 'package:breez/bloc/user_profile/currency.dart'; import 'package:breez/services/breezlib/data/messages.pb.dart'; import 'package:fixnum/fixnum.dart'; diff --git a/lib/routes/account_required_actions.dart b/lib/routes/account_required_actions.dart index 2a9c940d6..7b5b2af88 100644 --- a/lib/routes/account_required_actions.dart +++ b/lib/routes/account_required_actions.dart @@ -82,8 +82,10 @@ class AccountRequiredActionsIndicatorState Widget _buildLoader(BackupState backupState, AccountModel account) { final backupBloc = AppBlocsProvider.of(context); final accountBloc = AppBlocsProvider.of(context); + final texts = context.texts(); Widget Function(BuildContext) dialogBuilder; + String tooltip = ""; if (backupState?.inProgress == true) { dialogBuilder = (_) => buildBackupInProgressDialog( @@ -91,11 +93,13 @@ class AccountRequiredActionsIndicatorState backupBloc.backupStateStream, onFinished: () {}, ); + tooltip = texts.account_required_actions_backup; } else if (account?.transferringOnChainDeposit == true) { dialogBuilder = (_) => buildTransferFundsInProgressDialog( context, accountBloc.accountStream, ); + tooltip = texts.transferring_funds_title; } if (dialogBuilder != null) { @@ -103,6 +107,7 @@ class AccountRequiredActionsIndicatorState () { showDialog(context: context, builder: dialogBuilder); }, + tooltip: tooltip, iconWidget: Rotator( child: Image( image: const AssetImage("src/icon/sync.png"), @@ -207,6 +212,7 @@ class AccountRequiredActionsIndicatorState bool hasError, Object backupError, ) { + final texts = context.texts(); final themeData = Theme.of(context); final navigatorState = Navigator.of(context); @@ -215,7 +221,10 @@ class AccountRequiredActionsIndicatorState if (walletBalance > 0 && !accountSettings.ignoreWalletBalance) { warnings.add( - WarningAction(() => navigatorState.pushNamed("/send_coins")), + WarningAction( + () => navigatorState.pushNamed("/send_coins"), + tooltip: texts.unexpected_funds_title, + ), ); } @@ -230,6 +239,7 @@ class AccountRequiredActionsIndicatorState builder: (_) => const EnableBackupDialog(), ); }, + tooltip: texts.account_required_actions_backup, ), ); } @@ -251,6 +261,7 @@ class AccountRequiredActionsIndicatorState builder: (_) => CloseWarningDialog(inactiveWarningDuration), ); }, + tooltip: texts.close_warning_dialog_title, ), ); } @@ -274,6 +285,7 @@ class AccountRequiredActionsIndicatorState builder: (_) => const SwapRefundDialog(), ); }, + tooltip: texts.funds_over_limit_dialog_on_chain_transaction, ), ); } @@ -285,6 +297,7 @@ class AccountRequiredActionsIndicatorState () => accountBloc.userActionsSink.add( ChangeSyncUIState(SyncUIState.BLOCKING), ), + tooltip: texts.handler_sync_ui_message, iconWidget: Rotator( child: Image( image: const AssetImage("src/icon/sync.png"), @@ -312,6 +325,7 @@ class AccountRequiredActionsIndicatorState navigatorState.pushNamed("/select_lsp"); } }, + tooltip: texts.account_page_activation_provider_label, ), ); } @@ -331,10 +345,12 @@ class AccountRequiredActionsIndicatorState class WarningAction extends StatefulWidget { final void Function() onTap; final Widget iconWidget; + final String tooltip; const WarningAction( this.onTap, { this.iconWidget, + this.tooltip = "", }); @override @@ -376,7 +392,6 @@ class WarningActionState extends State @override Widget build(BuildContext context) { final themeData = Theme.of(context); - final texts = context.texts(); return IconButton( iconSize: 45.0, @@ -392,7 +407,7 @@ class WarningActionState extends State ), ), ), - tooltip: texts.account_required_actions_backup, + tooltip: widget.tooltip, onPressed: widget.onTap, ); }