Coder Social home page Coder Social logo

appcoreopc / go-flutter-desktop-embedder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from go-flutter-desktop/go-flutter

0.0 3.0 0.0 1004 KB

A Go (golang) Custom Flutter Engine Embedder for desktop

License: GNU Lesser General Public License v3.0

Go 79.70% C 20.30%

go-flutter-desktop-embedder's Introduction

Go Flutter desktop embedder

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

A Go (golang) Custom Flutter Engine Embedder for desktop

Purpose

Disclaimer: Despite being very similar in the end goal, This project doesn't compete with this awesome one.

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

  • Linux ๐Ÿง
  • Windows ๐Ÿ
  • MacOS ๐ŸŽ
  • Importable go library
  • Plugins Medium article on how the the Flutter's messaging works
    • JSON MethodChannel
    • StandardMethodCodec, ...
  • System plugins Platform channels used by the Flutter system
    • Window Title
    • Text input
    • Clipboard (through shortcuts and UI)
    • Keyboard shortcuts
      • ctrl-c ctrl-v ctrl-x ctrl-a
      • Home End shift-Home shift-End
      • Left ctrl-Left ctrl-shift-Left
      • Right ctrl-Right ctrl-shift-Right
      • Backspace ctrl-Backspace Delete
      • ctrl-Delete
    • Key events

go-flutter-desktop-embedder's People

Contributors

artob avatar gitter-badger avatar james-lawrence avatar pas2k avatar pchampio avatar titouant avatar totallygamerjet avatar zephylac avatar zet4 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.