1
- // Autogenerated from Pigeon (v18.0.0 ), do not edit directly.
1
+ // Autogenerated from Pigeon (v18.0.1 ), do not edit directly.
2
2
// See also: https://pub.dev/packages/pigeon
3
+ @file:Suppress(" UNCHECKED_CAST" , " ArrayInDataClass" )
3
4
4
5
package com.zulip.flutter
5
6
@@ -16,14 +17,14 @@ private fun wrapResult(result: Any?): List<Any?> {
16
17
}
17
18
18
19
private fun wrapError (exception : Throwable ): List <Any ?> {
19
- if (exception is FlutterError ) {
20
- return listOf (
20
+ return if (exception is FlutterError ) {
21
+ listOf (
21
22
exception.code,
22
23
exception.message,
23
24
exception.details
24
25
)
25
26
} else {
26
- return listOf (
27
+ listOf (
27
28
exception.javaClass.simpleName,
28
29
exception.toString(),
29
30
" Cause: " + exception.cause + " , Stacktrace: " + Log .getStackTraceString(exception)
@@ -65,11 +66,11 @@ data class PendingIntent (
65
66
66
67
) {
67
68
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 }
73
74
return PendingIntent (requestCode, intentPayload, flags)
74
75
}
75
76
}
@@ -81,7 +82,6 @@ data class PendingIntent (
81
82
)
82
83
}
83
84
}
84
- @Suppress(" UNCHECKED_CAST" )
85
85
private object AndroidNotificationHostApiCodec : StandardMessageCodec() {
86
86
override fun readValueOfType (type : Byte , buffer : ByteBuffer ): Any? {
87
87
return when (type) {
@@ -133,7 +133,6 @@ interface AndroidNotificationHostApi {
133
133
AndroidNotificationHostApiCodec
134
134
}
135
135
/* * Sets up an instance of `AndroidNotificationHostApi` to handle messages through the `binaryMessenger`. */
136
- @Suppress(" UNCHECKED_CAST" )
137
136
fun setUp (binaryMessenger : BinaryMessenger , api : AndroidNotificationHostApi ? , messageChannelSuffix : String = "") {
138
137
val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) " .$messageChannelSuffix " else " "
139
138
run {
@@ -142,20 +141,19 @@ interface AndroidNotificationHostApi {
142
141
channel.setMessageHandler { message, reply ->
143
142
val args = message as List <Any ?>
144
143
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 }
146
145
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? }
148
147
val contentIntentArg = args[4 ] as PendingIntent ?
149
148
val contentTextArg = args[5 ] as String?
150
149
val contentTitleArg = args[6 ] as String?
151
150
val extrasArg = args[7 ] as Map <String ?, String ?>?
152
151
val smallIconResourceNameArg = args[8 ] as String?
153
- var wrapped: List <Any ?>
154
- try {
152
+ val wrapped: List <Any ?> = try {
155
153
api.notify(tagArg, idArg, channelIdArg, colorArg, contentIntentArg, contentTextArg, contentTitleArg, extrasArg, smallIconResourceNameArg)
156
- wrapped = listOf<Any ?>(null )
154
+ listOf<Any ?>(null )
157
155
} catch (exception: Throwable ) {
158
- wrapped = wrapError(exception)
156
+ wrapError(exception)
159
157
}
160
158
reply.reply(wrapped)
161
159
}
0 commit comments