emitter-io / go

Go/Golang client for emitter
Eclipse Public License 1.0
66 stars 37 forks source link

gomobile #20

Open ghost opened 5 years ago

ghost commented 5 years ago

I use FLutter, and instead of using the Emitter Dart client lib, its also possible to use the go client lib by compilng golang with gomobile. Then its really easy to embed the gomobile lib inside Flutter. You can even use event streams.

I am raising this because its another way to get the same thing done and has some advantages:

Of course there are some bad things too:

kelindar commented 5 years ago

@gedw99 could you submit a PR with this approach? Are you using gopherjs or building go down to wasm?

ghost commented 5 years ago

Hey

I just use gomobile. Not gopherjs or wasm.

There are a ton of examples and I am on the road right now.

Google "flutter gomobile" and you will find complete examples I promise.

If you need help yell and I can help when back home in 4 days :)

ghost commented 5 years ago

https://github.com/adieu/flutter_go

Using JSON as the serialisation solves the FFI issues.

Also dart has FFI in beta. Its too early to use it but others are. Then you can compile the golang as a c shared lib and call it from flutter..I will change to this approach in a month once dart FFI settles down.