Skip to content

Commit 257ffe3

Browse files
committed
deps: Upgrade pigeon to 18.0.1
Done with: $ flutter pub upgrade pigeon $ tools/check --all-files --fix pigeon
1 parent 53853ab commit 257ffe3

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

android/app/src/main/kotlin/com/zulip/flutter/Notifications.g.kt

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// Autogenerated from Pigeon (v18.0.0), do not edit directly.
1+
// Autogenerated from Pigeon (v18.0.1), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
3+
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
34

45
package com.zulip.flutter
56

@@ -16,14 +17,14 @@ private fun wrapResult(result: Any?): List<Any?> {
1617
}
1718

1819
private fun wrapError(exception: Throwable): List<Any?> {
19-
if (exception is FlutterError) {
20-
return listOf(
20+
return if (exception is FlutterError) {
21+
listOf(
2122
exception.code,
2223
exception.message,
2324
exception.details
2425
)
2526
} else {
26-
return listOf(
27+
listOf(
2728
exception.javaClass.simpleName,
2829
exception.toString(),
2930
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
@@ -65,11 +66,11 @@ data class PendingIntent (
6566

6667
) {
6768
companion object {
68-
@Suppress("UNCHECKED_CAST")
69-
fun fromList(list: List<Any?>): PendingIntent {
70-
val requestCode = list[0].let { if (it is Int) it.toLong() else it as Long }
71-
val intentPayload = list[1] as String
72-
val flags = list[2].let { if (it is Int) it.toLong() else it as Long }
69+
@Suppress("LocalVariableName")
70+
fun fromList(__pigeon_list: List<Any?>): PendingIntent {
71+
val requestCode = __pigeon_list[0].let { num -> if (num is Int) num.toLong() else num as Long }
72+
val intentPayload = __pigeon_list[1] as String
73+
val flags = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long }
7374
return PendingIntent(requestCode, intentPayload, flags)
7475
}
7576
}
@@ -81,7 +82,6 @@ data class PendingIntent (
8182
)
8283
}
8384
}
84-
@Suppress("UNCHECKED_CAST")
8585
private object AndroidNotificationHostApiCodec : StandardMessageCodec() {
8686
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
8787
return when (type) {
@@ -133,7 +133,6 @@ interface AndroidNotificationHostApi {
133133
AndroidNotificationHostApiCodec
134134
}
135135
/** Sets up an instance of `AndroidNotificationHostApi` to handle messages through the `binaryMessenger`. */
136-
@Suppress("UNCHECKED_CAST")
137136
fun setUp(binaryMessenger: BinaryMessenger, api: AndroidNotificationHostApi?, messageChannelSuffix: String = "") {
138137
val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
139138
run {
@@ -142,20 +141,19 @@ interface AndroidNotificationHostApi {
142141
channel.setMessageHandler { message, reply ->
143142
val args = message as List<Any?>
144143
val tagArg = args[0] as String?
145-
val idArg = args[1].let { if (it is Int) it.toLong() else it as Long }
144+
val idArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long }
146145
val channelIdArg = args[2] as String
147-
val colorArg = args[3].let { if (it is Int) it.toLong() else it as Long? }
146+
val colorArg = args[3].let { num -> if (num is Int) num.toLong() else num as Long? }
148147
val contentIntentArg = args[4] as PendingIntent?
149148
val contentTextArg = args[5] as String?
150149
val contentTitleArg = args[6] as String?
151150
val extrasArg = args[7] as Map<String?, String?>?
152151
val smallIconResourceNameArg = args[8] as String?
153-
var wrapped: List<Any?>
154-
try {
152+
val wrapped: List<Any?> = try {
155153
api.notify(tagArg, idArg, channelIdArg, colorArg, contentIntentArg, contentTextArg, contentTitleArg, extrasArg, smallIconResourceNameArg)
156-
wrapped = listOf<Any?>(null)
154+
listOf<Any?>(null)
157155
} catch (exception: Throwable) {
158-
wrapped = wrapError(exception)
156+
wrapError(exception)
159157
}
160158
reply.reply(wrapped)
161159
}

lib/host/android_notifications.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Autogenerated from Pigeon (v18.0.0), do not edit directly.
1+
// Autogenerated from Pigeon (v18.0.1), do not edit directly.
22
// See also: https://pub.dev/packages/pigeon
33
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers
44

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,10 @@ packages:
832832
dependency: "direct dev"
833833
description:
834834
name: pigeon
835-
sha256: be883401d09121c427ed9c5f6e96427787d93d335f55e5e2b0d780a0a22cd561
835+
sha256: "20fe4dc59f7f9b8070f8732783fdb474d3d4dcd7674a3252230ec4d4f7070ae3"
836836
url: "https://pub.dev"
837837
source: hosted
838-
version: "18.0.0"
838+
version: "18.0.1"
839839
platform:
840840
dependency: transitive
841841
description:

0 commit comments

Comments
 (0)