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.

  1. The go.mod file you create with go mod init should be found in the root directory of the project (the directory where pubspec.yaml is found).
  2. Apart from github.com/csnewman/flutter-go-bridge, you must also install github.com/csnewman/flutter-go-bridge/cmd/flutter-go-bridge.
  3. 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.