Skip to content

Options

Pierre Champion edited this page Aug 19, 2019 · 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 ./desktop/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.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.OptionKeyboardLayout(flutter.KeyboardQwertyLayout),
	flutter.OptionVMArguments([]string{"--disable-dart-asserts", "--disable-observatory"}), // release mode flag, !overwritten by hover!

	flutter.PopBehavior(flutter.PopBehaviorClose), // on key escape closes the app
}

If you want more information on available Constants read the goDoc