Skip to content

Tips and tricks

Pierre Champion edited this page Sep 21, 2019 · 18 revisions

Collection of tips and tricks found by go-flutter users

1. Windows console

On the Windows OS the console keep showing and disappearing when using Dart Process?

Place the following hide-cmd_windows.go file into the go/cmd/ directory:

package main

// the file hide-cmd_windows.go is used to hide console windows that keep
// showing up on each Dart Process.run calls

import "github.com/gonutz/w32"

func init() {
	console := w32.GetConsoleWindow()
	if console != 0 {
		_, consoleProcID := w32.GetWindowThreadProcessId(console)
		if w32.GetCurrentProcessId() == consoleProcID {
			w32.ShowWindowAsync(console, w32.SW_HIDE)
		}
	}
}