Skip to content
A Go (golang) Custom Flutter Engine Embedder for desktop
Go C
Branch: master
Clone or download
Pull request Compare This branch is 10 commits ahead, 177 commits behind go-flutter-desktop:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
example
flutter Calculate pixel_ratio based on users' display (go-flutter-desktop#75) Feb 17, 2019
.gitattributes Add new example project + Importable as a Go library Sep 11, 2018
.gitignore
LICENSE Update LICENSE Feb 17, 2019
README.md
gutter.go Update gutter.go Feb 20, 2019
keyboard.go
mascot.png Add new example project + Importable as a Go library Sep 11, 2018
option.go Calculate pixel_ratio based on users' display (go-flutter-desktop#75) Feb 17, 2019
plugin_receiver.go Avoid unnecessary PlatformMessage copies in plugin callback loop (go… Nov 4, 2018
stocks.jpg Added a screenshot of the Stocks demo app on macOS. Sep 26, 2018
system_plugins.go Avoid unnecessary PlatformMessage copies in plugin callback loop (go… Nov 4, 2018
text_model.go Merge branch 'plugin', Add support for the JSON MethodChannel Plugins Nov 4, 2018

README.md

Go Flutter desktop embedder

Join the chat at https://gitter.im/go-flutter-desktop-embedder/Lobby Awesome Flutter

⚠️ Warning: this project has been moved to its own organization.
Please take a look at its new location: github.com/go-flutter-desktop

A Go (golang) Custom Flutter Engine Embedder for desktop

Purpose

Disclaimer: Yes this project has the same goals as google/FDE, but I'm having fun and it scratches an itch I have, so I'm gonna keep going!

The flutter engine itself doesn't know how to deal with desktop platforms (eg handling mouse/keyboard input). Instead, it exposes an abstraction layer for whatever platform to implement. The purpose of this project is to implement Flutter's Embedding API using a SINGLE code base that runs on Windows, MacOS, and Linux. GLFW fits the job because it provides the right abstractions over the OpenGL's Buffer/Mouse/Keyboard for each platform.

The choice of Golang comes from the fact that it has the same tooling on every platform. Plus golang is a great language because it keeps everything simple and readable, which, I hope, will encourage people to contribute 😁.

How to install

📦 🐧 Linux

From binaries

Check out the Release page for prebuilt versions.

From source

Go read first: go-gl/glfw

# Clone
git clone https://github.com/Drakirus/go-flutter-desktop-embedder.git
cd go-flutter-desktop-embedder

# Build the flutter simpleDemo project
cd example/simpleDemo/
cd flutter_project/demo/
flutter build bundle
cd ../..

# Download the share library, the one corresponding to your flutter version.
go run engineDownloader.go

# REQUIRED before every `go build`. The CGO compiler need to know where to look for the share library
export CGO_LDFLAGS="-L${PWD}"
# The share library must stay next to the generated binary.

# Get the libraries
go get -u -v github.com/Drakirus/go-flutter-desktop-embedder

# Build the example project
go build main.go

# `go run main.go` is not working ATM.
📦 🏁 Windows

From binaries

Check out the Release page for prebuilt versions.

From source

Go read first: go-gl/glfw

# Clone
git clone https://github.com/Drakirus/go-flutter-desktop-embedder.git
cd go-flutter-desktop-embedder

# Build the flutter simpleDemo project
cd example/simpleDemo/
cd flutter_project/demo/
flutter build bundle
cd ../..

# Download the share library, the one corresponding to your flutter version.
go run engineDownloader.go

# REQUIRED before every `go build`. The CGO compiler need to know where to look for the share library
set CGO_LDFLAGS=-L%cd%
# The share library must stay next to the generated binary.
# If you ran into a MinGW ld error, checkout: https://github.com/Drakirus/go-flutter-desktop-embedder/issues/34

# Get the libraries
go get -u -v github.com/Drakirus/go-flutter-desktop-embedder

# Build the example project
go build main.go

# `go run main.go` is not working ATM.
📦 🍎 MacOS

From binaries

Check out the Release page for prebuilt versions.

From source

Go read first: go-gl/glfw

# Clone
git clone https://github.com/Drakirus/go-flutter-desktop-embedder.git
cd go-flutter-desktop-embedder

# Build the flutter simpleDemo project
cd example/simpleDemo/
cd flutter_project/demo/
flutter build bundle
cd ../..

# Download the share library, the one corresponding to your flutter version.
go run engineDownloader.go

# REQUIRED before every `go build`. The CGO compiler need to know where to look for the share library
export CGO_LDFLAGS="-F${PWD} -Wl,-rpath,@executable_path"
# The share library must stay next to the generated binary.

# Get the libraries
go get -u -v github.com/Drakirus/go-flutter-desktop-embedder

# Build the example project
go build main.go

# `go run main.go` is not working ATM.

Flutter Demos Projects

The examples are available here.

Screenshot of the Stocks demo app on macOS

Support

You can’t perform that action at this time.