diff --git a/lib/src/notification/service.dart b/lib/src/notification/service.dart index b49ee62..c8f44ec 100644 --- a/lib/src/notification/service.dart +++ b/lib/src/notification/service.dart @@ -37,11 +37,14 @@ class NotificationService { } const android = AndroidInitializationSettings('ic_stat_notification'); final ios = DarwinInitializationSettings( - onDidReceiveLocalNotification: _onDidReceiveLocalNotification, + // onDidReceiveLocalNotification: _onDidReceiveLocalNotification, ); const macos = DarwinInitializationSettings(); - final initSettings = - InitializationSettings(android: android, iOS: ios, macOS: macos); + final initSettings = InitializationSettings( + android: android, + iOS: ios, + macOS: macos, + ); await _flutterLocalNotificationsPlugin.initialize( initSettings, onDidReceiveNotificationResponse: _selectNotification, @@ -49,12 +52,14 @@ class NotificationService { if (Platform.isAndroid) { await _flutterLocalNotificationsPlugin .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin>() + AndroidFlutterLocalNotificationsPlugin + >() ?.requestNotificationsPermission(); } if (checkForLaunchDetails) { - final launchDetails = await _flutterLocalNotificationsPlugin - .getNotificationAppLaunchDetails(); + final launchDetails = + await _flutterLocalNotificationsPlugin + .getNotificationAppLaunchDetails(); if (launchDetails != null && launchDetails.didNotificationLaunchApp) { final response = launchDetails.notificationResponse; if (response != null) { @@ -132,10 +137,7 @@ class NotificationService { if (payloadText != null && payloadText.startsWith(_messagePayloadStart)) { final payload = _deserialize(payloadText); - usedContext.pushNamed( - Routes.mailDetailsForNotification, - extra: payload, - ); + usedContext.pushNamed(Routes.mailDetailsForNotification, extra: payload); } } @@ -152,15 +154,17 @@ class NotificationService { ) { String retrieveFromName() { final mimeFrom = mimeMessage.from; - final personalName = mimeFrom != null && mimeFrom.isNotEmpty - ? mimeFrom.first.personalName - : mimeMessage.sender?.personalName; + final personalName = + mimeFrom != null && mimeFrom.isNotEmpty + ? mimeFrom.first.personalName + : mimeMessage.sender?.personalName; if (personalName != null && personalName.isNotEmpty) { return personalName; } - final email = mimeFrom != null && mimeFrom.isNotEmpty - ? mimeFrom.first.email - : mimeMessage.sender?.email; + final email = + mimeFrom != null && mimeFrom.isNotEmpty + ? mimeFrom.first.email + : mimeMessage.sender?.email; if (email != null && email.isNotEmpty) { return email; } @@ -225,8 +229,13 @@ class NotificationService { android: androidPlatformChannelSpecifics, iOS: iosPlatformChannelSpecifics, ); - await _flutterLocalNotificationsPlugin - .show(id, title, text, platformChannelSpecifics, payload: payloadText); + await _flutterLocalNotificationsPlugin.show( + id, + title, + text, + platformChannelSpecifics, + payload: payloadText, + ); } void cancelNotificationForMessage(maily.Message message) => diff --git a/pubspec.yaml b/pubspec.yaml index 9f64169..64d3694 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ version: 1.0.0+96 environment: flutter: ">=3.22.0" - sdk: '>=3.4.0 <4.0.0' + sdk: ">=3.4.0 <4.0.0" dependencies: background_fetch: ^1.2.1 @@ -73,7 +73,7 @@ dependencies: logger: ^2.0.2+1 map: ^2.0.2 modal_bottom_sheet: ^3.0.0-pre - package_info_plus: ^1.3.0 + package_info_plus: ^8.3.0 path_provider: ^2.0.8 riverpod_annotation: ^2.1.5 share_plus: ^9.0.0 @@ -89,7 +89,7 @@ dependency_overrides: device_info_plus: ^9.1.0 package_info_plus: ^4.2.0 ffi: ^2.1.0 - pdfx: ^2.6.0 + pdfx: ^2.6.0 js: ^0.7.1 # for pdfx & fluttercontactpicker # out-comment the following to enable git-based development: enough_mail: