It is recommended to further improve data transmission. My suggestions are as follows.
For example:
Flutter sends data to Go language:
flatterToGo.Send(“get”,“{”name“:”tom“,”age“:18}”);
Get the data sent by flutter in Go language code:
fmt.Println(flutter.data(“get”).toJson)//{“name”:“tom”,“age”:18}
fmt.Println(flutter.data(“get”)。 toString)//'{“name”:“tom”,“age”:18}'
Send data to flutter in Go language:
GoToFlutter.Send(“hello”,“{”name“:”tom“,”age“:18}”);
Flutter obtains data sent from Go language:
print(Go.data(“hello”,“{”name“:”tom“,”age“:18}”)。 To Json);//{ “name”:“tom”,“age”:18}
print(Go.data(“hello”,“{”name“:”tom“,”age“:18}”)。 toJson);//’{ “name”:“tom”,“age”:18}'
The go plugin provides flutterToGo. Send() and Go. data() built-in methods.
The go plug framework provides GoToFlutter. Send() and flutter. data() built-in methods;
It is recommended to further improve data transmission. My suggestions are as follows. For example: Flutter sends data to Go language: flatterToGo.Send(“get”,“{”name“:”tom“,”age“:18}”);
Get the data sent by flutter in Go language code: fmt.Println(flutter.data(“get”).toJson)//{“name”:“tom”,“age”:18} fmt.Println(flutter.data(“get”)。 toString)//'{“name”:“tom”,“age”:18}'
Send data to flutter in Go language: GoToFlutter.Send(“hello”,“{”name“:”tom“,”age“:18}”);
Flutter obtains data sent from Go language: print(Go.data(“hello”,“{”name“:”tom“,”age“:18}”)。 To Json);//{ “name”:“tom”,“age”:18} print(Go.data(“hello”,“{”name“:”tom“,”age“:18}”)。 toJson);//’{ “name”:“tom”,“age”:18}'
The go plugin provides flutterToGo. Send() and Go. data() built-in methods. The go plug framework provides GoToFlutter. Send() and flutter. data() built-in methods;