samples icon indicating copy to clipboard operation
samples copied to clipboard

`platform_channels` should demonstrate `pigeon` usage

Open domesticmouse opened this issue 4 years ago • 8 comments

The platform_channels should demonstrate usage of the pigeon code generator.

domesticmouse avatar Jun 07 '21 09:06 domesticmouse

It's currently covered in the add-to-app samples:

https://github.com/flutter/samples/tree/master/add_to_app/books

From what I gathered from @xster, pigeon is intended more for an add-to-app scenario than anything else (though he and the platforms team are free to correct me). If part of the reason you filed this is that we're not making it easy enough to find that sample, that's something we can definitely work on.

redbrogdon avatar Jun 07 '21 22:06 redbrogdon

I'm curious why pigeon is only for add to app and not for plugin construction, because the type safety would be nice in the latter case as well.

domesticmouse avatar Jun 07 '21 23:06 domesticmouse

The original motivation for pigeon was for both add-to-app and plugins since they're essentially facing the same problem. The current solution covers both areas. See https://github.com/flutter/plugins/blob/master/packages/video_player/video_player/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java#L5. Adding another example to platform_channels sound good.

xster avatar Jun 08 '21 05:06 xster

/me stands corrected.

redbrogdon avatar Jun 10 '21 22:06 redbrogdon

I can work on this issue. I'll also get a chance to explore pigeon package :D

AyushBherwani1998 avatar Jun 24 '21 13:06 AyushBherwani1998

SGTM, if you're interested, @AyushBherwani1998. Having fresh eyes on pigeon could be useful.

As you go, do you mind keeping notes on where we can improve general documentation for the package? That'd also be a great help.

redbrogdon avatar Jun 24 '21 18:06 redbrogdon

Bah, I just realized @domesticmouse self-assigned this. Brett, did you want to take this on personally or are you cool with passing the baton? 😄

redbrogdon avatar Jun 24 '21 18:06 redbrogdon

Sure, I would love to. One thing I noticed, the readme doesn't mention anything about @ConfigurePigeon annotation. I came to know that we can pass the options to generate code by looking at the video_player plugin. I'll keep track of things, and at last try to create a ticket to summaries everything.

AyushBherwani1998 avatar Jun 25 '21 06:06 AyushBherwani1998