diff --git a/android/app/src/main/kotlin/com/zulip/flutter/Notifications.g.kt b/android/app/src/main/kotlin/com/zulip/flutter/Notifications.g.kt index 2fb36634e6..2070473b96 100644 --- a/android/app/src/main/kotlin/com/zulip/flutter/Notifications.g.kt +++ b/android/app/src/main/kotlin/com/zulip/flutter/Notifications.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.7.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -7,7 +7,9 @@ package com.zulip.flutter import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMethodCodec import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer @@ -64,17 +66,16 @@ data class NotificationChannel ( val lightsEnabled: Boolean? = null, val soundUrl: String? = null, val vibrationPattern: LongArray? = null - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): NotificationChannel { - val id = __pigeon_list[0] as String - val importance = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long } - val name = __pigeon_list[2] as String? - val lightsEnabled = __pigeon_list[3] as Boolean? - val soundUrl = __pigeon_list[4] as String? - val vibrationPattern = __pigeon_list[5] as LongArray? + fun fromList(pigeonVar_list: List): NotificationChannel { + val id = pigeonVar_list[0] as String + val importance = pigeonVar_list[1] as Long + val name = pigeonVar_list[2] as String? + val lightsEnabled = pigeonVar_list[3] as Boolean? + val soundUrl = pigeonVar_list[4] as String? + val vibrationPattern = pigeonVar_list[5] as LongArray? return NotificationChannel(id, importance, name, lightsEnabled, soundUrl, vibrationPattern) } } @@ -104,14 +105,13 @@ data class AndroidIntent ( val dataUrl: String, /** A combination of flags from [IntentFlag]. */ val flags: Long - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): AndroidIntent { - val action = __pigeon_list[0] as String - val dataUrl = __pigeon_list[1] as String - val flags = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long } + fun fromList(pigeonVar_list: List): AndroidIntent { + val action = pigeonVar_list[0] as String + val dataUrl = pigeonVar_list[1] as String + val flags = pigeonVar_list[2] as Long return AndroidIntent(action, dataUrl, flags) } } @@ -139,14 +139,13 @@ data class PendingIntent ( * with `Intent`; see Android docs for `PendingIntent.getActivity`. */ val flags: Long - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): PendingIntent { - val requestCode = __pigeon_list[0].let { num -> if (num is Int) num.toLong() else num as Long } - val intent = __pigeon_list[1] as AndroidIntent - val flags = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long } + fun fromList(pigeonVar_list: List): PendingIntent { + val requestCode = pigeonVar_list[0] as Long + val intent = pigeonVar_list[1] as AndroidIntent + val flags = pigeonVar_list[2] as Long return PendingIntent(requestCode, intent, flags) } } @@ -168,12 +167,11 @@ data class PendingIntent ( */ data class InboxStyle ( val summaryText: String - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): InboxStyle { - val summaryText = __pigeon_list[0] as String + fun fromList(pigeonVar_list: List): InboxStyle { + val summaryText = pigeonVar_list[0] as String return InboxStyle(summaryText) } } @@ -205,14 +203,13 @@ data class Person ( val iconBitmap: ByteArray? = null, val key: String, val name: String - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): Person { - val iconBitmap = __pigeon_list[0] as ByteArray? - val key = __pigeon_list[1] as String - val name = __pigeon_list[2] as String + fun fromList(pigeonVar_list: List): Person { + val iconBitmap = pigeonVar_list[0] as ByteArray? + val key = pigeonVar_list[1] as String + val name = pigeonVar_list[2] as String return Person(iconBitmap, key, name) } } @@ -236,14 +233,13 @@ data class MessagingStyleMessage ( val text: String, val timestampMs: Long, val person: Person - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): MessagingStyleMessage { - val text = __pigeon_list[0] as String - val timestampMs = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long } - val person = __pigeon_list[2] as Person + fun fromList(pigeonVar_list: List): MessagingStyleMessage { + val text = pigeonVar_list[0] as String + val timestampMs = pigeonVar_list[1] as Long + val person = pigeonVar_list[2] as Person return MessagingStyleMessage(text, timestampMs, person) } } @@ -266,17 +262,16 @@ data class MessagingStyleMessage ( data class MessagingStyle ( val user: Person, val conversationTitle: String? = null, - val messages: List, + val messages: List, val isGroupConversation: Boolean - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): MessagingStyle { - val user = __pigeon_list[0] as Person - val conversationTitle = __pigeon_list[1] as String? - val messages = __pigeon_list[2] as List - val isGroupConversation = __pigeon_list[3] as Boolean + fun fromList(pigeonVar_list: List): MessagingStyle { + val user = pigeonVar_list[0] as Person + val conversationTitle = pigeonVar_list[1] as String? + val messages = pigeonVar_list[2] as List + val isGroupConversation = pigeonVar_list[3] as Boolean return MessagingStyle(user, conversationTitle, messages, isGroupConversation) } } @@ -299,14 +294,13 @@ data class MessagingStyle ( */ data class Notification ( val group: String, - val extras: Map - -) { + val extras: Map +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): Notification { - val group = __pigeon_list[0] as String - val extras = __pigeon_list[1] as Map + fun fromList(pigeonVar_list: List): Notification { + val group = pigeonVar_list[0] as String + val extras = pigeonVar_list[1] as Map return Notification(group, extras) } } @@ -329,14 +323,13 @@ data class StatusBarNotification ( val id: Long, val tag: String, val notification: Notification - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): StatusBarNotification { - val id = __pigeon_list[0].let { num -> if (num is Int) num.toLong() else num as Long } - val tag = __pigeon_list[1] as String - val notification = __pigeon_list[2] as Notification + fun fromList(pigeonVar_list: List): StatusBarNotification { + val id = pigeonVar_list[0] as Long + val tag = pigeonVar_list[1] as String + val notification = pigeonVar_list[2] as Notification return StatusBarNotification(id, tag, notification) } } @@ -370,14 +363,13 @@ data class StoredNotificationSound ( val isOwned: Boolean, /** A `content://…` URL pointing to the sound file. */ val contentUrl: String - -) { +) + { companion object { - @Suppress("LocalVariableName") - fun fromList(__pigeon_list: List): StoredNotificationSound { - val fileName = __pigeon_list[0] as String - val isOwned = __pigeon_list[1] as Boolean - val contentUrl = __pigeon_list[2] as String + fun fromList(pigeonVar_list: List): StoredNotificationSound { + val fileName = pigeonVar_list[0] as String + val isOwned = pigeonVar_list[1] as Boolean + val contentUrl = pigeonVar_list[2] as String return StoredNotificationSound(fileName, isOwned, contentUrl) } } @@ -389,7 +381,7 @@ data class StoredNotificationSound ( ) } } -private object NotificationsPigeonCodec : StandardMessageCodec() { +private open class NotificationsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { @@ -561,7 +553,7 @@ interface AndroidNotificationHostApi { * https://developer.android.com/reference/kotlin/android/app/NotificationManager.html#notify * https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder */ - fun notify(tag: String?, id: Long, autoCancel: Boolean?, channelId: String, color: Long?, contentIntent: PendingIntent?, contentText: String?, contentTitle: String?, extras: Map?, groupKey: String?, inboxStyle: InboxStyle?, isGroupSummary: Boolean?, messagingStyle: MessagingStyle?, number: Long?, smallIconResourceName: String?) + fun notify(tag: String?, id: Long, autoCancel: Boolean?, channelId: String, color: Long?, contentIntent: PendingIntent?, contentText: String?, contentTitle: String?, extras: Map?, groupKey: String?, inboxStyle: InboxStyle?, isGroupSummary: Boolean?, messagingStyle: MessagingStyle?, number: Long?, smallIconResourceName: String?) /** * Wraps `androidx.core.app.NotificationManagerCompat.getActiveNotifications`, * combined with `androidx.core.app.NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification`. @@ -597,7 +589,7 @@ interface AndroidNotificationHostApi { companion object { /** The codec used by AndroidNotificationHostApi. */ val codec: MessageCodec by lazy { - NotificationsPigeonCodec + NotificationsPigeonCodec() } /** Sets up an instance of `AndroidNotificationHostApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads @@ -693,19 +685,19 @@ interface AndroidNotificationHostApi { channel.setMessageHandler { message, reply -> val args = message as List val tagArg = args[0] as String? - val idArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val idArg = args[1] as Long val autoCancelArg = args[2] as Boolean? val channelIdArg = args[3] as String - val colorArg = args[4].let { num -> if (num is Int) num.toLong() else num as Long? } + val colorArg = args[4] as Long? val contentIntentArg = args[5] as PendingIntent? val contentTextArg = args[6] as String? val contentTitleArg = args[7] as String? - val extrasArg = args[8] as Map? + val extrasArg = args[8] as Map? val groupKeyArg = args[9] as String? val inboxStyleArg = args[10] as InboxStyle? val isGroupSummaryArg = args[11] as Boolean? val messagingStyleArg = args[12] as MessagingStyle? - val numberArg = args[13].let { num -> if (num is Int) num.toLong() else num as Long? } + val numberArg = args[13] as Long? val smallIconResourceNameArg = args[14] as String? val wrapped: List = try { api.notify(tagArg, idArg, autoCancelArg, channelIdArg, colorArg, contentIntentArg, contentTextArg, contentTitleArg, extrasArg, groupKeyArg, inboxStyleArg, isGroupSummaryArg, messagingStyleArg, numberArg, smallIconResourceNameArg) @@ -759,7 +751,7 @@ interface AndroidNotificationHostApi { channel.setMessageHandler { message, reply -> val args = message as List val tagArg = args[0] as String? - val idArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val idArg = args[1] as Long val wrapped: List = try { api.cancel(tagArg, idArg) listOf(null) diff --git a/android/app/src/main/kotlin/com/zulip/flutter/ZulipPlugin.kt b/android/app/src/main/kotlin/com/zulip/flutter/ZulipPlugin.kt index bae5ad43ab..eb332d786f 100644 --- a/android/app/src/main/kotlin/com/zulip/flutter/ZulipPlugin.kt +++ b/android/app/src/main/kotlin/com/zulip/flutter/ZulipPlugin.kt @@ -183,7 +183,7 @@ private class AndroidNotificationHost(val context: Context) contentIntent: PendingIntent?, contentText: String?, contentTitle: String?, - extras: Map?, + extras: Map?, groupKey: String?, inboxStyle: InboxStyle?, isGroupSummary: Boolean?, @@ -221,13 +221,13 @@ private class AndroidNotificationHost(val context: Context) val style = NotificationCompat.MessagingStyle(toAndroidPerson(messagingStyle.user)) .setConversationTitle(messagingStyle.conversationTitle) .setGroupConversation(messagingStyle.isGroupConversation) - messagingStyle.messages.forEach { it?.let { + messagingStyle.messages.forEach { style.addMessage(NotificationCompat.MessagingStyle.Message( it.text, it.timestampMs, toAndroidPerson(it.person), )) - } } + } setStyle(style) } number?.let { setNumber(it.toInt()) } @@ -268,8 +268,11 @@ private class AndroidNotificationHost(val context: Context) Notification( it.notification.group, desiredExtras - .associateWith { key -> it.notification.extras.getString(key) } - .filter { entry -> entry.value != null } + .mapNotNull { key -> + it.notification.extras.getString(key)?.let { value -> + key to value + } } + .toMap() ), ) } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a8e8b195a3..27e8691603 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -37,31 +37,31 @@ PODS: - file_picker (0.0.1): - DKImagePickerController/PhotoGallery - Flutter - - Firebase/CoreOnly (11.4.0): - - FirebaseCore (= 11.4.0) - - Firebase/Messaging (11.4.0): + - Firebase/CoreOnly (11.6.0): + - FirebaseCore (~> 11.6.0) + - Firebase/Messaging (11.6.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 11.4.0) - - firebase_core (3.9.0): - - Firebase/CoreOnly (= 11.4.0) + - FirebaseMessaging (~> 11.6.0) + - firebase_core (3.10.0): + - Firebase/CoreOnly (= 11.6.0) - Flutter - - firebase_messaging (15.1.6): - - Firebase/Messaging (= 11.4.0) + - firebase_messaging (15.2.0): + - Firebase/Messaging (= 11.6.0) - firebase_core - Flutter - - FirebaseCore (11.4.0): - - FirebaseCoreInternal (~> 11.0) + - FirebaseCore (11.6.0): + - FirebaseCoreInternal (~> 11.6.0) - GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/Logger (~> 8.0) - FirebaseCoreInternal (11.6.0): - "GoogleUtilities/NSData+zlib (~> 8.0)" - - FirebaseInstallations (11.4.0): - - FirebaseCore (~> 11.0) + - FirebaseInstallations (11.6.0): + - FirebaseCore (~> 11.6.0) - GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/UserDefaults (~> 8.0) - PromisesObjC (~> 2.4) - - FirebaseMessaging (11.4.0): - - FirebaseCore (~> 11.0) + - FirebaseMessaging (11.6.0): + - FirebaseCore (~> 11.6.0) - FirebaseInstallations (~> 11.0) - GoogleDataTransport (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.0) @@ -213,17 +213,17 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: app_settings: 017320c6a680cdc94c799949d95b84cb69389ebc - device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d + device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342 DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 - Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99 - firebase_core: b62a5080210edad3f2934314a8b2c6f5124e8e10 - firebase_messaging: 98619a0572d82cfb3668e78859ba9f1110e268c9 - FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771 + Firebase: 374a441a91ead896215703a674d58cdb3e9d772b + firebase_core: feb37e79f775c2bd08dd35e02d83678291317e10 + firebase_messaging: e2f0ba891b1509668c07f5099761518a5af8fe3c + FirebaseCore: 48b0dd707581cf9c1a1220da68223fb0a562afaa FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2 - FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414 - FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2 + FirebaseInstallations: efc0946fc756e4d22d8113f7c761948120322e8c + FirebaseMessaging: e1aca1fcc23e8b9eddb0e33f375ff90944623021 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d diff --git a/lib/host/android_notifications.g.dart b/lib/host/android_notifications.g.dart index 54825750ca..7b53559e64 100644 --- a/lib/host/android_notifications.g.dart +++ b/lib/host/android_notifications.g.dart @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v20.0.2), do not edit directly. +// Autogenerated from Pigeon (v22.7.2), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -256,7 +256,7 @@ class MessagingStyle { String? conversationTitle; - List messages; + List messages; bool isGroupConversation; @@ -274,7 +274,7 @@ class MessagingStyle { return MessagingStyle( user: result[0]! as Person, conversationTitle: result[1] as String?, - messages: (result[2] as List?)!.cast(), + messages: (result[2] as List?)!.cast(), isGroupConversation: result[3]! as bool, ); } @@ -291,7 +291,7 @@ class Notification { String group; - Map extras; + Map extras; Object encode() { return [ @@ -304,7 +304,7 @@ class Notification { result as List; return Notification( group: result[0]! as String, - extras: (result[1] as Map?)!.cast(), + extras: (result[1] as Map?)!.cast(), ); } } @@ -390,34 +390,37 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is NotificationChannel) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is NotificationChannel) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is AndroidIntent) { + } else if (value is AndroidIntent) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is PendingIntent) { + } else if (value is PendingIntent) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is InboxStyle) { + } else if (value is InboxStyle) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is Person) { + } else if (value is Person) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is MessagingStyleMessage) { + } else if (value is MessagingStyleMessage) { buffer.putUint8(134); writeValue(buffer, value.encode()); - } else if (value is MessagingStyle) { + } else if (value is MessagingStyle) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is Notification) { + } else if (value is Notification) { buffer.putUint8(136); writeValue(buffer, value.encode()); - } else if (value is StatusBarNotification) { + } else if (value is StatusBarNotification) { buffer.putUint8(137); writeValue(buffer, value.encode()); - } else if (value is StoredNotificationSound) { + } else if (value is StoredNotificationSound) { buffer.putUint8(138); writeValue(buffer, value.encode()); } else { @@ -459,33 +462,33 @@ class AndroidNotificationHostApi { /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. AndroidNotificationHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) - : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; - final BinaryMessenger? __pigeon_binaryMessenger; + : pigeonVar_binaryMessenger = binaryMessenger, + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); - final String __pigeon_messageChannelSuffix; + final String pigeonVar_messageChannelSuffix; /// Corresponds to `androidx.core.app.NotificationManagerCompat.createNotificationChannel`. /// /// See: https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannel(androidx.core.app.NotificationChannelCompat) Future createNotificationChannel(NotificationChannel channel) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.createNotificationChannel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.createNotificationChannel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([channel]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([channel]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -495,30 +498,30 @@ class AndroidNotificationHostApi { /// Corresponds to `androidx.core.app.NotificationManagerCompat.getNotificationChannelsCompat`. /// /// See: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getNotificationChannelsCompat() - Future> getNotificationChannels() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getNotificationChannels$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future> getNotificationChannels() async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getNotificationChannels$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } @@ -526,21 +529,21 @@ class AndroidNotificationHostApi { /// /// See: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#deleteNotificationChannel(java.lang.String) Future deleteNotificationChannel(String channelId) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.deleteNotificationChannel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.deleteNotificationChannel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([channelId]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([channelId]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -557,30 +560,30 @@ class AndroidNotificationHostApi { /// Requires minimum of Android 10 (API 29) or higher. /// /// See: https://developer.android.com/reference/android/content/ContentResolver#query(android.net.Uri,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String) - Future> listStoredSoundsInNotificationsDirectory() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.listStoredSoundsInNotificationsDirectory$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future> listStoredSoundsInNotificationsDirectory() async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.listStoredSoundsInNotificationsDirectory$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send(null) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send(null) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } @@ -599,29 +602,29 @@ class AndroidNotificationHostApi { /// https://developer.android.com/reference/android/content/ContentResolver#openOutputStream(android.net.Uri) /// https://developer.android.com/reference/android/content/res/Resources#openRawResource(int) Future copySoundResourceToMediaStore({required String targetFileDisplayName, required String sourceResourceName}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.copySoundResourceToMediaStore$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.copySoundResourceToMediaStore$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([targetFileDisplayName, sourceResourceName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([targetFileDisplayName, sourceResourceName]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as String?)!; + return (pigeonVar_replyList[0] as String?)!; } } @@ -642,22 +645,22 @@ class AndroidNotificationHostApi { /// See: /// https://developer.android.com/reference/kotlin/android/app/NotificationManager.html#notify /// https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder - Future notify({String? tag, required int id, bool? autoCancel, required String channelId, int? color, PendingIntent? contentIntent, String? contentText, String? contentTitle, Map? extras, String? groupKey, InboxStyle? inboxStyle, bool? isGroupSummary, MessagingStyle? messagingStyle, int? number, String? smallIconResourceName,}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.notify$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future notify({String? tag, required int id, bool? autoCancel, required String channelId, int? color, PendingIntent? contentIntent, String? contentText, String? contentTitle, Map? extras, String? groupKey, InboxStyle? inboxStyle, bool? isGroupSummary, MessagingStyle? messagingStyle, int? number, String? smallIconResourceName, }) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.notify$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tag, id, autoCancel, channelId, color, contentIntent, contentText, contentTitle, extras, groupKey, inboxStyle, isGroupSummary, messagingStyle, number, smallIconResourceName]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([tag, id, autoCancel, channelId, color, contentIntent, contentText, contentTitle, extras, groupKey, inboxStyle, isGroupSummary, messagingStyle, number, smallIconResourceName]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; @@ -676,24 +679,24 @@ class AndroidNotificationHostApi { /// https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat#getActiveNotifications() /// https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.MessagingStyle#extractMessagingStyleFromNotification(android.app.Notification) Future getActiveNotificationMessagingStyleByTag(String tag) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getActiveNotificationMessagingStyleByTag$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getActiveNotificationMessagingStyleByTag$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tag]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([tag]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { - return (__pigeon_replyList[0] as MessagingStyle?); + return (pigeonVar_replyList[0] as MessagingStyle?); } } @@ -705,30 +708,30 @@ class AndroidNotificationHostApi { /// is not of type string or is null, then that entry will be skipped. /// /// See: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat?hl=en#getActiveNotifications() - Future> getActiveNotifications({required List desiredExtras}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getActiveNotifications$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + Future> getActiveNotifications({required List desiredExtras}) async { + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.getActiveNotifications$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([desiredExtras]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([desiredExtras]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); - } else if (__pigeon_replyList[0] == null) { + } else if (pigeonVar_replyList[0] == null) { throw PlatformException( code: 'null-error', message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as List?)!.cast(); + return (pigeonVar_replyList[0] as List?)!.cast(); } } @@ -736,21 +739,21 @@ class AndroidNotificationHostApi { /// /// See: https://developer.android.com/reference/kotlin/androidx/core/app/NotificationManagerCompat?hl=en#cancel(java.lang.String,int) Future cancel({String? tag, required int id}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.cancel$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - __pigeon_channelName, + final String pigeonVar_channelName = 'dev.flutter.pigeon.zulip.AndroidNotificationHostApi.cancel$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( + pigeonVar_channelName, pigeonChannelCodec, - binaryMessenger: __pigeon_binaryMessenger, + binaryMessenger: pigeonVar_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([tag, id]) as List?; - if (__pigeon_replyList == null) { - throw _createConnectionError(__pigeon_channelName); - } else if (__pigeon_replyList.length > 1) { + final List? pigeonVar_replyList = + await pigeonVar_channel.send([tag, id]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { throw PlatformException( - code: __pigeon_replyList[0]! as String, - message: __pigeon_replyList[1] as String?, - details: __pigeon_replyList[2], + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], ); } else { return; diff --git a/lib/notifications/display.dart b/lib/notifications/display.dart index 30d30e9021..8319ee65b1 100644 --- a/lib/notifications/display.dart +++ b/lib/notifications/display.dart @@ -108,7 +108,7 @@ class NotificationChannelManager { // and check against our list of sounds we have. final soundsToAdd = NotificationSound.values.toList(); - final List storedSounds; + final List storedSounds; try { storedSounds = await _androidHost.listStoredSoundsInNotificationsDirectory(); } catch (e, st) { @@ -116,11 +116,9 @@ class NotificationChannelManager { return defaultSoundUrl; } for (final storedSound in storedSounds) { - assert(storedSound != null); // TODO(#942) - // If the file is one we put there, and has the name we give to our // default sound, then use it as the default sound. - if (storedSound!.fileName == kDefaultNotificationSound.fileDisplayName + if (storedSound.fileName == kDefaultNotificationSound.fileDisplayName && storedSound.isOwned) { defaultSoundUrl = storedSound.contentUrl; } @@ -188,8 +186,7 @@ class NotificationChannelManager { var found = false; final channels = await _androidHost.getNotificationChannels(); for (final channel in channels) { - assert(channel != null); // TODO(#942) - if (channel!.id == kChannelId) { + if (channel.id == kChannelId) { found = true; } else { await _androidHost.deleteNotificationChannel(channel.id); @@ -378,8 +375,6 @@ class NotificationDisplayManager { final activeNotifications = await _androidHost.getActiveNotifications( desiredExtras: [kExtraLastZulipMessageId]); for (final statusBarNotification in activeNotifications) { - if (statusBarNotification == null) continue; // TODO(pigeon) eliminate this case - // The StatusBarNotification object describes an active notification in the UI. // Its `.tag`, `.id`, and `.notification` are the same values as we passed to // [AndroidNotificationHostApi.notify] (and so to `NotificationManager#notify` diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 8c7b011db1..7125e9452b 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -3,32 +3,32 @@ PODS: - FlutterMacOS - file_selector_macos (0.0.1): - FlutterMacOS - - Firebase/CoreOnly (11.4.2): - - FirebaseCore (= 11.4.2) - - Firebase/Messaging (11.4.2): + - Firebase/CoreOnly (11.6.0): + - FirebaseCore (~> 11.6.0) + - Firebase/Messaging (11.6.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 11.4.0) - - firebase_core (3.9.0): - - Firebase/CoreOnly (~> 11.4.0) + - FirebaseMessaging (~> 11.6.0) + - firebase_core (3.10.0): + - Firebase/CoreOnly (~> 11.6.0) - FlutterMacOS - - firebase_messaging (15.1.6): - - Firebase/CoreOnly (~> 11.4.0) - - Firebase/Messaging (~> 11.4.0) + - firebase_messaging (15.2.0): + - Firebase/CoreOnly (~> 11.6.0) + - Firebase/Messaging (~> 11.6.0) - firebase_core - FlutterMacOS - - FirebaseCore (11.4.2): - - FirebaseCoreInternal (< 12.0, >= 11.4.2) + - FirebaseCore (11.6.0): + - FirebaseCoreInternal (~> 11.6.0) - GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/Logger (~> 8.0) - FirebaseCoreInternal (11.6.0): - "GoogleUtilities/NSData+zlib (~> 8.0)" - - FirebaseInstallations (11.4.0): - - FirebaseCore (~> 11.0) + - FirebaseInstallations (11.6.0): + - FirebaseCore (~> 11.6.0) - GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/UserDefaults (~> 8.0) - PromisesObjC (~> 2.4) - - FirebaseMessaging (11.4.0): - - FirebaseCore (~> 11.0) + - FirebaseMessaging (11.6.0): + - FirebaseCore (~> 11.6.0) - FirebaseInstallations (~> 11.0) - GoogleDataTransport (~> 10.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.0) @@ -158,15 +158,15 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos SPEC CHECKSUMS: - device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720 + device_info_plus: 1b14eed9bf95428983aed283a8d51cce3d8c4215 file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d - Firebase: 7fd5466678d964be78fbf536d8a3385da19c4828 - firebase_core: 1dfe1f4d02ad78be0277e320aa3d8384cf46231f - firebase_messaging: 61f678060b69a7ae1013e3a939ec8e1c56ef6fcf - FirebaseCore: 6b32c57269bd999aab34354c3923d92a6e5f3f84 + Firebase: 374a441a91ead896215703a674d58cdb3e9d772b + firebase_core: 6d9bb8b0ea817e8fe0d928177d42275b45fdba6f + firebase_messaging: ae8e88b586e4d50abc7cac5bacf74d21967fd226 + FirebaseCore: 48b0dd707581cf9c1a1220da68223fb0a562afaa FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2 - FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414 - FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2 + FirebaseInstallations: efc0946fc756e4d22d8113f7c761948120322e8c + FirebaseMessaging: e1aca1fcc23e8b9eddb0e33f375ff90944623021 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d diff --git a/pigeon/notifications.dart b/pigeon/notifications.dart index 3976899279..708ae4efb5 100644 --- a/pigeon/notifications.dart +++ b/pigeon/notifications.dart @@ -129,9 +129,7 @@ class MessagingStyle { final Person user; final String? conversationTitle; - // TODO(pigeon): Make list item non-nullable, once pigeon supports non-nullable type arguments. - // https://github.com/flutter/flutter/issues/97848 - final List messages; + final List messages; final bool isGroupConversation; } @@ -142,7 +140,7 @@ class Notification { Notification({required this.group, required this.extras}); final String group; - final Map extras; + final Map extras; // Various other properties too; add them if needed. } @@ -267,7 +265,7 @@ abstract class AndroidNotificationHostApi { PendingIntent? contentIntent, String? contentText, String? contentTitle, - Map? extras, + Map? extras, String? groupKey, InboxStyle? inboxStyle, bool? isGroupSummary, diff --git a/pubspec.lock b/pubspec.lock index e98a6a5339..4d5f5d63df 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: daa1d780fdecf8af925680c06c86563cdd445deea995d5c9176f1302a2b10bbe + sha256: "27899c95f9e7ec06c8310e6e0eac967707714b9f1450c4a58fa00ca011a4a8ae" url: "https://pub.dev" source: hosted - version: "1.3.48" + version: "1.3.49" _macros: dependency: transitive description: dart @@ -30,14 +30,6 @@ packages: url: "https://pub.dev" source: hosted version: "6.11.0" - analyzer_plugin: - dependency: transitive - description: - name: analyzer_plugin - sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" - url: "https://pub.dev" - source: hosted - version: "0.11.3" app_settings: dependency: "direct main" description: @@ -138,10 +130,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" charcode: dependency: transitive description: @@ -194,10 +186,10 @@ packages: dependency: "direct main" description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" color_models: dependency: "direct overridden" description: @@ -267,10 +259,10 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074 + sha256: "4fa68e53e26ab17b70ca39f072c285562cfc1589df5bb1e9295db90f6645f431" url: "https://pub.dev" source: hosted - version: "10.1.2" + version: "11.2.0" device_info_plus_platform_interface: dependency: transitive description: @@ -283,18 +275,18 @@ packages: dependency: "direct main" description: name: drift - sha256: c2d073d35ad441730812f4ea05b5dd031fb81c5f9786a4f5fb77ecd6307b6f74 + sha256: af3941e4d544727b2eb80590eb64e9cb8d77cd68c7690265502ea6a2427aa621 url: "https://pub.dev" source: hosted - version: "2.22.1" + version: "2.23.1" drift_dev: dependency: "direct dev" description: name: drift_dev - sha256: f4ab5d6976b1e31551ceb82ff597a505bda7818ff4f7be08a1da9d55eb6e730c + sha256: fa98fdbb7303a1b5b2dc110cb516eda2253a5d291680f8cbc72b1af24099f7f9 url: "https://pub.dev" source: hosted - version: "2.22.1" + version: "2.23.1" fake_async: dependency: "direct dev" description: @@ -323,10 +315,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: c2376a6aae82358a9f9ccdd7d1f4006d08faa39a2767cce01031d9f593a8bd3b + sha256: c904b4ab56d53385563c7c39d8e9fa9af086f91495dfc48717ad84a42c3cf204 url: "https://pub.dev" source: hosted - version: "8.1.6" + version: "8.1.7" file_selector_linux: dependency: transitive description: @@ -363,10 +355,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "15d761b95dfa2906dfcc31b7fc6fe293188533d1a3ffe78389ba9e69bd7fdbde" + sha256: "0307c1fde82e2b8b97e0be2dab93612aff9a72f31ebe9bfac66ed8b37ef7c568" url: "https://pub.dev" source: hosted - version: "3.9.0" + version: "3.10.0" firebase_core_platform_interface: dependency: transitive description: @@ -387,26 +379,26 @@ packages: dependency: "direct main" description: name: firebase_messaging - sha256: "151a3ee68736abf293aab66d1317ade53c88abe1db09c75a0460aebf7767bbdf" + sha256: "48a8a59197c1c5174060ba9aa1e0036e9b5a0d28a0cc22d19c1fcabc67fafe3c" url: "https://pub.dev" source: hosted - version: "15.1.6" + version: "15.2.0" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: f331ee51e40c243f90cc7bc059222dfec4e5df53125b08d31fb28961b00d2a9d + sha256: "9770a8e91f54296829dcaa61ce9b7c2f9ae9abbf99976dd3103a60470d5264dd" url: "https://pub.dev" source: hosted - version: "4.5.49" + version: "4.6.0" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: efaf3fdc54cd77e0eedb8e75f7f01c808828c64d052ddbf94d3009974e47d30f + sha256: "329ca4ef45ec616abe6f1d5e58feed0934a50840a65aa327052354ad3c64ed77" url: "https://pub.dev" source: hosted - version: "3.9.5" + version: "3.10.0" fixnum: dependency: transitive description: @@ -446,10 +438,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -530,10 +522,10 @@ packages: dependency: "direct main" description: name: http_parser - sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.1.2" image_picker: dependency: "direct main" description: @@ -546,10 +538,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: fa8141602fde3f7e2f81dbf043613eb44dfa325fa0bcf93c0f142c9f7a2c193e + sha256: b62d34a506e12bb965e824b6db4fbf709ee4589cf5d3e99b45ab2287b008ee0c url: "https://pub.dev" source: hosted - version: "0.8.12+18" + version: "0.8.12+20" image_picker_for_web: dependency: transitive description: @@ -562,10 +554,10 @@ packages: dependency: transitive description: name: image_picker_ios - sha256: "4f0568120c6fcc0aaa04511cb9f9f4d29fc3d0139884b1d06be88dcec7641d6b" + sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" url: "https://pub.dev" source: hosted - version: "0.8.12+1" + version: "0.8.12+2" image_picker_linux: dependency: transitive description: @@ -586,10 +578,10 @@ packages: dependency: transitive description: name: image_picker_platform_interface - sha256: "9ec26d410ff46f483c5519c29c02ef0e02e13a543f882b152d4bfd2f06802f80" + sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.10.1" image_picker_windows: dependency: transitive description: @@ -647,10 +639,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c + sha256: b0a98230538fe5d0b60a22fb6bf1b6cb03471b53e3324ff6069c591679dd59c9 url: "https://pub.dev" source: hosted - version: "6.9.0" + version: "6.9.3" leak_tracker: dependency: transitive description: @@ -687,10 +679,10 @@ packages: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.1.1" logging: dependency: transitive description: @@ -711,10 +703,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -727,18 +719,18 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" mime: dependency: "direct main" description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "2.0.0" node_preamble: dependency: transitive description: @@ -839,18 +831,18 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" pigeon: dependency: "direct dev" description: name: pigeon - sha256: ba3727eabe6c23876605d05062de35ab861227ff87a77379898ecd0b8951ef49 + sha256: "694073e4677d631a5aa2c633c5944140c0e7f361cbf3e55b1709dd11688713bb" url: "https://pub.dev" source: hosted - version: "20.0.2" + version: "22.7.2" platform: dependency: transitive description: @@ -903,10 +895,10 @@ packages: dependency: transitive description: name: pubspec_parse - sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.0" recase: dependency: transitive description: @@ -972,10 +964,10 @@ packages: dependency: transitive description: name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "2.0.0" source_helper: dependency: transitive description: @@ -1020,10 +1012,10 @@ packages: dependency: "direct main" description: name: sqlite3 - sha256: cb7f4e9dc1b52b1fa350f7b3d41c662e75fc3d399555fa4e5efcf267e9a4fbb5 + sha256: c284434c408d207863800341298cadfde23abe074a0f01b19c9d8cce4edb8eaa url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" sqlite3_flutter_libs: dependency: "direct main" description: @@ -1044,18 +1036,18 @@ packages: dependency: "direct dev" description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "4ac0537115a24d772c408a2520ecd0abb99bca2ea9c4e634ccbdbfae64fe17ec" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" stream_transform: dependency: transitive description: @@ -1068,10 +1060,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" sync_http: dependency: transitive description: @@ -1084,10 +1076,10 @@ packages: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test: dependency: "direct dev" description: @@ -1180,18 +1172,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4" + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.4" uuid: dependency: transitive description: @@ -1220,18 +1212,18 @@ packages: dependency: transitive description: name: video_player_android - sha256: "391e092ba4abe2f93b3e625bd6b6a6ec7d7414279462c1c0ee42b5ab8d0a0898" + sha256: "7018dbcb395e2bca0b9a898e73989e67c0c4a5db269528e1b036ca38bcca0d0b" url: "https://pub.dev" source: hosted - version: "2.7.16" + version: "2.7.17" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - sha256: "33224c19775fd244be2d6e3dbd8e1826ab162877bd61123bf71890772119a2b7" + sha256: "61c54fb08fee52861d819a9b3b8e30b92456dad43a875434c677c892eb7772de" url: "https://pub.dev" source: hosted - version: "2.6.5" + version: "2.6.6" video_player_platform_interface: dependency: "direct dev" description: @@ -1324,10 +1316,10 @@ packages: dependency: transitive description: name: win32 - sha256: "8b338d4486ab3fbc0ba0db9f9b4f5239b6697fcee427939a40e720cbb9ee0a69" + sha256: "154360849a56b7b67331c21f09a386562d88903f90a1099c5987afc1912e1f29" url: "https://pub.dev" source: hosted - version: "5.9.0" + version: "5.10.0" win32_registry: dependency: transitive description: @@ -1368,5 +1360,5 @@ packages: source: path version: "0.0.1" sdks: - dart: ">=3.7.0-267.0.dev <4.0.0" - flutter: ">=3.28.0-2.0.pre.38575" + dart: ">=3.7.0-312.0.dev <4.0.0" + flutter: ">=3.28.0-2.0.pre.38699" diff --git a/pubspec.yaml b/pubspec.yaml index 47859296ed..0d637ee9ec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,8 +14,8 @@ environment: # We use a recent version of Flutter from its main channel, and # the corresponding recent version of the Dart SDK. # Feel free to update these regularly; see README.md for instructions. - sdk: '>=3.7.0-267.0.dev <4.0.0' - flutter: '>=3.28.0-2.0.pre.38575' # 65ff060283e19423e9538c18c24e44495b70aeff + sdk: '>=3.7.0-312.0.dev <4.0.0' + flutter: '>=3.28.0-2.0.pre.38699' # d14140f85439c517c98b0c40f8eaf942fcb46c74 # To update dependencies, see instructions in README.md. dependencies: @@ -39,7 +39,7 @@ dependencies: collection: ^1.17.2 convert: ^3.1.1 crypto: ^3.0.3 - device_info_plus: ^10.0.1 + device_info_plus: ^11.2.0 drift: ^2.5.0 file_picker: ^8.0.0+1 firebase_core: ^3.3.0 @@ -50,7 +50,7 @@ dependencies: http_parser: ^4.0.2 image_picker: ^1.0.0 json_annotation: ^4.9.0 - mime: ^1.0.5 + mime: ^2.0.0 package_info_plus: ^8.0.0 path: ^1.8.3 path_provider: ^2.0.13 @@ -97,11 +97,11 @@ dev_dependencies: drift_dev: ^2.5.2 fake_async: ^1.3.1 flutter_checks: ^0.1.1 - flutter_lints: ^4.0.0 + flutter_lints: ^5.0.0 ini: ^2.1.0 json_serializable: ^6.5.4 legacy_checks: ^0.1.0 - pigeon: ^20.0.1 + pigeon: ^22.7.2 plugin_platform_interface: ^2.1.8 stack_trace: ^1.11.1 test: ^1.23.1 diff --git a/test/model/binding.dart b/test/model/binding.dart index badbbcf7e0..039d6c3787 100644 --- a/test/model/binding.dart +++ b/test/model/binding.dart @@ -4,6 +4,7 @@ import 'package:clock/clock.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; import 'package:test/fake.dart'; import 'package:url_launcher/url_launcher.dart' as url_launcher; import 'package:zulip/host/android_notifications.dart'; @@ -398,6 +399,7 @@ class FakeFirebaseMessaging extends Fake implements FirebaseMessaging { timeSensitive: AppleNotificationSetting.disabled, criticalAlert: AppleNotificationSetting.disabled, sound: AppleNotificationSetting.enabled, + providesAppNotificationSettings: AppleNotificationSetting.disabled, ); List takeRequestPermissionCalls() { @@ -416,6 +418,7 @@ class FakeFirebaseMessaging extends Fake implements FirebaseMessaging { bool criticalAlert = false, bool provisional = false, bool sound = true, + bool providesAppNotificationSettings = false, }) async { _requestPermissionCalls.add(( alert: alert, @@ -425,6 +428,7 @@ class FakeFirebaseMessaging extends Fake implements FirebaseMessaging { criticalAlert: criticalAlert, provisional: provisional, sound: sound, + providesAppNotificationSettings: providesAppNotificationSettings, )); return requestPermissionResult; } @@ -505,9 +509,24 @@ typedef FirebaseMessagingRequestPermissionCall = ({ bool criticalAlert, bool provisional, bool sound, + bool providesAppNotificationSettings, }); class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi { + // TODO(?): Find a better way to handle this. This member is exported from + // the Pigeon generated class but are not used for this fake class, + // so return the default value. + @override + // ignore: non_constant_identifier_names + final BinaryMessenger? pigeonVar_binaryMessenger = null; + + // TODO(?): Find a better way to handle this. This member is exported from + // the Pigeon generated class but are not used for this fake class, + // so return the default value. + @override + // ignore: non_constant_identifier_names + final String pigeonVar_messageChannelSuffix = ''; + /// Lists currently active channels, result is aggregated from calls made to /// [createNotificationChannel] and [deleteNotificationChannel], /// order of creation is preserved. @@ -532,7 +551,7 @@ class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi { } @override - Future> getNotificationChannels() async { + Future> getNotificationChannels() async { return _activeChannels.values.toList(growable: false); } @@ -567,7 +586,7 @@ class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi { } @override - Future> listStoredSoundsInNotificationsDirectory() async { + Future> listStoredSoundsInNotificationsDirectory() async { return _storedNotificationSounds.toList(growable: false); } @@ -631,7 +650,7 @@ class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi { PendingIntent? contentIntent, String? contentText, String? contentTitle, - Map? extras, + Map? extras, String? groupKey, InboxStyle? inboxStyle, bool? isGroupSummary, @@ -671,7 +690,7 @@ class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi { isGroupConversation: messagingStyle.isGroupConversation, messages: messagingStyle.messages.map((message) => MessagingStyleMessage( - text: message!.text, + text: message.text, timestampMs: message.timestampMs, person: Person( key: message.person.key, @@ -686,14 +705,14 @@ class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi { _activeNotificationsMessagingStyle[tag]; @override - Future> getActiveNotifications({required List desiredExtras}) async { + Future> getActiveNotifications({required List desiredExtras}) async { return _activeNotifications.values.map((statusNotif) { final notificationExtras = statusNotif.notification.extras; - statusNotif.notification.extras = Map.fromEntries( - desiredExtras - .map((key) => MapEntry(key, notificationExtras[key])) - .where((entry) => entry.value != null) - ); + statusNotif.notification.extras = { + for (final key in desiredExtras) + if (notificationExtras[key] != null) + key: notificationExtras[key]!, + }; return statusNotif; }).toList(growable: false); }