Skip to content
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

[pigeon] Widen the scope of pigeon documentation for newer devs #147835

Closed
PeetoomHeida opened this issue May 4, 2024 · 4 comments
Closed

[pigeon] Widen the scope of pigeon documentation for newer devs #147835

PeetoomHeida opened this issue May 4, 2024 · 4 comments
Labels
r: solved Issue is closed as solved

Comments

@PeetoomHeida
Copy link

I am a fairly new mobile dev, and am currently working on implementing a small feature in native code and am trying to use pigeon. The current documentation seems to be written primarily for an audience that is familiar with native android development. Details of implementation on the native side are scant, and the pertinent text in the documentation for the pigeon package essentially boils down to 'implement the generated code in native'.

The platform channels documentation is quite extensive and also makes reference to pigeon, but again fails to show what the native side implementation actually looks like.

In terms of what I am actually struggling with:

  • Where best to place generated kotlin code
  • How to import kotlin code to main activity
  • how to implement the generated code in kotlin (including overriding my function, which file to do this in)
  • how to configure the flutter engine override

I am sure to experienced devs these are trivial matters. I started learning mobile dev in Flutter, so have no experience working with the android/ios native infrastructure. While I understand that it is impossible to show every use case, having at least a starting point to build/iterate off of for smaller projects would be really nice. A simple target might be to implement the same batterylevel example linked above fully in Pigeon, complete with the code implementing the API on the native side, as well as having some specifics about where to put the various files in the process.

@stuartmorgan
Copy link
Contributor

Have you read the README in https://github.com/flutter/packages/tree/main/packages/pigeon/example/app and looked at the code in the example app? Most of the things in your list are demonstrated there.

If you have, could you elaborate on what specifically you are looking for that's not there?

@PeetoomHeida
Copy link
Author

Poking around in the code in the example app, it seems like most of issues are addressed. Thanks for pointing me in that direction. I wonder if it might be worth making it a bit more explicit that the code in the example app demonstrates some of these patterns. For what ever reason I assumed the only thing to look at was the README in that repo, rather than the actual source code as well.

Thanks again

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 6, 2024
@darshankawar
Copy link
Member

@PeetoomHeida
Every package comes with an example for devs reference, just like mentioned in Stuart's comment above that should be helpful to resolve your queries.
You can also take a look at https://github.com/flutter/packages/blob/main/packages/pigeon/example/README.md for further reference.
If you think there's any specific missing details, write in comments and I'll reopen it. Currently, I'll close this based on earlier and this link provided.

@darshankawar darshankawar added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels May 6, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests

3 participants