DEV Community 👩‍💻👨‍💻

Tanikonda Ramakrishna
Tanikonda Ramakrishna

Posted on

How to send json data from go to dart

package main

import "C"
import "fmt"

type userStruct struct {
    name string
    age  int
}

//export GetData
func GetData() userStruct {
    fmt.Println("hi from go")
    user := userStruct{name: "RK", age: 22}
    return user
}
Enter fullscreen mode Exit fullscreen mode

how can I call the GetData function in dart? since we can't use go structs in c-shared libraries. My goal is to send data of any kind like bytes, maps, structs etc.. from go to dart. Is it possible to do this?

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.