Skip to content

Plugin info

Pierre Champion edited this page May 10, 2019 · 18 revisions

go-flutter exposes the flutter's platform-channels allowing you to write platform-specific code.
Plugins development is where this project shine, with the power of Golang we only have to write plugin once.

Add plugins to your application

To add plugin you need to use AddPlugin

If you are using hover edit desktop/cmd/options.go.

Example:

package main

import (
	"github.com/go-flutter-desktop/go-flutter"
	"github.com/go-flutter-desktop/plugins/path_provider"
)

var options = []flutter.Option{
	flutter.WindowInitialDimensions(800, 600),
	flutter.AddPlugin(&path_provider.PathProviderPlugin{
		VendorName:      "myOrganizationOrUsername",
		ApplicationName: "myApplicationName",
	}),
	// flutter.AddPlugin(&SomeOtherPlugin),
}

Implement a plugin

If you want to implement a plugin make sure to read an existing implementation, path_provider is a good example.

For more information, read the GoDoc: here and here.

Clone this wiki locally