Skip to content

Options

Pierre Champion | Drakirus edited this page Apr 5, 2020 · 13 revisions

go-flutter comes with a set of options.
Options are used to customize the go-flutter behavior.

Here is a list of all the Option you can use:

// File ./go/cmd/options.go if using hover
var options = []flutter.Option{
	flutter.WindowInitialDimensions(800, 600),
	flutter.WindowDimensionLimits(300, 300, 900, 900),
	flutter.WindowInitialLocation(1000, 300),
	flutter.WindowMode(flutter.WindowModeBorderless),
	flutter.WindowAlwaysOnTop(true), // Always on top of other windows

	// flutter.WindowIcon(iconProvider), // !overwritten by hover!
	// flutter.AddPlugin(&PluginXX{}), // github.com/go-flutter-desktop/plugins

	flutter.ForcePixelRatio(1.5), // Setting this option is not advised. 

	flutter.PopBehavior(flutter.PopBehaviorClose), // on SystemNavigator.pop closes the app

	flutter.VirtualKeyboardShow(func(){}),
	flutter.VirtualKeyboardHide(func(){}),

	flutter.ScrollAmount(120.0), // number of pixels to scroll with the mouse wheel 
}

If you want more information on available Constants read the goDoc