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

gomobile #20

Open
ghost opened this issue May 26, 2019 · 3 comments
Open

gomobile #20

ghost opened this issue May 26, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented May 26, 2019

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:

  • reduces code maintenance
  • Using golang for the networking on both sides makes the whole thing more sturdy and when you fix a bug your fixing it on both sides.
  • Flutter Plugins for GO-Desktop work exactly the same on Mobile as on Desktop. SO you can use it for Desktop too.
  • Flutter Web can also use it by using gowasm.

Of course there are some bad things too:

  • More overhead because you have to pass through more layers, but for GUI its a minor hit and GUI is not where the bottleneck is.
  • More complexity for sure.
@kelindar
Copy link
Contributor

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

@ghost
Copy link
Author

ghost commented Jun 29, 2019

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
Copy link
Author

ghost commented Jun 29, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant