Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Flutter 3.24 breaking changes & requirements #903

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.20" apply false
id "org.jetbrains.kotlin.android" version "2.0.10" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "1.8.20" apply false
}
Expand Down
53 changes: 27 additions & 26 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- app_group_directory (1.0.0):
- Flutter
- breez_sdk (0.5.1-rc3):
- breez_sdk (0.5.2):
- Flutter
- clipboard_watcher (0.0.1):
- Flutter
Expand All @@ -10,39 +10,39 @@ PODS:
- FlutterMacOS
- device_info_plus (0.0.1):
- Flutter
- Firebase/CoreOnly (10.28.0):
- FirebaseCore (= 10.28.0)
- Firebase/DynamicLinks (10.28.0):
- Firebase/CoreOnly (10.29.0):
- FirebaseCore (= 10.29.0)
- Firebase/DynamicLinks (10.29.0):
- Firebase/CoreOnly
- FirebaseDynamicLinks (~> 10.28.0)
- Firebase/Messaging (10.28.0):
- FirebaseDynamicLinks (~> 10.29.0)
- Firebase/Messaging (10.29.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 10.28.0)
- firebase_core (3.2.0):
- Firebase/CoreOnly (= 10.28.0)
- FirebaseMessaging (~> 10.29.0)
- firebase_core (3.3.0):
- Firebase/CoreOnly (= 10.29.0)
- Flutter
- firebase_dynamic_links (6.0.3):
- Firebase/DynamicLinks (= 10.28.0)
- firebase_dynamic_links (6.0.4):
- Firebase/DynamicLinks (= 10.29.0)
- firebase_core
- Flutter
- firebase_messaging (15.0.3):
- Firebase/Messaging (= 10.28.0)
- firebase_messaging (15.0.4):
- Firebase/Messaging (= 10.29.0)
- firebase_core
- Flutter
- FirebaseCore (10.28.0):
- FirebaseCore (10.29.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.29.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseDynamicLinks (10.28.0):
- FirebaseDynamicLinks (10.29.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (10.29.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- FirebaseMessaging (10.28.0):
- FirebaseMessaging (10.29.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleDataTransport (~> 9.3)
Expand Down Expand Up @@ -117,6 +117,7 @@ PODS:
- KeychainAccess (4.2.2)
- local_auth_darwin (0.0.1):
- Flutter
- FlutterMacOS
- MLImage (1.0.0-beta5)
- MLKitBarcodeScanning (5.0.0):
- MLKitCommon (~> 11.0)
Expand Down Expand Up @@ -300,19 +301,19 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
app_group_directory: 7bf9f8f9819ead554de29da7c25fb7a680d6a9a0
breez_sdk: c27f6e5a5ffb918ab57cff57cad4dd00e611f159
breez_sdk: 786b7c9260708ae0845dfa510c5a3cd64fdd1beb
clipboard_watcher: 86fb70421aca6f4944e0591a8292605da7784666
connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d
Firebase: 5121c624121af81cbc81df3bda414b3c28c4f3c3
firebase_core: a9d0180d5285527884d07a41eb4a9ec9ed12cdb6
firebase_dynamic_links: ef37ec989592ed84f0bbcf2d2f938d4407bee1c2
firebase_messaging: ccc82a143a74de75f440a4e413dbbb37ec3fddbc
FirebaseCore: 857dc1c6dd1255675047404d8466f7dfaac5d779
Firebase: cec914dab6fd7b1bd8ab56ea07ce4e03dd251c2d
firebase_core: 57aeb91680e5d5e6df6b888064be7c785f146efb
firebase_dynamic_links: 550e8cefbdee7b6e74adfebb3cc4d340fa72f6c8
firebase_messaging: c862b3d2b973ecc769194dc8de09bd22c77ae757
FirebaseCore: 30e9c1cbe3d38f5f5e75f48bfcea87d7c358ec16
FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934
FirebaseDynamicLinks: f6a65ece086df7d8366400b8bb99e50dd2659ad4
FirebaseDynamicLinks: 83c278fcae48ac2cf8c3fb10f64f3d469dadcf9b
FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd
FirebaseMessaging: 087a7c7cadef7b9239f005bc4db823894844f323
FirebaseMessaging: 7b5d8033e183ab59eb5b852a53201559e976d366
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_fgbg: 31c0d1140a131daea2d342121808f6aa0dcd879d
flutter_inappwebview_ios: 97215cf7d4677db55df76782dbd2930c5e1c1ea0
Expand All @@ -326,9 +327,9 @@ SPEC CHECKSUMS:
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
local_auth_darwin: 4d56c90c2683319835a61274b57620df9c4520ab
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
MLImage: 1824212150da33ef225fbd3dc49f184cf611046c
MLKitBarcodeScanning: 10ca0845a6d15f2f6e911f682a1998b68b973e8b
MLKitCommon: afec63980417d29ffbb4790529a1b0a2291699e1
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
2 changes: 1 addition & 1 deletion lib/handlers/check_version_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void checkVersionDialog(
final texts = context.texts();

userProfileBloc.checkVersion().catchError((err) {
if (err.toString().contains('bad version')) {
if (err.toString().contains('bad version') && context.mounted) {
showFlushbar(
context,
buttonText: texts.handler_check_version_action_update,
Expand Down
22 changes: 14 additions & 8 deletions lib/handlers/connectivity_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,20 @@ class ConnectivityHandler extends Handler {
context.read<ConnectivityBloc>().setIsConnecting(true);
Future.delayed(
const Duration(seconds: 1),
() => context
.read<ConnectivityBloc>()
.checkConnectivity()
.whenComplete(() => context.read<ConnectivityBloc>().setIsConnecting(false))
.onError((error, stackTrace) {
context.read<ConnectivityBloc>().setIsConnecting(false);
throw error.toString();
}),
() {
if (context.mounted) {
context.read<ConnectivityBloc>().checkConnectivity().whenComplete(() {
if (context.mounted) {
context.read<ConnectivityBloc>().setIsConnecting(false);
}
}).onError((error, stackTrace) {
if (context.mounted) {
context.read<ConnectivityBloc>().setIsConnecting(false);
}
throw error.toString();
});
}
},
);
},
child: Text(
Expand Down
48 changes: 25 additions & 23 deletions lib/handlers/health_check_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,32 @@ class HealthCheckHandler extends Handler {
_log.info("Flushbar already shown");
return;
}
_log.info("Showing flushbar for: $event");
_flushbar = showFlushbar(
context,
isDismissible: false,
showMainButton: true,
position: FlushbarPosition.TOP,
duration: Duration.zero,
message: event == HealthCheckStatus.Maintenance
? texts.handler_check_version_error_upgrading_servers
: texts.handler_health_check_service_disruption,
buttonText: texts.handler_health_check_action_retry,
onDismiss: () {
_flushbar = null;
bloc.checkStatus();
return true;
},
icon: SvgPicture.asset(
"src/icon/warning.svg",
colorFilter: ColorFilter.mode(
themeData.colorScheme.error,
BlendMode.srcATop,
if (context.mounted) {
_log.info("Showing flushbar for: $event");
_flushbar = showFlushbar(
context,
isDismissible: false,
showMainButton: true,
position: FlushbarPosition.TOP,
duration: Duration.zero,
message: event == HealthCheckStatus.Maintenance
? texts.handler_check_version_error_upgrading_servers
: texts.handler_health_check_service_disruption,
buttonText: texts.handler_health_check_action_retry,
onDismiss: () {
_flushbar = null;
bloc.checkStatus();
return true;
},
icon: SvgPicture.asset(
"src/icon/warning.svg",
colorFilter: ColorFilter.mode(
themeData.colorScheme.error,
BlendMode.srcATop,
),
),
),
);
);
}
} else {
_flushbar?.dismiss();
_flushbar = null;
Expand Down
2 changes: 1 addition & 1 deletion lib/handlers/input_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class InputHandler extends Handler {
_setLoading(false);
if (error != null) {
final context = contextProvider?.getBuildContext();
if (context != null) {
if (context != null && context.mounted) {
showFlushbar(context, message: extractExceptionMessage(error, context.texts()));
} else {
_log.info("Skipping handling of error: $error because context is null");
Expand Down
4 changes: 3 additions & 1 deletion lib/routes/buy_bitcoin/moonpay/moonpay_swap_in_progress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class MoonpaySwapInProgress extends StatelessWidget {
Navigator.of(context).pop();
} else {
context.read<MoonPayBloc>().makeExplorerUrl(state.address).then((url) {
launchLinkOnExternalBrowser(context, linkAddress: url);
if (context.mounted) {
launchLinkOnExternalBrowser(context, linkAddress: url);
}
});
}
},
Expand Down
4 changes: 3 additions & 1 deletion lib/routes/create_invoice/qr_code_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ class QrCodeDialogState extends State<QrCodeDialog> with SingleTickerProviderSta
});
}).catchError((e) {
_log.warning("Failed to track payment", e);
showFlushbar(context, message: extractExceptionMessage(e, context.texts()));
if (mounted) {
showFlushbar(context, message: extractExceptionMessage(e, context.texts()));
}
onFinish(false);
});
}
Expand Down
6 changes: 5 additions & 1 deletion lib/routes/create_invoice/widgets/successful_payment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class SuccessfulPaymentRouteState extends State<SuccessfulPaymentRoute> with Wid
builder: (context) => SuccessfulPaymentDialog(
onPrint: widget.onPrint,
),
).whenComplete(() => Navigator.of(context).pop());
).whenComplete(() {
if (mounted) {
Navigator.of(context).pop();
}
});
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class HomeState extends State<Home> with AutoLockMixin, HandlerContextProvider {

return PopScope(
canPop: false,
onPopInvoked: (bool didPop) async {
onPopInvokedWithResult: (bool didPop, _) async {
if (didPop) {
return;
}
Expand Down
10 changes: 7 additions & 3 deletions lib/routes/home/widgets/app_bar/account_required_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ class AccountRequiredActionsIndicator extends StatelessWidget {
WarningAction(
() async {
await ServiceInjector().keychain.read(CredentialsManager.accountMnemonic).then(
(accountMnemonic) => Navigator.pushNamed(
(accountMnemonic) {
if (context.mounted) {
return Navigator.pushNamed(
context,
'/mnemonics',
arguments: accountMnemonic,
),
);
);
}
},
);
},
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/home/widgets/drawer/home_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class HomeDrawerState extends State<HomeDrawer> {
});
} else {
Navigator.of(context).pushNamed(screenName).then((message) {
if (message != null && message is String) {
if (message != null && message is String && context.mounted) {
showFlushbar(context, message: message);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ class PaymentsFilterCalendar extends StatelessWidget {
context: context,
builder: (_) => CalendarDialog(firstDate!),
).then((result) {
final accountBloc = context.read<AccountBloc>();
if (result != null) {
accountBloc.changePaymentFilter(
filters: filter,
fromTimestamp: result[0].millisecondsSinceEpoch,
toTimestamp: result[1].millisecondsSinceEpoch,
);
if (context.mounted) {
final accountBloc = context.read<AccountBloc>();
if (result != null) {
accountBloc.changePaymentFilter(
filters: filter,
fromTimestamp: result[0].millisecondsSinceEpoch,
toTimestamp: result[1].millisecondsSinceEpoch,
);
}
}
})
: ScaffoldMessenger.of(context).showSnackBar(
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/home/widgets/qr_action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class QrActionButton extends StatelessWidget {
(barcode) {
_log.info("Scanned string: '$barcode'");
if (barcode == null) return;
if (barcode.isEmpty) {
if (barcode.isEmpty && context.mounted) {
showFlushbar(
context,
message: texts.qr_action_button_error_code_not_detected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class EnterMnemonicsPageState extends State<EnterMnemonicsPage> {

return PopScope(
canPop: _currentPage == 1,
onPopInvoked: (_) async {
onPopInvokedWithResult: (_, __) async {
if (_currentPage > 1) {
FocusScope.of(context).requestFocus(FocusNode());
setState(() {
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/lnurl/auth/lnurl_auth_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Future<LNURLPageResult?> handleAuthRequest(
) async {
return promptAreYouSure(context, null, LoginText(domain: reqData.domain)).then(
(permitted) async {
if (permitted == true) {
if (permitted == true && context.mounted) {
final texts = context.texts();
final navigator = Navigator.of(context);
final loaderRoute = createLoaderRoute(context);
Expand Down
20 changes: 13 additions & 7 deletions lib/routes/security/auto_lock_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ mixin AutoLockMixin<T extends StatefulWidget> on State<T> {
void initState() {
super.initState();
final securityBloc = context.read<SecurityBloc>();
securityBloc.stream.distinct().where((state) => state.lockState == security.LockState.locked).listen((_) {
Navigator.of(context, rootNavigator: true).push(FadeInRoute(
builder: (_) => const LockScreen(
authorizedAction: AuthorizedAction.popPage,
),
));
});
securityBloc.stream.distinct().where((state) => state.lockState == security.LockState.locked).listen(
(_) {
if (mounted) {
Navigator.of(context, rootNavigator: true).push(
FadeInRoute(
builder: (_) => const LockScreen(
authorizedAction: AuthorizedAction.popPage,
),
),
);
}
},
);
}
}
Loading
Loading