In my latest project as a freelance software developer, I had to create a mobile app using Flutter that communicated with the backend using the NATS protocol. One of the most interesting aspects of that project was our usage of the flutter-go-bridge library in order to use a Go library that my client had with the Flutter app.
The documentation for the library is not that bad, but some parts of the documentation was confusing for a first-time user. Thus, I aim to record some clarifications on the documentation that I found while using the library.
- The
go.mod
file you create withgo mod init
should be found in the root directory of the project (the directory wherepubspec.yaml
is found). - Apart from
github.com/csnewman/flutter-go-bridge
, you must also installgithub.com/csnewman/flutter-go-bridge/cmd/flutter-go-bridge
. - Passing objects between Go and Dart doesn’t really work. It’s better to use simple types such as string and numbers when passing dart between Go and Dart.