flutter draw google map

package main

import (

const (
    channelName = "com.example/google_maps"

var options = []flutter.Option{
    flutter.WindowInitialDimensions(800, 600),

func main() {
    options = append(options, flutter.AddPlugin(&GoogleMapsPlugin{}))
    options = append(options, flutter.AddPlugin(&flutter.DefaultPlugin{
        OnReceiveFrameworkCall: onReceiveFrameworkCall,

    options = append(options, flutter.AddPlugin(&flutter.DefaultPlugin{
        OnReceiveFrameworkCall: onReceiveFrameworkCall,

    // initialize flutter
    options = append(options, flutter.WindowInitialDimensions(800, 600))
    options = append(options, flutter.AddPlugin(&GoogleMapsPlugin{}))

    // Start go-flutter application
    if err := flutter.Run(options, "assets"); err != nil {

// GoogleMapsPlugin implements flutter.Plugin and handles method calls to
// the 'com.example/google_maps' channel.
type GoogleMapsPlugin struct{}

var _ flutter.Plugin = &GoogleMapsPlugin{} // compile-time type check

// InitPlugin initializes the plugin.
func (p *GoogleMapsPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
    channel := plugin.NewMethodChannel(messenger, channelName, plugin.StandardMethodCodec)
    channel.HandleFunc("drawMap", p.handleDrawMap)
    return nil

// handleDrawMap is called when the 'drawMap' method is invoked.
func (p *GoogleMapsPlugin) handleDrawMap(arguments interface{}) (reply interface{}, err error) {
    // Your map drawing logic goes here
    fmt.Println("Drawing Google Map")
    return nil, nil

// onReceiveFrameworkCall is called when a method call is received from the Flutter framework.
func onReceiveFrameworkCall(messenger plugin.BinaryMessenger, method string, arguments interface{}) (reply interface{}, err error) {
    switch method {
    case "drawMap":
        return plugin.Exec(nil, &GoogleMapsPlugin{}, method, arguments)
    return nil, fmt.Errorf("method not implemented: %s", method)

This example provides a basic structure for a Flutter application in Go that includes the initialization of a Google Maps plugin. The code includes the main function, the GoogleMapsPlugin struct, and the necessary methods for handling method calls from the Flutter framework, specifically the "drawMap" method. The actual map drawing logic should be implemented in the handleDrawMap method.