MCPcopy Index your code
hub / github.com/go-flutter-desktop/go-flutter

github.com/go-flutter-desktop/go-flutter @v0.52.2 sqlite

repository ↗ · DeepWiki ↗ · release v0.52.2 ↗
357 symbols 850 edges 60 files 258 documented · 72%
README

go-flutter - A package that brings Flutter to the desktop

Awesome Flutter Documentation Go Report Card Join the chat at https://gitter.im/go-flutter-desktop/go-flutter

Purpose

Flutter allows you to build beautiful native apps on iOS and Android from a single codebase.

This unofficial project brings Flutter to the desktop through the power of Go and GLFW.

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. This project implements the Flutter's Embedding API using a single code base that runs on Windows, macOS, and Linux. For rendering, 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 makes it easy to build cross-platform plugins.

Screenshot of the Stocks demo app on macOS

Getting started

The best way to get started is to install hover, the official go-flutter tool to set up, build and run Flutter apps on the desktop, including hot-reload.

Read the hover tutorial to run your app on the desktop, or start with one of our example apps.

If you want more in-depth information about go-flutter, read the wiki.

Supported features

  • Linux :penguin:
  • MacOS :apple:
  • Windows :checkered_flag:
  • Hot Reload
  • Plugin system
  • BinaryMessageCodec, BinaryMessageChannel
  • StandardMessageCodec, JSONMessageCodec
  • StandardMethodCodec, MethodChannel
  • Plugin detection for supported plugins
  • Importable as Go library into custom projects
  • UTF-8 Text input
  • Clipboard copy & paste
  • Window title and icon
  • Standard 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
  • Mouse-over/hovering
  • Mouse-buttons
  • RawKeyboard events
  • Distribution format (windows-msi, mac-dmg, linux-appimage, and more)
  • Cross-compiling using docker :whale:

Are you missing a feature? Open an issue!

Examples

A separate repository contains example Flutter apps that also run on the desktop. Go to github.com/go-flutter-desktop/examples to give them a try.

Plugins

Some popular plugins are already implemented over at github.com/go-flutter-desktop/plugins. If you have implemented a plugin that you would like to share, feel free to open a PR on the plugins repository!

For a detailed tutorial on how to create a plugin, read the wiki.

Version compatibility

Flutter version

Flutter itself is a relatively young project. Its framework and engine are updated often. The go-flutter project tries to stay compatible with the beta channel of Flutter.

Go version

Updating Go is simple and Go seldomly has backwards-incompatible changes. This project remains compatible with the latest Go stable release.

GLFW version

This project uses go-gl/glfw for GLFW v3.3.

License

BSD 3-Clause License

Extension points exported contracts — how you extend this code

Plugin (Interface)
TODO: move type Plugin into package plugin? Plugin defines the interface that each plugin must implement. When InitPlugi [9 …
plugin.go
ResponseSender (Interface)
ResponseSender defines the interface that must be implemented by a messenger to handle replies on on message. It is an e [5 …
plugin/binary-messenger.go
MessageCodec (Interface)
MessageCodec defines a message encoding/decoding mechanism. [4 implementers]
plugin/codec.go
ExternalTextureHanlderFunc (FuncType)
ExternalTextureHanlderFunc describes the function that handles external Texture on a given ID.
texture-registry.go
Option (FuncType)
Option for Application
option.go
BasicMessageHandler (Interface)
BasicMessageHandler defines the interfece for a basic message handler.
plugin/basic-message-channel.go
StreamHandler (Interface)
StreamHandler defines the interface for a stream handler setup and tear-down requests.
plugin/event-sink.go
MethodHandler (Interface)
MethodHandler defines the interface for a method handler.
plugin/method-handler.go

Core symbols most depended-on inside this repo

Send
called by 20
plugin/binary-messenger.go
HandleFuncSync
called by 19
plugin/method-channel.go
GoError
called by 19
embedder/embedder.go
NewBasicMessageChannel
called by 11
plugin/basic-message-channel.go
writeValue
called by 10
plugin/standard-message-codec.go
AddPlugin
called by 9
option.go
writeSize
called by 7
plugin/standard-message-codec.go
NewMethodChannel
called by 6
plugin/method-channel.go

Shape

Method 182
Function 98
Struct 53
Interface 10
TypeAlias 9
FuncType 5

Languages

Go100%

Modules by API surface

plugin/standard-message-codec.go34 symbols
embedder/embedder.go29 symbols
option.go22 symbols
plugin/method-channel.go17 symbols
text-input.go15 symbols
glfw.go13 symbols
plugin/basic-message-channel.go11 symbols
embedder/embedder_proxy.go11 symbols
plugin/codec.go10 symbols
texture-registry.go9 symbols
plugin/helper_test.go9 symbols
platform.go8 symbols

Dependencies from manifests, versioned

github.com/Xuanwo/go-localev1.1.0 · 1×
github.com/go-gl/glv0.0.0-2021121017281 · 1×
github.com/go-gl/glfw/v3.3/glfwv0.0.0-2022071219314 · 1×
golang.org/x/textv0.3.7 · 1×

For agents

$ claude mcp add go-flutter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact