Skip to content

[Dart FFI] An example on how to use async callbacks between Dart and golang? #498

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
ganeshrvel opened this issue Jul 25, 2020 · 7 comments
Labels
example About an example plugin Issue about an existing or possible plugin question User questions

Comments

@ganeshrvel
Copy link

ganeshrvel commented Jul 25, 2020

I have been trying to setup a project which requires to make async calls from Flutter to golang native functions. There is an example for the same https://github.com/dart-lang/sdk/tree/master/samples/ffi/async but the code is vague to get started.

According to dart-lang/sdk#37022 they have recently added callback support from the native code to the dart code via Nativeport. But I am unable to get it working with golang.

It would be great if you guys could give us an example code which could get us started on async calls to native code and callbacks from go to dart.

I had appreciate any sort of help.

@ganeshrvel ganeshrvel added the enhancement New feature or request label Jul 25, 2020
@ganeshrvel
Copy link
Author

@jld3103 any updates on this?

@provokateurin
Copy link
Member

I wasn't able to get it working, but I think it is possible. I guess it was especially hard, because I was using a static Rust librarys

@ganeshrvel
Copy link
Author

Please let us know if you were able to get it working. Please keep this issue open till then.

@provokateurin
Copy link
Member

I'm not working on it, because I have no project that needs it, but still this issue should be kept open

@ganeshrvel
Copy link
Author

Finally an engineer from Google made this happen.

Use Dart FFI and Go asynchronously.
https://github.com/mraleph/go_dart_ffi_example

Thanks to @mraleph 🎉

@provokateurin
Copy link
Member

That's really cool

@pchampio pchampio added example About an example plugin Issue about an existing or possible plugin question User questions and removed enhancement New feature or request labels Nov 1, 2020
@pchampio pchampio closed this as completed Nov 1, 2020
@jerson
Copy link

jerson commented Feb 17, 2021

@ganeshrvel i have a library using golang (ffi and also protobuf for messages) and dart, also Hover :D if you want to take a look here it is
https://github.com/jerson/flutter-rsa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example About an example plugin Issue about an existing or possible plugin question User questions
Development

No branches or pull requests

4 participants