diff --git a/android/app/src/main/kotlin/com/zulip/flutter/AndroidIntents.g.kt b/android/app/src/main/kotlin/com/zulip/flutter/AndroidIntents.g.kt index b3a5b2b09..b03874e6a 100644 --- a/android/app/src/main/kotlin/com/zulip/flutter/AndroidIntents.g.kt +++ b/android/app/src/main/kotlin/com/zulip/flutter/AndroidIntents.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -14,36 +14,150 @@ import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer private object AndroidIntentsPigeonUtils { + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** Generated class from Pigeon that represents data sent in messages. */ @@ -69,15 +183,23 @@ data class IntentSharedFile ( ) } override fun equals(other: Any?): Boolean { - if (other !is IntentSharedFile) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidIntentsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as IntentSharedFile + return AndroidIntentsPigeonUtils.deepEquals(this.name, other.name) && AndroidIntentsPigeonUtils.deepEquals(this.mimeType, other.mimeType) && AndroidIntentsPigeonUtils.deepEquals(this.bytes, other.bytes) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidIntentsPigeonUtils.deepHash(this.name) + result = 31 * result + AndroidIntentsPigeonUtils.deepHash(this.mimeType) + result = 31 * result + AndroidIntentsPigeonUtils.deepHash(this.bytes) + return result + } } /** @@ -108,15 +230,23 @@ data class AndroidIntentSendEvent ( ) } override fun equals(other: Any?): Boolean { - if (other !is AndroidIntentSendEvent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidIntentsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AndroidIntentSendEvent + return AndroidIntentsPigeonUtils.deepEquals(this.action, other.action) && AndroidIntentsPigeonUtils.deepEquals(this.extraText, other.extraText) && AndroidIntentsPigeonUtils.deepEquals(this.extraStream, other.extraStream) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidIntentsPigeonUtils.deepHash(this.action) + result = 31 * result + AndroidIntentsPigeonUtils.deepHash(this.extraText) + result = 31 * result + AndroidIntentsPigeonUtils.deepHash(this.extraStream) + return result + } } private open class AndroidIntentsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/android/app/src/main/kotlin/com/zulip/flutter/AndroidNotifications.g.kt b/android/app/src/main/kotlin/com/zulip/flutter/AndroidNotifications.g.kt index da381a640..8b0bf4757 100644 --- a/android/app/src/main/kotlin/com/zulip/flutter/AndroidNotifications.g.kt +++ b/android/app/src/main/kotlin/com/zulip/flutter/AndroidNotifications.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -34,36 +34,150 @@ private object AndroidNotificationsPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -76,7 +190,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() /** * Corresponds to `androidx.core.app.NotificationChannelCompat` @@ -122,15 +236,26 @@ data class NotificationChannel ( ) } override fun equals(other: Any?): Boolean { - if (other !is NotificationChannel) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as NotificationChannel + return AndroidNotificationsPigeonUtils.deepEquals(this.id, other.id) && AndroidNotificationsPigeonUtils.deepEquals(this.importance, other.importance) && AndroidNotificationsPigeonUtils.deepEquals(this.name, other.name) && AndroidNotificationsPigeonUtils.deepEquals(this.lightsEnabled, other.lightsEnabled) && AndroidNotificationsPigeonUtils.deepEquals(this.soundUrl, other.soundUrl) && AndroidNotificationsPigeonUtils.deepEquals(this.vibrationPattern, other.vibrationPattern) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.id) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.importance) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.name) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.lightsEnabled) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.soundUrl) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.vibrationPattern) + return result + } } /** @@ -165,15 +290,23 @@ data class AndroidIntent ( ) } override fun equals(other: Any?): Boolean { - if (other !is AndroidIntent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AndroidIntent + return AndroidNotificationsPigeonUtils.deepEquals(this.action, other.action) && AndroidNotificationsPigeonUtils.deepEquals(this.dataUrl, other.dataUrl) && AndroidNotificationsPigeonUtils.deepEquals(this.flags, other.flags) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.action) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.dataUrl) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.flags) + return result + } } /** @@ -209,15 +342,23 @@ data class PendingIntent ( ) } override fun equals(other: Any?): Boolean { - if (other !is PendingIntent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as PendingIntent + return AndroidNotificationsPigeonUtils.deepEquals(this.requestCode, other.requestCode) && AndroidNotificationsPigeonUtils.deepEquals(this.intent, other.intent) && AndroidNotificationsPigeonUtils.deepEquals(this.flags, other.flags) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.requestCode) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.intent) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.flags) + return result + } } /** @@ -243,15 +384,21 @@ data class InboxStyle ( ) } override fun equals(other: Any?): Boolean { - if (other !is InboxStyle) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as InboxStyle + return AndroidNotificationsPigeonUtils.deepEquals(this.summaryText, other.summaryText) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.summaryText) + return result + } } /** @@ -293,15 +440,23 @@ data class Person ( ) } override fun equals(other: Any?): Boolean { - if (other !is Person) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as Person + return AndroidNotificationsPigeonUtils.deepEquals(this.iconBitmap, other.iconBitmap) && AndroidNotificationsPigeonUtils.deepEquals(this.key, other.key) && AndroidNotificationsPigeonUtils.deepEquals(this.name, other.name) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.iconBitmap) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.key) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.name) + return result + } } /** @@ -333,15 +488,23 @@ data class MessagingStyleMessage ( ) } override fun equals(other: Any?): Boolean { - if (other !is MessagingStyleMessage) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as MessagingStyleMessage + return AndroidNotificationsPigeonUtils.deepEquals(this.text, other.text) && AndroidNotificationsPigeonUtils.deepEquals(this.timestampMs, other.timestampMs) && AndroidNotificationsPigeonUtils.deepEquals(this.person, other.person) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.text) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.timestampMs) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.person) + return result + } } /** @@ -376,15 +539,24 @@ data class MessagingStyle ( ) } override fun equals(other: Any?): Boolean { - if (other !is MessagingStyle) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as MessagingStyle + return AndroidNotificationsPigeonUtils.deepEquals(this.user, other.user) && AndroidNotificationsPigeonUtils.deepEquals(this.conversationTitle, other.conversationTitle) && AndroidNotificationsPigeonUtils.deepEquals(this.messages, other.messages) && AndroidNotificationsPigeonUtils.deepEquals(this.isGroupConversation, other.isGroupConversation) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.user) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.conversationTitle) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.messages) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.isGroupConversation) + return result + } } /** @@ -413,15 +585,22 @@ data class Notification ( ) } override fun equals(other: Any?): Boolean { - if (other !is Notification) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as Notification + return AndroidNotificationsPigeonUtils.deepEquals(this.group, other.group) && AndroidNotificationsPigeonUtils.deepEquals(this.extras, other.extras) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.group) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.extras) + return result + } } /** @@ -453,15 +632,23 @@ data class StatusBarNotification ( ) } override fun equals(other: Any?): Boolean { - if (other !is StatusBarNotification) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as StatusBarNotification + return AndroidNotificationsPigeonUtils.deepEquals(this.id, other.id) && AndroidNotificationsPigeonUtils.deepEquals(this.tag, other.tag) && AndroidNotificationsPigeonUtils.deepEquals(this.notification, other.notification) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.id) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.tag) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.notification) + return result + } } /** @@ -503,15 +690,23 @@ data class StoredNotificationSound ( ) } override fun equals(other: Any?): Boolean { - if (other !is StoredNotificationSound) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return AndroidNotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as StoredNotificationSound + return AndroidNotificationsPigeonUtils.deepEquals(this.fileName, other.fileName) && AndroidNotificationsPigeonUtils.deepEquals(this.isOwned, other.isOwned) && AndroidNotificationsPigeonUtils.deepEquals(this.contentUrl, other.contentUrl) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.fileName) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.isOwned) + result = 31 * result + AndroidNotificationsPigeonUtils.deepHash(this.contentUrl) + return result + } } private open class AndroidNotificationsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/android/app/src/main/kotlin/com/zulip/flutter/notifications/Notifications.g.kt b/android/app/src/main/kotlin/com/zulip/flutter/notifications/Notifications.g.kt index 57908eb47..d3302e42c 100644 --- a/android/app/src/main/kotlin/com/zulip/flutter/notifications/Notifications.g.kt +++ b/android/app/src/main/kotlin/com/zulip/flutter/notifications/Notifications.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -34,36 +34,150 @@ private object NotificationsPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -76,7 +190,7 @@ class FlutterError ( val code: String, override val message: String? = null, val details: Any? = null -) : Throwable() +) : RuntimeException() /** Generated class from Pigeon that represents data sent in messages. */ data class NotificationDataFromLaunch ( @@ -101,15 +215,21 @@ data class NotificationDataFromLaunch ( ) } override fun equals(other: Any?): Boolean { - if (other !is NotificationDataFromLaunch) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return NotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as NotificationDataFromLaunch + return NotificationsPigeonUtils.deepEquals(this.payload, other.payload) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + NotificationsPigeonUtils.deepHash(this.payload) + return result + } } /** @@ -145,15 +265,21 @@ data class IosNotificationTapEvent ( ) } override fun equals(other: Any?): Boolean { - if (other !is IosNotificationTapEvent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return NotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as IosNotificationTapEvent + return NotificationsPigeonUtils.deepEquals(this.payload, other.payload) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + NotificationsPigeonUtils.deepHash(this.payload) + return result + } } /** @@ -188,15 +314,21 @@ data class AndroidNotificationTapEvent ( ) } override fun equals(other: Any?): Boolean { - if (other !is AndroidNotificationTapEvent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return NotificationsPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AndroidNotificationTapEvent + return NotificationsPigeonUtils.deepEquals(this.dataUrl, other.dataUrl) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + NotificationsPigeonUtils.deepHash(this.dataUrl) + return result + } } private open class NotificationsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/android/gradle.properties b/android/gradle.properties index 77c705e0a..346502046 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,6 +2,17 @@ org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true +# TODO(upstream) re-enable when upstream packages and other +# third-party dependencies migrate to use/support +# built-in Kotlin: +# https://github.com/flutter/flutter/issues/185121 +android.builtInKotlin=false + +# TODO(upstream) re-enable when upstream migrates Flutter Android +# Gradle plugin to use AGP "newDsl": +# https://github.com/flutter/flutter/issues/181557 +android.newDsl=false + # Versions for our Android build dependencies. # Defining them here makes them available both in # settings.gradle and in the build.gradle files. diff --git a/ios/NotificationService/IosNotifications.g.swift b/ios/NotificationService/IosNotifications.g.swift index 41e5000ba..c6f743457 100644 --- a/ios/NotificationService/IosNotifications.g.swift +++ b/ios/NotificationService/IosNotifications.g.swift @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -42,6 +42,19 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +private func doubleEqualsIosNotifications(_ lhs: Double, _ rhs: Double) -> Bool { + return (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashIosNotifications(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8000000000000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + func deepEqualsIosNotifications(_ lhs: Any?, _ rhs: Any?) -> Bool { let cleanLhs = nilOrValue(lhs) as Any? let cleanRhs = nilOrValue(rhs) as Any? @@ -52,59 +65,92 @@ func deepEqualsIosNotifications(_ lhs: Any?, _ rhs: Any?) -> Bool { case (nil, _), (_, nil): return false - case is (Void, Void): + case (let lhs as AnyObject, let rhs as AnyObject) where lhs === rhs: return true - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable + case is (Void, Void): + return true - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsIosNotifications(element, cleanRhsArray[index]) { + case (let lhsArray, let rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsIosNotifications(element, rhsArray[index]) { return false } } return true - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsIosNotifications(cleanLhsValue, cleanRhsDictionary[key]!) { + case (let lhsArray, let rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsIosNotifications(element, rhsArray[index]) { return false } } return true + case (let lhsDictionary, let rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsIosNotifications(lhsKey, rhsKey) { + if deepEqualsIosNotifications(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case (let lhs as Double, let rhs as Double): + return doubleEqualsIosNotifications(lhs, rhs) + + case (let lhsHashable, let rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be untrue. return false } } func deepHashIosNotifications(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { deepHashIosNotifications(value: item, hasher: &hasher) } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashIosNotifications(value: valueDict[key]!, hasher: &hasher) + let cleanValue = nilOrValue(value) as Any? + if let cleanValue = cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashIosNotifications(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashIosNotifications(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashIosNotifications(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashIosNotifications(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashIosNotifications(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) } - return - } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) + } else { + hasher.combine(0) } - - return hasher.combine(String(describing: value)) } - /// The notification content of the incoming push notification. /// @@ -128,9 +174,15 @@ struct NotificationContent: Hashable { ] } static func == (lhs: NotificationContent, rhs: NotificationContent) -> Bool { - return deepEqualsIosNotifications(lhs.toList(), rhs.toList()) } + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsIosNotifications(lhs.payload, rhs.payload) + } + func hash(into hasher: inout Hasher) { - deepHashIosNotifications(value: toList(), hasher: &hasher) + hasher.combine("NotificationContent") + deepHashIosNotifications(value: payload, hasher: &hasher) } } @@ -174,9 +226,18 @@ struct ImprovedNotificationContent: Hashable { ] } static func == (lhs: ImprovedNotificationContent, rhs: ImprovedNotificationContent) -> Bool { - return deepEqualsIosNotifications(lhs.toList(), rhs.toList()) } + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsIosNotifications(lhs.title, rhs.title) && deepEqualsIosNotifications(lhs.subtitle, rhs.subtitle) && deepEqualsIosNotifications(lhs.body, rhs.body) && deepEqualsIosNotifications(lhs.userInfo, rhs.userInfo) + } + func hash(into hasher: inout Hasher) { - deepHashIosNotifications(value: toList(), hasher: &hasher) + hasher.combine("ImprovedNotificationContent") + deepHashIosNotifications(value: title, hasher: &hasher) + deepHashIosNotifications(value: subtitle, hasher: &hasher) + deepHashIosNotifications(value: body, hasher: &hasher) + deepHashIosNotifications(value: userInfo, hasher: &hasher) } } diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 7835a938e..f3a5100c8 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -38,32 +38,32 @@ PODS: - file_picker (0.0.1): - DKImagePickerController/PhotoGallery - Flutter - - Firebase/CoreOnly (12.9.0): - - FirebaseCore (~> 12.9.0) - - Firebase/Messaging (12.9.0): + - Firebase/CoreOnly (12.12.0): + - FirebaseCore (~> 12.12.0) + - Firebase/Messaging (12.12.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 12.9.0) - - firebase_core (4.5.0): - - Firebase/CoreOnly (= 12.9.0) + - FirebaseMessaging (~> 12.12.0) + - firebase_core (4.7.0): + - Firebase/CoreOnly (= 12.12.0) - Flutter - - firebase_messaging (16.1.2): - - Firebase/Messaging (= 12.9.0) + - firebase_messaging (16.2.0): + - Firebase/Messaging (= 12.12.0) - firebase_core - Flutter - - FirebaseCore (12.9.0): - - FirebaseCoreInternal (~> 12.9.0) + - FirebaseCore (12.12.1): + - FirebaseCoreInternal (~> 12.12.0) - GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Logger (~> 8.1) - - FirebaseCoreInternal (12.9.0): + - FirebaseCoreInternal (12.12.0): - "GoogleUtilities/NSData+zlib (~> 8.1)" - - FirebaseInstallations (12.9.0): - - FirebaseCore (~> 12.9.0) + - FirebaseInstallations (12.12.0): + - FirebaseCore (~> 12.12.0) - GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/UserDefaults (~> 8.1) - PromisesObjC (~> 2.4) - - FirebaseMessaging (12.9.0): - - FirebaseCore (~> 12.9.0) - - FirebaseInstallations (~> 12.9.0) + - FirebaseMessaging (12.12.0): + - FirebaseCore (~> 12.12.0) + - FirebaseInstallations (~> 12.12.0) - GoogleDataTransport (~> 10.1) - GoogleUtilities/AppDelegateSwizzler (~> 8.1) - GoogleUtilities/Environment (~> 8.1) @@ -119,34 +119,6 @@ PODS: - SDWebImage/Core (5.21.7) - share_plus (0.0.1): - Flutter - - "sodium_libs (3.4.6+4)": - - Flutter - - FlutterMacOS - - sqlite3 (3.51.1): - - sqlite3/common (= 3.51.1) - - sqlite3/common (3.51.1) - - sqlite3/dbstatvtab (3.51.1): - - sqlite3/common - - sqlite3/fts5 (3.51.1): - - sqlite3/common - - sqlite3/math (3.51.1): - - sqlite3/common - - sqlite3/perf-threadsafe (3.51.1): - - sqlite3/common - - sqlite3/rtree (3.51.1): - - sqlite3/common - - sqlite3/session (3.51.1): - - sqlite3/common - - sqlite3_flutter_libs (0.0.1): - - Flutter - - FlutterMacOS - - sqlite3 (~> 3.51.1) - - sqlite3/dbstatvtab - - sqlite3/fts5 - - sqlite3/math - - sqlite3/perf-threadsafe - - sqlite3/rtree - - sqlite3/session - SwiftyGif (5.4.5) - url_launcher_ios (0.0.1): - Flutter @@ -168,8 +140,6 @@ DEPENDENCIES: - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - patrol (from `.symlinks/plugins/patrol/darwin`) - share_plus (from `.symlinks/plugins/share_plus/ios`) - - sodium_libs (from `.symlinks/plugins/sodium_libs/darwin`) - - sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/darwin`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`) @@ -189,7 +159,6 @@ SPEC REPOS: - nanopb - PromisesObjC - SDWebImage - - sqlite3 - SwiftyGif EXTERNAL SOURCES: @@ -215,10 +184,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/patrol/darwin" share_plus: :path: ".symlinks/plugins/share_plus/ios" - sodium_libs: - :path: ".symlinks/plugins/sodium_libs/darwin" - sqlite3_flutter_libs: - :path: ".symlinks/plugins/sqlite3_flutter_libs/darwin" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" video_player_avfoundation: @@ -233,13 +198,13 @@ SPEC CHECKSUMS: DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be - Firebase: 065f2bb395062046623036d8e6dc857bc2521d56 - firebase_core: afac1aac13c931e0401c7e74ed1276112030efab - firebase_messaging: 7cb2727feb789751fc6936bcc8e08408970e2820 - FirebaseCore: 428912f751178b06bef0a1793effeb4a5e09a9b8 - FirebaseCoreInternal: b321eafae5362113bc182956fafc9922cfc77b72 - FirebaseInstallations: 7b64ffd006032b2b019a59b803858df5112d9eaa - FirebaseMessaging: 7d6cdbff969127c4151c824fe432f0e301210f15 + Firebase: aa154fee4e9b8eac17aa42344988865b3e857d33 + firebase_core: 9156a152117c843440b0b990c785aa0259bc5447 + firebase_messaging: 0d962ab44ff24ed36deb8fa2ee043c4671858269 + FirebaseCore: 86241206e656f5c80c995e370e6c975913b9b284 + FirebaseCoreInternal: 7c12fc3011d889085e765e317d7b9fd1cef97af9 + FirebaseInstallations: 4e6e162aa4abaaeeeb01dd00179dfc5ad9c2194e + FirebaseMessaging: 341004946fa7ffc741344b20f1b667514fc93e31 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 @@ -251,9 +216,6 @@ SPEC CHECKSUMS: PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a - sodium_libs: 650f802d77b08c737ca4fed4ed68e822fa560c5a - sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b - sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a diff --git a/ios/Runner/IosNative.g.swift b/ios/Runner/IosNative.g.swift index 3b8682273..72846a90f 100644 --- a/ios/Runner/IosNative.g.swift +++ b/ios/Runner/IosNative.g.swift @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -32,7 +32,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } diff --git a/ios/Runner/Notifications.g.swift b/ios/Runner/Notifications.g.swift index 7483f97cd..e388bf8e5 100644 --- a/ios/Runner/Notifications.g.swift +++ b/ios/Runner/Notifications.g.swift @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), do not edit directly. // See also: https://pub.dev/packages/pigeon import Foundation @@ -50,7 +50,7 @@ private func wrapError(_ error: Any) -> [Any?] { } return [ "\(error)", - "\(type(of: error))", + "\(Swift.type(of: error))", "Stacktrace: \(Thread.callStackSymbols)", ] } @@ -64,6 +64,19 @@ private func nilOrValue(_ value: Any?) -> T? { return value as! T? } +private func doubleEqualsNotifications(_ lhs: Double, _ rhs: Double) -> Bool { + return (lhs.isNaN && rhs.isNaN) || lhs == rhs +} + +private func doubleHashNotifications(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8000000000000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } +} + func deepEqualsNotifications(_ lhs: Any?, _ rhs: Any?) -> Bool { let cleanLhs = nilOrValue(lhs) as Any? let cleanRhs = nilOrValue(rhs) as Any? @@ -74,59 +87,92 @@ func deepEqualsNotifications(_ lhs: Any?, _ rhs: Any?) -> Bool { case (nil, _), (_, nil): return false - case is (Void, Void): + case (let lhs as AnyObject, let rhs as AnyObject) where lhs === rhs: return true - case let (cleanLhsHashable, cleanRhsHashable) as (AnyHashable, AnyHashable): - return cleanLhsHashable == cleanRhsHashable + case is (Void, Void): + return true - case let (cleanLhsArray, cleanRhsArray) as ([Any?], [Any?]): - guard cleanLhsArray.count == cleanRhsArray.count else { return false } - for (index, element) in cleanLhsArray.enumerated() { - if !deepEqualsNotifications(element, cleanRhsArray[index]) { + case (let lhsArray, let rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEqualsNotifications(element, rhsArray[index]) { return false } } return true - case let (cleanLhsDictionary, cleanRhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): - guard cleanLhsDictionary.count == cleanRhsDictionary.count else { return false } - for (key, cleanLhsValue) in cleanLhsDictionary { - guard cleanRhsDictionary.index(forKey: key) != nil else { return false } - if !deepEqualsNotifications(cleanLhsValue, cleanRhsDictionary[key]!) { + case (let lhsArray, let rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEqualsNotifications(element, rhsArray[index]) { return false } } return true + case (let lhsDictionary, let rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEqualsNotifications(lhsKey, rhsKey) { + if deepEqualsNotifications(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case (let lhs as Double, let rhs as Double): + return doubleEqualsNotifications(lhs, rhs) + + case (let lhsHashable, let rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + default: - // Any other type shouldn't be able to be used with pigeon. File an issue if you find this to be untrue. return false } } func deepHashNotifications(value: Any?, hasher: inout Hasher) { - if let valueList = value as? [AnyHashable] { - for item in valueList { deepHashNotifications(value: item, hasher: &hasher) } - return - } - - if let valueDict = value as? [AnyHashable: AnyHashable] { - for key in valueDict.keys { - hasher.combine(key) - deepHashNotifications(value: valueDict[key]!, hasher: &hasher) + let cleanValue = nilOrValue(value) as Any? + if let cleanValue = cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHashNotifications(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHashNotifications(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHashNotifications(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHashNotifications(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHashNotifications(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) } - return + } else { + hasher.combine(0) } - - if let hashableValue = value as? AnyHashable { - hasher.combine(hashableValue.hashValue) - } - - return hasher.combine(String(describing: value)) } - /// Generated class from Pigeon that represents data sent in messages. struct NotificationDataFromLaunch: Hashable { @@ -151,9 +197,15 @@ struct NotificationDataFromLaunch: Hashable { ] } static func == (lhs: NotificationDataFromLaunch, rhs: NotificationDataFromLaunch) -> Bool { - return deepEqualsNotifications(lhs.toList(), rhs.toList()) } + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsNotifications(lhs.payload, rhs.payload) + } + func hash(into hasher: inout Hasher) { - deepHashNotifications(value: toList(), hasher: &hasher) + hasher.combine("NotificationDataFromLaunch") + deepHashNotifications(value: payload, hasher: &hasher) } } @@ -189,9 +241,15 @@ struct IosNotificationTapEvent: NotificationTapEvent { ] } static func == (lhs: IosNotificationTapEvent, rhs: IosNotificationTapEvent) -> Bool { - return deepEqualsNotifications(lhs.toList(), rhs.toList()) } + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsNotifications(lhs.payload, rhs.payload) + } + func hash(into hasher: inout Hasher) { - deepHashNotifications(value: toList(), hasher: &hasher) + hasher.combine("IosNotificationTapEvent") + deepHashNotifications(value: payload, hasher: &hasher) } } @@ -225,9 +283,15 @@ struct AndroidNotificationTapEvent: NotificationTapEvent { ] } static func == (lhs: AndroidNotificationTapEvent, rhs: AndroidNotificationTapEvent) -> Bool { - return deepEqualsNotifications(lhs.toList(), rhs.toList()) } + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return deepEqualsNotifications(lhs.dataUrl, rhs.dataUrl) + } + func hash(into hasher: inout Hasher) { - deepHashNotifications(value: toList(), hasher: &hasher) + hasher.combine("AndroidNotificationTapEvent") + deepHashNotifications(value: dataUrl, hasher: &hasher) } } diff --git a/lib/host/android_intents.g.dart b/lib/host/android_intents.g.dart index 0e75ec44c..2ac911e3d 100644 --- a/lib/host/android_intents.g.dart +++ b/lib/host/android_intents.g.dart @@ -1,26 +1,75 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), 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, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class IntentSharedFile { IntentSharedFile({ @@ -64,13 +113,12 @@ class IntentSharedFile { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(name, other.name) && _deepEquals(mimeType, other.mimeType) && _deepEquals(bytes, other.bytes); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } sealed class AndroidIntentEvent { @@ -118,13 +166,12 @@ class AndroidIntentSendEvent extends AndroidIntentEvent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(action, other.action) && _deepEquals(extraText, other.extraText) && _deepEquals(extraStream, other.extraStream); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } diff --git a/lib/host/android_notifications.g.dart b/lib/host/android_notifications.g.dart index e5548ce68..96a2143f1 100644 --- a/lib/host/android_notifications.g.dart +++ b/lib/host/android_notifications.g.dart @@ -1,12 +1,13 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), 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, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; Object? _extractReplyValueOrThrow( List? replyList, @@ -34,19 +35,67 @@ Object? _extractReplyValueOrThrow( } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + /// Corresponds to `androidx.core.app.NotificationChannelCompat` /// @@ -112,13 +161,12 @@ class NotificationChannel { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(importance, other.importance) && _deepEquals(name, other.name) && _deepEquals(lightsEnabled, other.lightsEnabled) && _deepEquals(soundUrl, other.soundUrl) && _deepEquals(vibrationPattern, other.vibrationPattern); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `android.content.Intent` @@ -169,13 +217,12 @@ class AndroidIntent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(action, other.action) && _deepEquals(dataUrl, other.dataUrl) && _deepEquals(flags, other.flags); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `android.app.PendingIntent`. @@ -225,13 +272,12 @@ class PendingIntent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(requestCode, other.requestCode) && _deepEquals(intent, other.intent) && _deepEquals(flags, other.flags); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `androidx.core.app.NotificationCompat.InboxStyle` @@ -269,13 +315,12 @@ class InboxStyle { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(summaryText, other.summaryText); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `androidx.core.app.Person` @@ -331,13 +376,12 @@ class Person { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(iconBitmap, other.iconBitmap) && _deepEquals(key, other.key) && _deepEquals(name, other.name); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `androidx.core.app.NotificationCompat.MessagingStyle.Message` @@ -385,13 +429,12 @@ class MessagingStyleMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(text, other.text) && _deepEquals(timestampMs, other.timestampMs) && _deepEquals(person, other.person); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `androidx.core.app.NotificationCompat.MessagingStyle` @@ -430,7 +473,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, ); } @@ -444,13 +487,12 @@ class MessagingStyle { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(user, other.user) && _deepEquals(conversationTitle, other.conversationTitle) && _deepEquals(messages, other.messages) && _deepEquals(isGroupConversation, other.isGroupConversation); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `android.app.Notification` @@ -480,7 +522,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(), ); } @@ -493,13 +535,12 @@ class Notification { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(group, other.group) && _deepEquals(extras, other.extras); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Corresponds to `android.service.notification.StatusBarNotification` @@ -547,13 +588,12 @@ class StatusBarNotification { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(tag, other.tag) && _deepEquals(notification, other.notification); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents details about a notification sound stored in the @@ -609,13 +649,12 @@ class StoredNotificationSound { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(fileName, other.fileName) && _deepEquals(isOwned, other.isOwned) && _deepEquals(contentUrl, other.contentUrl); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } @@ -737,13 +776,13 @@ class AndroidNotificationHostApi { final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - final Object pigeonVar_replyValue = _extractReplyValueOrThrow( + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( pigeonVar_replyList, pigeonVar_channelName, isNullValid: false, ) - !; - return (pigeonVar_replyValue as List).cast(); + ; + return (pigeonVar_replyValue! as List).cast(); } /// Corresponds to `androidx.core.app.NotificationManagerCompat.deleteNotificationChannel` @@ -787,13 +826,13 @@ class AndroidNotificationHostApi { final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - final Object pigeonVar_replyValue = _extractReplyValueOrThrow( + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( pigeonVar_replyList, pigeonVar_channelName, isNullValid: false, ) - !; - return (pigeonVar_replyValue as List).cast(); + ; + return (pigeonVar_replyValue! as List).cast(); } /// Wraps `android.content.ContentResolver.insert` combined with @@ -820,13 +859,13 @@ class AndroidNotificationHostApi { final Future pigeonVar_sendFuture = pigeonVar_channel.send([targetFileDisplayName, sourceResourceName]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - final Object pigeonVar_replyValue = _extractReplyValueOrThrow( + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( pigeonVar_replyList, pigeonVar_channelName, isNullValid: false, ) - !; - return pigeonVar_replyValue as String; + ; + return pigeonVar_replyValue! as String; } /// Corresponds to `android.app.NotificationManager.notify`, @@ -912,13 +951,13 @@ class AndroidNotificationHostApi { final Future pigeonVar_sendFuture = pigeonVar_channel.send([desiredExtras]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - final Object pigeonVar_replyValue = _extractReplyValueOrThrow( + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( pigeonVar_replyList, pigeonVar_channelName, isNullValid: false, ) - !; - return (pigeonVar_replyValue as List).cast(); + ; + return (pigeonVar_replyValue! as List).cast(); } /// Corresponds to `androidx.core.app.NotificationManagerCompat.cancel`. diff --git a/lib/host/ios_native.g.dart b/lib/host/ios_native.g.dart index d2bd4ed8f..a2ea2c09a 100644 --- a/lib/host/ios_native.g.dart +++ b/lib/host/ios_native.g.dart @@ -1,12 +1,13 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), 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, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; Object? _extractReplyValueOrThrow( List? replyList, diff --git a/lib/host/ios_notifications.g.dart b/lib/host/ios_notifications.g.dart index 4cd90afb4..3aecd4442 100644 --- a/lib/host/ios_notifications.g.dart +++ b/lib/host/ios_notifications.g.dart @@ -1,12 +1,13 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), 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, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { @@ -18,19 +19,67 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + /// The notification content of the incoming push notification. class NotificationContent { @@ -53,7 +102,7 @@ class NotificationContent { static NotificationContent decode(Object result) { result as List; return NotificationContent( - payload: (result[0] as Map?)!.cast(), + payload: result[0]! as Map, ); } @@ -66,13 +115,12 @@ class NotificationContent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(payload, other.payload); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// The improved notification content that will be displayed to the user. @@ -117,7 +165,7 @@ class ImprovedNotificationContent { title: result[0]! as String, subtitle: result[1]! as String, body: result[2]! as String, - userInfo: (result[3] as Map?)!.cast(), + userInfo: (result[3]! as Map).cast(), ); } @@ -130,13 +178,12 @@ class ImprovedNotificationContent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(title, other.title) && _deepEquals(subtitle, other.subtitle) && _deepEquals(body, other.body) && _deepEquals(userInfo, other.userInfo); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } @@ -201,14 +248,10 @@ abstract class IosNotifFlutterApi { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.zulip.IosNotifFlutterApi.didReceivePushNotification was null.'); - final List args = (message as List?)!; - final NotificationContent? arg_content = (args[0] as NotificationContent?); - assert(arg_content != null, - 'Argument for dev.flutter.pigeon.zulip.IosNotifFlutterApi.didReceivePushNotification was null, expected non-null NotificationContent.'); + final List args = message! as List; + final NotificationContent arg_content = args[0]! as NotificationContent; try { - final ImprovedNotificationContent output = await api.didReceivePushNotification(arg_content!); + final ImprovedNotificationContent output = await api.didReceivePushNotification(arg_content); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/lib/host/notifications.g.dart b/lib/host/notifications.g.dart index 437c82de4..075db1488 100644 --- a/lib/host/notifications.g.dart +++ b/lib/host/notifications.g.dart @@ -1,12 +1,13 @@ -// Autogenerated from Pigeon (v26.2.0), do not edit directly. +// Autogenerated from Pigeon (v26.3.4), 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, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; Object? _extractReplyValueOrThrow( List? replyList, @@ -34,19 +35,67 @@ Object? _extractReplyValueOrThrow( } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class NotificationDataFromLaunch { NotificationDataFromLaunch({ @@ -71,7 +120,7 @@ class NotificationDataFromLaunch { static NotificationDataFromLaunch decode(Object result) { result as List; return NotificationDataFromLaunch( - payload: (result[0] as Map?)!.cast(), + payload: result[0]! as Map, ); } @@ -84,13 +133,12 @@ class NotificationDataFromLaunch { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(payload, other.payload); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } sealed class NotificationTapEvent { @@ -121,7 +169,7 @@ class IosNotificationTapEvent extends NotificationTapEvent { static IosNotificationTapEvent decode(Object result) { result as List; return IosNotificationTapEvent( - payload: (result[0] as Map?)!.cast(), + payload: result[0]! as Map, ); } @@ -134,13 +182,12 @@ class IosNotificationTapEvent extends NotificationTapEvent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(payload, other.payload); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// On Android, an event emitted when a notification is tapped. @@ -185,13 +232,12 @@ class AndroidNotificationTapEvent extends NotificationTapEvent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(dataUrl, other.dataUrl); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } diff --git a/lib/model/binding.dart b/lib/model/binding.dart index 2ecd79df1..19bcde1c0 100644 --- a/lib/model/binding.dart +++ b/lib/model/binding.dart @@ -7,7 +7,7 @@ import 'package:firebase_messaging/firebase_messaging.dart' as firebase_messagin import 'package:flutter/foundation.dart'; import 'package:image_picker/image_picker.dart' as image_picker; import 'package:package_info_plus/package_info_plus.dart' as package_info_plus; -import 'package:sodium_libs/sodium_libs.dart'; +import 'package:sodium/sodium.dart'; import 'package:url_launcher/url_launcher.dart' as url_launcher; import 'package:wakelock_plus/wakelock_plus.dart' as wakelock_plus; @@ -168,11 +168,11 @@ abstract class ZulipBinding { /// or null if that hasn't resolved yet. PackageInfo? get syncPackageInfo; - /// Get the singleton for `package:sodium_libs` aka libsodium, + /// Get the singleton for `package:sodium` aka libsodium, /// used for cryptography. /// /// This wraps [SodiumInit.init]. - Future sodiumInit(); + FutureOr sodiumInit(); /// Initialize Firebase, to use for notifications. /// @@ -500,7 +500,7 @@ class LiveZulipBinding extends ZulipBinding { } @override - Future sodiumInit() => SodiumInit.init(); + FutureOr sodiumInit() => SodiumInit.init(); @override Future firebaseInitializeApp({ @@ -541,7 +541,7 @@ class LiveZulipBinding extends ZulipBinding { bool withReadStream = false, file_picker.FileType type = file_picker.FileType.any, }) async { - return file_picker.FilePicker.platform.pickFiles( + return file_picker.FilePicker.pickFiles( allowMultiple: allowMultiple, withReadStream: withReadStream, type: type, diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 47f1865ff..7299b5cf2 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,20 +7,12 @@ #include "generated_plugin_registrant.h" #include -#include -#include #include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_registrar); - g_autoptr(FlPluginRegistrar) sodium_libs_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "SodiumLibsPlugin"); - sodium_libs_plugin_register_with_registrar(sodium_libs_registrar); - g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); - sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 9d412be16..886932bf3 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,12 +4,11 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux - sodium_libs - sqlite3_flutter_libs url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8ed52756b..8e06112ff 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -14,8 +14,6 @@ import firebase_messaging import package_info_plus import patrol import share_plus -import sodium_libs -import sqlite3_flutter_libs import url_launcher_macos import video_player_avfoundation import wakelock_plus @@ -30,8 +28,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PatrolPlugin.register(with: registry.registrar(forPlugin: "PatrolPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) - SodiumLibsPlugin.register(with: registry.registrar(forPlugin: "SodiumLibsPlugin")) - Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin")) diff --git a/macos/Podfile.lock b/macos/Podfile.lock index dfae05a60..22a71b58e 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -8,33 +8,33 @@ PODS: - FlutterMacOS - file_selector_macos (0.0.1): - FlutterMacOS - - Firebase/CoreOnly (12.9.0): - - FirebaseCore (~> 12.9.0) - - Firebase/Messaging (12.9.0): + - Firebase/CoreOnly (12.12.1): + - FirebaseCore (~> 12.12.1) + - Firebase/Messaging (12.12.1): - Firebase/CoreOnly - - FirebaseMessaging (~> 12.9.0) - - firebase_core (4.5.0): - - Firebase/CoreOnly (~> 12.9.0) + - FirebaseMessaging (~> 12.12.0) + - firebase_core (4.7.0): + - Firebase/CoreOnly (~> 12.12.0) - FlutterMacOS - - firebase_messaging (16.1.2): - - Firebase/CoreOnly (~> 12.9.0) - - Firebase/Messaging (~> 12.9.0) + - firebase_messaging (16.2.0): + - Firebase/CoreOnly (~> 12.12.0) + - Firebase/Messaging (~> 12.12.0) - firebase_core - FlutterMacOS - - FirebaseCore (12.9.0): - - FirebaseCoreInternal (~> 12.9.0) + - FirebaseCore (12.12.1): + - FirebaseCoreInternal (~> 12.12.0) - GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Logger (~> 8.1) - - FirebaseCoreInternal (12.9.0): + - FirebaseCoreInternal (12.12.0): - "GoogleUtilities/NSData+zlib (~> 8.1)" - - FirebaseInstallations (12.9.0): - - FirebaseCore (~> 12.9.0) + - FirebaseInstallations (12.12.0): + - FirebaseCore (~> 12.12.0) - GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/UserDefaults (~> 8.1) - PromisesObjC (~> 2.4) - - FirebaseMessaging (12.9.0): - - FirebaseCore (~> 12.9.0) - - FirebaseInstallations (~> 12.9.0) + - FirebaseMessaging (12.12.0): + - FirebaseCore (~> 12.12.0) + - FirebaseInstallations (~> 12.12.0) - GoogleDataTransport (~> 10.1) - GoogleUtilities/AppDelegateSwizzler (~> 8.1) - GoogleUtilities/Environment (~> 8.1) @@ -83,34 +83,6 @@ PODS: - PromisesObjC (2.4.0) - share_plus (0.0.1): - FlutterMacOS - - "sodium_libs (3.4.6+4)": - - Flutter - - FlutterMacOS - - sqlite3 (3.51.1): - - sqlite3/common (= 3.51.1) - - sqlite3/common (3.51.1) - - sqlite3/dbstatvtab (3.51.1): - - sqlite3/common - - sqlite3/fts5 (3.51.1): - - sqlite3/common - - sqlite3/math (3.51.1): - - sqlite3/common - - sqlite3/perf-threadsafe (3.51.1): - - sqlite3/common - - sqlite3/rtree (3.51.1): - - sqlite3/common - - sqlite3/session (3.51.1): - - sqlite3/common - - sqlite3_flutter_libs (0.0.1): - - Flutter - - FlutterMacOS - - sqlite3 (~> 3.51.1) - - sqlite3/dbstatvtab - - sqlite3/fts5 - - sqlite3/math - - sqlite3/perf-threadsafe - - sqlite3/rtree - - sqlite3/session - url_launcher_macos (0.0.1): - FlutterMacOS - video_player_avfoundation (0.0.1): @@ -130,8 +102,6 @@ DEPENDENCIES: - package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`) - patrol (from `Flutter/ephemeral/.symlinks/plugins/patrol/darwin`) - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - - sodium_libs (from `Flutter/ephemeral/.symlinks/plugins/sodium_libs/darwin`) - - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - video_player_avfoundation (from `Flutter/ephemeral/.symlinks/plugins/video_player_avfoundation/darwin`) - wakelock_plus (from `Flutter/ephemeral/.symlinks/plugins/wakelock_plus/macos`) @@ -148,7 +118,6 @@ SPEC REPOS: - GoogleUtilities - nanopb - PromisesObjC - - sqlite3 EXTERNAL SOURCES: app_settings: @@ -171,10 +140,6 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/patrol/darwin share_plus: :path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos - sodium_libs: - :path: Flutter/ephemeral/.symlinks/plugins/sodium_libs/darwin - sqlite3_flutter_libs: - :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos video_player_avfoundation: @@ -188,13 +153,13 @@ SPEC CHECKSUMS: device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76 file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a file_selector_macos: 9e9e068e90ebee155097d00e89ae91edb2374db7 - Firebase: 065f2bb395062046623036d8e6dc857bc2521d56 - firebase_core: c74b220e9288decea6bed17399c249734a7e76d2 - firebase_messaging: dc3943efc6d8f0212d392d9531a6fd86bc48d1ac - FirebaseCore: 428912f751178b06bef0a1793effeb4a5e09a9b8 - FirebaseCoreInternal: b321eafae5362113bc182956fafc9922cfc77b72 - FirebaseInstallations: 7b64ffd006032b2b019a59b803858df5112d9eaa - FirebaseMessaging: 7d6cdbff969127c4151c824fe432f0e301210f15 + Firebase: 14f11e91129d246a8a6166b4c1c2ea61b56806ec + firebase_core: 8022171e82601bac2c79cfa04d69977f12595682 + firebase_messaging: 5044cedfca0133cd38db45fc16c0d312bab00f1b + FirebaseCore: 86241206e656f5c80c995e370e6c975913b9b284 + FirebaseCoreInternal: 7c12fc3011d889085e765e317d7b9fd1cef97af9 + FirebaseInstallations: 4e6e162aa4abaaeeeb01dd00179dfc5ad9c2194e + FirebaseMessaging: 341004946fa7ffc741344b20f1b667514fc93e31 FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 @@ -203,9 +168,6 @@ SPEC CHECKSUMS: patrol: cea8074f183a2a4232d0ebd10569ae05149ada42 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc - sodium_libs: 650f802d77b08c737ca4fed4ed68e822fa560c5a - sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b - sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41 url_launcher_macos: f87a979182d112f911de6820aefddaf56ee9fbfd video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a wakelock_plus: 917609be14d812ddd9e9528876538b2263aaa03b diff --git a/pubspec.lock b/pubspec.lock index 63b7a301f..386e217aa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "5b7468c326d2f8a4f630056404ca0d291ade42918f4a3c6233618e724f39da8e" + sha256: a49d6cf99e8d8e7a8e93668d09ced0bbdb954d0b4fccc2f5f9241c6b87fad95c url: "https://pub.dev" source: hosted - version: "92.0.0" + version: "99.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: afe15ce18a287d2f89da95566e62892df339b1936bbe9b83587df45b944ee72a + sha256: bda3b7b55958bfd867addc40d067b4b11f7b8846d57671f5b5a6e7f9a56fe3ad url: "https://pub.dev" source: hosted - version: "1.3.67" + version: "1.3.69" analyzer: dependency: transitive description: name: analyzer - sha256: "70e4b1ef8003c64793a9e268a551a82869a8a96f39deb73dea28084b0e8bf75e" + sha256: "663efa951fb8a45e06f491223a604c93820598f20e6a99c25617a1576065e8b7" url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "12.1.0" app_settings: dependency: "direct main" description: @@ -33,6 +33,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + archive: + dependency: transitive + description: + name: archive + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff + url: "https://pub.dev" + source: hosted + version: "4.0.9" args: dependency: "direct dev" description: @@ -45,10 +53,10 @@ packages: dependency: transitive description: name: async - sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.13.1" boolean_selector: dependency: transitive description: @@ -61,10 +69,10 @@ packages: dependency: transitive description: name: build - sha256: "275bf6bb2a00a9852c28d4e0b410da1d833a734d57d39d44f94bfc895a484ec3" + sha256: a156715e7cd728130c592f30552575908aae5b100005fbc1f0fb16b3c03a3d10 url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "4.0.6" build_config: dependency: transitive description: @@ -85,10 +93,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "7981eb922842c77033026eb4341d5af651562008cdb116bdfa31fc46516b6462" + sha256: "1523ce62448ebac2c15a8ba5fbad8acac169788658a7dd2a1c2d9c2a9318b9a6" url: "https://pub.dev" source: hosted - version: "2.12.2" + version: "2.15.0" built_collection: dependency: transitive description: @@ -101,10 +109,10 @@ packages: dependency: transitive description: name: built_value - sha256: "6ae8a6435a8c6520c7077b107e77f1fb4ba7009633259a4d49a8afd8e7efc5e9" + sha256: "34e4067d30ce212937df995f03b69992eea683539ceeac7f679a1f1eba055b56" url: "https://pub.dev" source: hosted - version: "8.12.4" + version: "8.12.6" characters: dependency: transitive description: @@ -238,10 +246,10 @@ packages: dependency: transitive description: name: dart_style - sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b + sha256: a4c1ccfee44c7e75ed80484071a5c142a385345e658fd8bd7c4b5c97e7198f98 url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.8" dbus: dependency: transitive description: @@ -254,10 +262,10 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: "4df8babf73058181227e18b08e6ea3520cf5fc5d796888d33b7cb0f33f984b7c" + sha256: b4fed1b2835da9d670d7bed7db79ae2a94b0f5ad6312268158a9b5479abbacdd url: "https://pub.dev" source: hosted - version: "12.3.0" + version: "12.4.0" device_info_plus_platform_interface: dependency: transitive description: @@ -278,18 +286,18 @@ packages: dependency: "direct main" description: name: drift - sha256: "970cd188fddb111b26ea6a9b07a62bf5c2432d74147b8122c67044ae3b97e99e" + sha256: "055c249d1f91be5a47fe447f88afc24c4ca6f4cd6c5ed66767b4797d48acc2e5" url: "https://pub.dev" source: hosted - version: "2.31.0" + version: "2.32.1" drift_dev: dependency: "direct dev" description: name: drift_dev - sha256: "917184b2fb867b70a548a83bf0d36268423b38d39968c06cce4905683da49587" + sha256: "88a9de3af8571518148a6d8a513b57779fd1e60a026d3ab8a481a878fba01d91" url: "https://pub.dev" source: hosted - version: "2.31.0" + version: "2.32.1" equatable: dependency: transitive description: @@ -326,10 +334,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "57d9a1dd5063f85fa3107fb42d1faffda52fdc948cefd5fe5ea85267a5fc7343" + sha256: f13a03000d942e476bc1ff0a736d2e9de711d2f89a95cd4c1d88f861c3348387 url: "https://pub.dev" source: hosted - version: "10.3.10" + version: "11.0.2" file_selector_linux: dependency: transitive description: @@ -366,50 +374,50 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: f0997fee80fbb6d2c658c5b88ae87ba1f9506b5b37126db64fc2e75d8e977fbb + sha256: d5a94b884dcb1e6d3430298e94bfe002238094cdfd5e29202d536ee2120f9158 url: "https://pub.dev" source: hosted - version: "4.5.0" + version: "4.7.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64 + sha256: "0ecda14c1bfc9ed8cac303dd0f8d04a320811b479362a9a4efb14fd331a473ce" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.0.3" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "856ca92bf2d75a63761286ab8e791bda3a85184c2b641764433b619647acfca6" + sha256: dc5096257cd67292d34d78ceeb90836f02a4be921b5f3934311a02bb2376118c url: "https://pub.dev" source: hosted - version: "3.5.0" + version: "3.6.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: bd17823b70e629877904d384841cda72ed2cc197517404c0c90da5c0ba786a8c + sha256: e5c93e8e7a9b0513f94bb684d2cf100e32e7dcdf2949574386b1955fc9a9b96a url: "https://pub.dev" source: hosted - version: "16.1.2" + version: "16.2.0" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "550435235cc7d53683f32bf0762c28ef8cfc20a8d36318a033676ae09526d7fb" + sha256: "8cbb7d842e5071bba836452aff262f7db4b14bb3a0d00c1896cf176df886d65a" url: "https://pub.dev" source: hosted - version: "4.7.7" + version: "4.7.9" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "6b1b93ed90309fbce91c219e3cd32aa831e8eccaf4a61f3afaea1625479275d2" + sha256: "8750bacf50573c0383535fc3f9c58c6a2f9dff5320a16a82c30631b9dad894f1" url: "https://pub.dev" source: hosted - version: "4.1.3" + version: "4.1.5" fixnum: dependency: transitive description: @@ -462,10 +470,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: ee8068e0e1cd16c4a82714119918efdeed33b3ba7772c54b5d094ab53f9b7fd1 + sha256: "38d1c268de9097ff59cf0e844ac38759fc78f76836d37edad06fa21e182055a0" url: "https://pub.dev" source: hosted - version: "2.0.33" + version: "2.0.34" flutter_test: dependency: "direct dev" description: flutter @@ -517,10 +525,10 @@ packages: dependency: transitive description: name: hooks - sha256: e79ed1e8e1929bc6ecb6ec85f0cb519c887aa5b423705ded0d0f2d9226def388 + sha256: "025f060e86d2d4c3c47b56e33caf7f93bf9283340f26d23424ebcfccf34f621e" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.0.3" html: dependency: "direct main" description: @@ -557,18 +565,18 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "784210112be18ea55f69d7076e2c656a4e24949fa9e76429fe53af0c0f4fa320" + sha256: "91c025426c2881c551100bce834e201c835a170151545f58d17da5180ca7d9ac" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: eda9b91b7e266d9041084a42d605a74937d996b87083395c5e47835916a86156 + sha256: d5b3e1774af29c9ab00103afb0d4614070f924d2e0057ac867ec98800114793f url: "https://pub.dev" source: hosted - version: "0.8.13+14" + version: "0.8.13+17" image_picker_for_web: dependency: transitive description: @@ -646,6 +654,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" + jni: + dependency: transitive + description: + name: jni + sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f + url: "https://pub.dev" + source: hosted + version: "1.0.0" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" json_annotation: dependency: "direct main" description: @@ -658,10 +682,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: "44729f5c45748e6748f6b9a57ab8f7e4336edc8ae41fc295070e3814e616a6c0" + sha256: "2c15e78e1cc6e62aadecf59f81566fd56829713d96a8c4177699e2b2e17f20db" url: "https://pub.dev" source: hosted - version: "6.13.0" + version: "6.13.2" leak_tracker: dependency: transitive description: @@ -714,10 +738,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd" url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.20" material_color_utilities: dependency: transitive description: @@ -730,10 +754,10 @@ packages: dependency: transitive description: name: meta - sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + sha256: df0c643f44ad098eb37988027a8e2b2b5a031fd3977f06bbfd3a76637e8df739 url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.18.2" mime: dependency: "direct main" description: @@ -746,10 +770,10 @@ packages: dependency: transitive description: name: native_toolchain_c - sha256: "92b2ca62c8bd2b8d2f267cdfccf9bfbdb7322f778f8f91b3ce5b5cda23a3899f" + sha256: "6ba77bb18063eebe9de401f5e6437e95e1438af0a87a3a39084fbd37c90df572" url: "https://pub.dev" source: hosted - version: "0.17.5" + version: "0.17.6" node_preamble: dependency: transitive description: @@ -786,10 +810,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: f69da0d3189a4b4ceaeb1a3defb0f329b3b352517f52bed4290f83d4f06bc08d + sha256: "468c26b4254ab01979fa5e4a98cb343ea3631b9acee6f21028997419a80e1a20" url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "9.0.1" package_info_plus_platform_interface: dependency: transitive description: @@ -818,10 +842,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" url: "https://pub.dev" source: hosted - version: "2.2.22" + version: "2.3.1" path_provider_foundation: dependency: "direct main" description: @@ -858,26 +882,26 @@ packages: dependency: "direct dev" description: name: patrol - sha256: ca7d659c58ef735e27c4300af43cc367b67a129a0a1720082dc21b5a096efb1c + sha256: "7825a6e96a8f0755f68eec600a91a08b19bd0975488a70885b3696f6b65ffc0f" url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "4.5.0" patrol_finders: dependency: transitive description: name: patrol_finders - sha256: ac0bfaf3eaaa6cc3d49c8a365329cc7f4361a5f486f1adb45edc96dbfc854da9 + sha256: "9970eac0669a90b20ec7e1bcaabd0475655655998068ca656f4df9f6ec84f336" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.2.0" patrol_log: dependency: transitive description: name: patrol_log - sha256: b3bd2862c15bd6b163763d7d2a80ae07c24af6da07d62d202798ceea327045d7 + sha256: a2360db165c34692665c0de146e5157887d6b584fdccca8f141f947a5acf1b2e url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.8.0" petitparser: dependency: transitive description: @@ -890,10 +914,10 @@ packages: dependency: "direct dev" description: name: pigeon - sha256: "842b981a14946c918cf08e513cb6399f4746837c8de5ecaeab3a4b03e91fd0d7" + sha256: "04cfefc8add8b47ddf9ccac8b92bb4edeb67c87f185c623ba0db118ac99334ad" url: "https://pub.dev" source: hosted - version: "26.2.0" + version: "26.3.4" platform: dependency: transitive description: @@ -918,6 +942,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.2" + posix: + dependency: transitive + description: + name: posix + sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" + url: "https://pub.dev" + source: hosted + version: "6.5.0" powers: dependency: transitive description: @@ -958,14 +990,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.0" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" + url: "https://pub.dev" + source: hosted + version: "0.6.0" share_plus: dependency: "direct main" description: name: share_plus - sha256: "14c8860d4de93d3a7e53af51bff479598c4e999605290756bbbe45cf65b37840" + sha256: "223873d106614442ea6f20db5a038685cc5b32a2fba81cdecaefbbae0523f7fa" url: "https://pub.dev" source: hosted - version: "12.0.1" + version: "12.0.2" share_plus_platform_interface: dependency: "direct main" description: @@ -1012,37 +1052,29 @@ packages: source: sdk version: "0.0.0" sodium: - dependency: transitive - description: - name: sodium - sha256: "515b86c186f4caca49051caf858d878ca7cc4ff4542411e9febb50654eac8a62" - url: "https://pub.dev" - source: hosted - version: "3.4.6" - sodium_libs: dependency: "direct main" description: - name: sodium_libs - sha256: f3f9c516b4183226b7a08ca43a765ebc9e02cfd92e46e8a6cc490f98ffe73052 + name: sodium + sha256: "19e3153ef4d1d10087d78d551d78e56909d159047a578ec692814c65ca450dfc" url: "https://pub.dev" source: hosted - version: "3.4.6+4" + version: "4.0.2+1" source_gen: dependency: transitive description: name: source_gen - sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17" + sha256: ec37cc0e6694374cbef59ed79685572c870a54ede6fa30a3e420feb3adffea02 url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.2.3" source_helper: dependency: transitive description: name: source_helper - sha256: "4a85e90b50694e652075cbe4575665539d253e6ec10e46e76b45368ab5e3caae" + sha256: "4227d54ceefd0bb8ca4c8fcb96e1719dc53f1ee1b6e2ca9d7a6069da160e4eae" url: "https://pub.dev" source: hosted - version: "1.3.10" + version: "1.3.12" source_map_stack_trace: dependency: transitive description: @@ -1071,26 +1103,18 @@ packages: dependency: "direct main" description: name: sqlite3 - sha256: "3145bd74dcdb4fd6f5c6dda4d4e4490a8087d7f286a14dee5d37087290f0f8a2" - url: "https://pub.dev" - source: hosted - version: "2.9.4" - sqlite3_flutter_libs: - dependency: "direct main" - description: - name: sqlite3_flutter_libs - sha256: "1e800ebe7f85a80a66adacaa6febe4d5f4d8b75f244e9838a27cb2ffc7aec08d" + sha256: "56da3e13ed7d28a66f930aa2b2b29db6736a233f08283326e96321dd812030f5" url: "https://pub.dev" source: hosted - version: "0.5.41" + version: "3.3.1" sqlparser: dependency: transitive description: name: sqlparser - sha256: "337e9997f7141ffdd054259128553c348635fa318f7ca492f07a4ab76f850d19" + sha256: ab2b467425f1d4f3acfa5fd11a08226f7d6c26ff102c06be1807e1dff34e050b url: "https://pub.dev" source: hosted - version: "0.43.1" + version: "0.44.3" stack_trace: dependency: "direct dev" description: @@ -1131,14 +1155,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.1" - synchronized: - dependency: transitive - description: - name: synchronized - sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 - url: "https://pub.dev" - source: hosted - version: "3.4.0" term_glyph: dependency: transitive description: @@ -1151,26 +1167,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "8d9ceddbab833f180fbefed08afa76d7c03513dfdba87ffcec2718b02bbcbf20" + sha256: ca578dc12bb8b2f40b67b7d3bd2fac4f31c01a6ff7130a14e2597b919934507f url: "https://pub.dev" source: hosted - version: "1.31.0" + version: "1.31.1" test_api: dependency: "direct dev" description: name: test_api - sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11" url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.12" test_core: dependency: transitive description: name: test_core - sha256: "1991d4cfe85d5043241acac92962c3977c8d2f2add1ee73130c7b286417d1d34" + sha256: d2e98ec12998368dc59ddd47ab709f2cd55acd6b66dc7db764455a44082f4bc5 url: "https://pub.dev" source: hosted - version: "0.6.17" + version: "0.6.18" typed_data: dependency: transitive description: @@ -1199,10 +1215,10 @@ packages: dependency: "direct main" description: name: url_launcher_android - sha256: "767344bf3063897b5cf0db830e94f904528e6dd50a6dfaf839f0abf509009611" + sha256: "3bb000251e55d4a209aa0e2e563309dc9bb2befea2295fd0cec1f51760aac572" url: "https://pub.dev" source: hosted - version: "6.3.28" + version: "6.3.29" url_launcher_ios: dependency: transitive description: @@ -1263,26 +1279,26 @@ packages: dependency: transitive description: name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + sha256: "47a1b32ee755c3fcffa33db52a7258c137f97bdb2209a1075be847809fac4ccf" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.0" video_player: dependency: "direct main" description: name: video_player - sha256: "08bfba72e311d48219acad4e191b1f9c27ff8cf928f2c7234874592d9c9d7341" + sha256: "48a7bdaa38a3d50ec10c78627abdbfad863fdf6f0d6e08c7c3c040cfd80ae36f" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.11.1" video_player_android: dependency: transitive description: name: video_player_android - sha256: "9862c67c4661c98f30fe707bc1a4f97d6a0faa76784f485d282668e4651a7ac3" + sha256: "877a6c7ba772456077d7bfd71314629b3fe2b73733ce503fc77c3314d43a0ca0" url: "https://pub.dev" source: hosted - version: "2.9.4" + version: "2.9.5" video_player_avfoundation: dependency: transitive description: @@ -1295,10 +1311,10 @@ packages: dependency: "direct dev" description: name: video_player_platform_interface - sha256: "57c5d73173f76d801129d0531c2774052c5a7c11ccb962f1830630decd9f24ec" + sha256: "16eaed5268c571c31840dc58ef8da5f0cd4db2a98490c3b8f1cf70122546c6e0" url: "https://pub.dev" source: hosted - version: "6.6.0" + version: "6.7.0" video_player_web: dependency: transitive description: @@ -1311,26 +1327,26 @@ packages: dependency: transitive description: name: vm_service - sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" url: "https://pub.dev" source: hosted - version: "15.0.2" + version: "15.2.0" wakelock_plus: dependency: "direct main" description: name: wakelock_plus - sha256: "9296d40c9adbedaba95d1e704f4e0b434be446e2792948d0e4aa977048104228" + sha256: ddf3db70eaa10c37558ff817519b85d527dbd21034fd5d8e1c2e85f31588f1c1 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.5.2" wakelock_plus_platform_interface: dependency: transitive description: name: wakelock_plus_platform_interface - sha256: "036deb14cd62f558ca3b73006d52ce049fabcdcb2eddfe0bf0fe4e8a943b5cf2" + sha256: "14b2e5b9e35c2631e656913c47adecdd71633ae92896a27a64c8f1fcfabc21cc" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" watcher: dependency: transitive description: @@ -1427,5 +1443,5 @@ packages: source: path version: "0.0.1" sdks: - dart: ">=3.12.0-301.0.dev <4.0.0" - flutter: ">=3.43.0-1.0.pre-365" + dart: ">=3.13.0-89.0.dev <4.0.0" + flutter: ">=3.44.0-1.0.pre-377" diff --git a/pubspec.yaml b/pubspec.yaml index 8241b1936..26e44ceac 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.12.0-301.0.dev <4.0.0' - flutter: '>=3.43.0-1.0.pre-365' # dcc3ab2054b11df9867bdf7930a06ed301dba6e8 + sdk: '>=3.13.0-89.0.dev <4.0.0' + flutter: '>=3.44.0-1.0.pre-377' # 31796c1f2d5c98aae266267c682434f3ac3da636 # To update dependencies, see instructions in README.md. dependencies: @@ -42,7 +42,7 @@ dependencies: csslib: ^1.0.2 device_info_plus: ^12.0.0 drift: ^2.23.0 - file_picker: ^10.1.2 + file_picker: ^11.0.2 firebase_core: ^4.0.0 firebase_messaging: ^16.0.0 flutter_color_models: ^1.3.3+2 @@ -58,9 +58,8 @@ dependencies: path_provider_foundation: ^2.6.0 share_plus: ^12.0.0 share_plus_platform_interface: ^6.0.0 - sodium_libs: ^3.4.6+4 - sqlite3: ^2.4.0 - sqlite3_flutter_libs: 0.5.41 + sodium: ^4.0.2+1 + sqlite3: ^3.3.1 unorm_dart: ^0.3.1+1 url_launcher: ^6.1.11 url_launcher_android: ">=6.1.0" diff --git a/test/model/binding.dart b/test/model/binding.dart index c3ab63851..1aca3bd0f 100644 --- a/test/model/binding.dart +++ b/test/model/binding.dart @@ -8,7 +8,7 @@ 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:sodium_libs/sodium_libs.dart' as sodium; +import 'package:sodium/sodium.dart' as sodium; import 'package:test/fake.dart'; import 'package:url_launcher/url_launcher.dart' as url_launcher; import 'package:zulip/host/android_intents.dart'; diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 962a4e58a..eb242aca8 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -9,8 +9,6 @@ #include #include #include -#include -#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { @@ -20,10 +18,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); SharePlusWindowsPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); - SodiumLibsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SodiumLibsPluginCApi")); - Sqlite3FlutterLibsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); UrlLauncherWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index d53f8ff9e..4335ae598 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -6,12 +6,11 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows firebase_core share_plus - sodium_libs - sqlite3_flutter_libs url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES)