flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.27k stars 26.66k forks source link

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

Closed PeetoomHeida closed 1 week ago

PeetoomHeida commented 2 weeks ago

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:

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

@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.