-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[pigeon] fixes documentation comments that start with / #2824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
207 changes: 207 additions & 0 deletions
207
...t_tests/android/app/src/main/kotlin/com/example/android_kotlin_unit_tests/AllDatatypes.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,207 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
| // | ||
| // Autogenerated from Pigeon (v4.2.3), do not edit directly. | ||
| // See also: https://pub.dev/packages/pigeon | ||
|
|
||
| package com.example.android_kotlin_unit_tests | ||
|
|
||
| import android.util.Log | ||
| import io.flutter.plugin.common.BasicMessageChannel | ||
| import io.flutter.plugin.common.BinaryMessenger | ||
| import io.flutter.plugin.common.MessageCodec | ||
| import io.flutter.plugin.common.StandardMessageCodec | ||
| import java.io.ByteArrayOutputStream | ||
| import java.nio.ByteBuffer | ||
|
|
||
| /** Generated class from Pigeon. */ | ||
|
|
||
| /** Generated class from Pigeon that represents data sent in messages. */ | ||
| data class Everything ( | ||
| val aBool: Boolean? = null, | ||
| val anInt: Long? = null, | ||
| val aDouble: Double? = null, | ||
| val aString: String? = null, | ||
| val aByteArray: ByteArray? = null, | ||
| val a4ByteArray: IntArray? = null, | ||
| val a8ByteArray: LongArray? = null, | ||
| val aFloatArray: DoubleArray? = null, | ||
| val aList: List<Any?>? = null, | ||
| val aMap: Map<Any, Any?>? = null, | ||
| val nestedList: List<List<Boolean?>?>? = null, | ||
| val mapWithAnnotations: Map<String?, String?>? = null, | ||
| val mapWithObject: Map<String?, Any?>? = null | ||
|
|
||
| ) { | ||
| companion object { | ||
| @Suppress("UNCHECKED_CAST") | ||
| fun fromList(result: List<Any?>): Everything { | ||
| val list = result.first() as List<Any?> | ||
| val aBool = list[0] as? Boolean | ||
| val anInt = list[1].let { if (it is Int) it.toLong() else it as? Long } | ||
| val aDouble = list[2] as? Double | ||
| val aString = list[3] as? String | ||
| val aByteArray = list[4] as? ByteArray | ||
| val a4ByteArray = list[5] as? IntArray | ||
| val a8ByteArray = list[6] as? LongArray | ||
| val aFloatArray = list[7] as? DoubleArray | ||
| val aList = list[8] as? List<Any?> | ||
| val aMap = list[9] as? Map<Any, Any?> | ||
| val nestedList = list[10] as? List<List<Boolean?>?> | ||
| val mapWithAnnotations = list[11] as? Map<String?, String?> | ||
| val mapWithObject = list[12] as? Map<String?, Any?> | ||
|
|
||
| return Everything(aBool, anInt, aDouble, aString, aByteArray, a4ByteArray, a8ByteArray, aFloatArray, aList, aMap, nestedList, mapWithAnnotations, mapWithObject) | ||
| } | ||
| } | ||
| fun toList(): MutableList<MutableList<Any?>> { | ||
| val list = mutableListOf<Any?>() | ||
| list.add(aBool) | ||
| list.add(anInt) | ||
| list.add(aDouble) | ||
| list.add(aString) | ||
| list.add(aByteArray) | ||
| list.add(a4ByteArray) | ||
| list.add(a8ByteArray) | ||
| list.add(aFloatArray) | ||
| list.add(aList) | ||
| list.add(aMap) | ||
| list.add(nestedList) | ||
| list.add(mapWithAnnotations) | ||
| list.add(mapWithObject) | ||
| return mutableListOf<MutableList<Any?>>(list) | ||
| } | ||
| } | ||
| @Suppress("UNCHECKED_CAST") | ||
| private object HostEverythingCodec : StandardMessageCodec() { | ||
| override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { | ||
| return when (type) { | ||
| 128.toByte() -> { | ||
| return (readValue(buffer) as? List<Any?>)?.let { | ||
| Everything.fromList(it) | ||
| } | ||
| } | ||
| else -> super.readValueOfType(type, buffer) | ||
| } | ||
| } | ||
| override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { | ||
| when (value) { | ||
| is Everything -> { | ||
| stream.write(128) | ||
| writeValue(stream, value.toList()) | ||
| } | ||
| else -> super.writeValue(stream, value) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ | ||
| interface HostEverything { | ||
| fun giveMeEverything(): Everything | ||
| fun echo(everything: Everything): Everything | ||
|
|
||
| companion object { | ||
| /** The codec used by HostEverything. */ | ||
| val codec: MessageCodec<Any?> by lazy { | ||
| HostEverythingCodec | ||
| } | ||
| /** Sets up an instance of `HostEverything` to handle messages through the `binaryMessenger`. */ | ||
| @Suppress("UNCHECKED_CAST") | ||
| fun setUp(binaryMessenger: BinaryMessenger, api: HostEverything?) { | ||
| run { | ||
| val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.HostEverything.giveMeEverything", codec) | ||
| if (api != null) { | ||
| channel.setMessageHandler { _, reply -> | ||
| val wrapped = mutableListOf<Any?>() | ||
| try { | ||
| wrapped.add(api.giveMeEverything()) | ||
| } catch (exception: Error) { | ||
| wrapped.add(wrapError(exception)) | ||
|
|
||
| reply.reply(wrapped) | ||
| } | ||
| }} else { | ||
| channel.setMessageHandler(null) | ||
| } | ||
| } | ||
| run { | ||
| val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.HostEverything.echo", codec) | ||
| if (api != null) { | ||
| channel.setMessageHandler { message, reply -> | ||
| val wrapped = mutableListOf<Any?>() | ||
| try { | ||
| val args = message as List<Any?> | ||
| val everythingArg = args[0] as Everything | ||
| wrapped.add(api.echo(everythingArg)) | ||
| } catch (exception: Error) { | ||
| wrapped.add(wrapError(exception)) | ||
|
|
||
| reply.reply(wrapped) | ||
| } | ||
| }} else { | ||
| channel.setMessageHandler(null) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| @Suppress("UNCHECKED_CAST") | ||
| private object FlutterEverythingCodec : StandardMessageCodec() { | ||
| override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { | ||
| return when (type) { | ||
| 128.toByte() -> { | ||
| return (readValue(buffer) as? List<Any?>)?.let { | ||
| Everything.fromList(it) | ||
| } | ||
| } | ||
| else -> super.readValueOfType(type, buffer) | ||
| } | ||
| } | ||
| override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { | ||
| when (value) { | ||
| is Everything -> { | ||
| stream.write(128) | ||
| writeValue(stream, value.toList()) | ||
| } | ||
| else -> super.writeValue(stream, value) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ | ||
| @Suppress("UNCHECKED_CAST") | ||
| class FlutterEverything(private val binaryMessenger: BinaryMessenger) { | ||
| companion object { | ||
| /** The codec used by FlutterEverything. */ | ||
| val codec: MessageCodec<Any?> by lazy { | ||
| FlutterEverythingCodec | ||
| } | ||
| } | ||
| fun giveMeEverything(callback: (Everything) -> Unit) { | ||
| val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.FlutterEverything.giveMeEverything", codec) | ||
| channel.send(null) { | ||
| val result = it as Everything | ||
| callback(result) | ||
| } | ||
| } | ||
| fun echo(everythingArg: Everything, callback: (Everything) -> Unit) { | ||
| val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.FlutterEverything.echo", codec) | ||
| channel.send(listOf(everythingArg)) { | ||
| val result = it as Everything | ||
| callback(result) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private fun wrapResult(result: Any?): List<Any?> { | ||
| return listOf(result) | ||
| } | ||
|
|
||
| private fun wrapError(exception: Throwable): List<Any> { | ||
| return listOf<Any>( | ||
| exception.javaClass.simpleName, | ||
| exception.toString(), | ||
| "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) | ||
| ) | ||
| } | ||
78 changes: 78 additions & 0 deletions
78
...n_unit_tests/android/app/src/main/kotlin/com/example/android_kotlin_unit_tests/AllVoid.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
| // | ||
| // Autogenerated from Pigeon (v4.2.3), do not edit directly. | ||
| // See also: https://pub.dev/packages/pigeon | ||
|
|
||
| package com.example.android_kotlin_unit_tests | ||
|
|
||
| import android.util.Log | ||
| import io.flutter.plugin.common.BasicMessageChannel | ||
| import io.flutter.plugin.common.BinaryMessenger | ||
| import io.flutter.plugin.common.MessageCodec | ||
| import io.flutter.plugin.common.StandardMessageCodec | ||
| import java.io.ByteArrayOutputStream | ||
| import java.nio.ByteBuffer | ||
|
|
||
| /** Generated class from Pigeon. */ | ||
| /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ | ||
| @Suppress("UNCHECKED_CAST") | ||
| class AllVoidFlutterApi(private val binaryMessenger: BinaryMessenger) { | ||
| companion object { | ||
| /** The codec used by AllVoidFlutterApi. */ | ||
| val codec: MessageCodec<Any?> by lazy { | ||
| StandardMessageCodec() | ||
| } | ||
| } | ||
| fun doit(callback: () -> Unit) { | ||
| val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.AllVoidFlutterApi.doit", codec) | ||
| channel.send(null) { | ||
| callback() | ||
| } | ||
| } | ||
| } | ||
| /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ | ||
| interface AllVoidHostApi { | ||
| fun doit() | ||
|
|
||
| companion object { | ||
| /** The codec used by AllVoidHostApi. */ | ||
| val codec: MessageCodec<Any?> by lazy { | ||
| StandardMessageCodec() | ||
| } | ||
| /** Sets up an instance of `AllVoidHostApi` to handle messages through the `binaryMessenger`. */ | ||
| @Suppress("UNCHECKED_CAST") | ||
| fun setUp(binaryMessenger: BinaryMessenger, api: AllVoidHostApi?) { | ||
| run { | ||
| val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.AllVoidHostApi.doit", codec) | ||
| if (api != null) { | ||
| channel.setMessageHandler { _, reply -> | ||
| val wrapped = mutableListOf<Any?>() | ||
| try { | ||
| api.doit() | ||
| wrapped.add(null) | ||
| } catch (exception: Error) { | ||
| wrapped.add(wrapError(exception)) | ||
|
|
||
| reply.reply(wrapped) | ||
| } | ||
| }} else { | ||
| channel.setMessageHandler(null) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private fun wrapResult(result: Any?): List<Any?> { | ||
| return listOf(result) | ||
| } | ||
|
|
||
| private fun wrapError(exception: Throwable): List<Any> { | ||
| return listOf<Any>( | ||
| exception.javaClass.simpleName, | ||
| exception.toString(), | ||
| "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are all these added files? Were these added by mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's really strange, these weren't in my local git info. I'll fix it.