Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 36 additions & 146 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,144 +16,55 @@ The flutter engine itself doesn't know how to deal with desktop platforms _(eg h

The choice of [Golang](https://github.com/golang/go) 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.

## Plugins

Some popular plugins are already implemented over at [github.com/go-flutter-desktop/plugins](https://github.com/go-flutter-desktop/plugins)
If you have implemented a plugin that you would like to share, feel free to open a PR!

## How to install

<details>
<summary> :package: :penguin: Linux</summary>
<h4>From binaries</h4>
Check out the <a href="https://github.com/go-flutter-desktop/go-flutter/releases">Release</a> page for prebuilt versions.

<h4>From source</h4>

Go read first: [go-gl/glfw](https://github.com/go-gl/glfw/)


```bash
# Clone
git clone https://github.com/go-flutter-desktop/go-flutter.git
cd go-flutter

# 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/go-flutter-desktop/go-flutter

# Build the example project
go build main.go

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

</details>

<details>
<summary> :package: :checkered_flag: Windows</summary>
<h4>From binaries</h4>
Check out the <a href="https://github.com/go-flutter-desktop/go-flutter/releases">Release</a> page for prebuilt versions.

<h4>From source</h4>

Go read first: [go-gl/glfw](https://github.com/go-gl/glfw/)


```bash
# Clone
git clone https://github.com/go-flutter-desktop/go-flutter.git
cd go-flutter

# 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/go-flutter-desktop/go-flutter/issues/34

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

# Build the example project
go build main.go

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

</details>

<details>
<summary> :package: :apple: MacOS</summary>
<h4>From binaries</h4>
Check out the <a href="https://github.com/go-flutter-desktop/go-flutter/releases">Release</a> page for prebuilt versions.

<h4>From source</h4>

Go read first: [go-gl/glfw](https://github.com/go-gl/glfw/)
<p align="center">
<img src="./stocks.jpg" width="650" align="center" alt="Screenshot of the Stocks demo app on macOS">
</p>

## Getting started

```bash
# Clone
git clone https://github.com/go-flutter-desktop/go-flutter.git
cd go-flutter
The best way to get started is to install [hover](https://github.com/go-flutter-desktop/hover), the official go-flutter tool to set up, build and run Flutter apps on the desktop, including hot-reload.

# Build the flutter simpleDemo project
cd example/simpleDemo/
cd flutter_project/demo/
flutter build bundle
cd ../..
Read the [hover tutorial](https://github.com/go-flutter-desktop/hover) to run your app on desktop, or start with [one of our example apps](https://github.com/go-flutter-desktop/examples).

# Download the share library, the one corresponding to your flutter version.
go run engineDownloader.go
It's also possible to [manually install](https://github.com/go-flutter-desktop/go-flutter/wiki/Manual-install-and-usage) and use go-flutter, but this is not recomended for new users.

# 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.
## Supported features

# Get the libraries
go get -u -v github.com/go-flutter-desktop/go-flutter
- Linux :penguin:
- MacOS :apple:
- Windows :checkered_flag:
- **Hot Reload**
- Plugin system
- BinaryMessageCodec, BinaryMessageChannel
- StandardMessageCodec, JSONMessageCodec
- StandardMethodCodec, **MethodChannel**
- Importable as Go library into custom projects
- Text input handling
- Clipboard copy & paste
- Window title and icon
- Standard keyboard shortcuts
- <kbd>ctrl-c</kbd> <kbd>ctrl-v</kbd> <kbd>ctrl-x</kbd> <kbd>ctrl-a</kbd>
- <kbd>Home</kbd> <kbd>End</kbd> <kbd>shift-Home</kbd> <kbd>shift-End</kbd>
- <kbd>Left</kbd> <kbd>ctrl-Left</kbd> <kbd>ctrl-shift-Left</kbd>
- <kbd>Right</kbd> <kbd>ctrl-Right</kbd> <kbd>ctrl-shift-Right</kbd>
- <kbd>Backspace</kbd> <kbd>ctrl-Backspace</kbd> <kbd>Delete</kbd>

# Build the example project
go build main.go
Are you missing a feature? [Open an issue!](https://github.com/go-flutter-desktop/go-flutter/issues/new)

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

</details>
A separate repository contains example Flutter apps that also run on the desktop. Go to [github.com/go-flutter-desktop/examples](https://github.com/go-flutter-desktop/examples) to give them a try.

## Flutter Demos Projects
## Plugins

The examples are available [here](./example/).

<p align="center">
<img src="./stocks.jpg" width="650" align="center" alt="Screenshot of the Stocks demo app on macOS">
</p>
Some popular plugins are already implemented over at [github.com/go-flutter-desktop/plugins](https://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!

## Version compatibility

### Flutter version

Flutter is a relatively new project. It's framework and engine are updated often. This project tries to stay compatible with the [beta channel](https://github.com/flutter/flutter/wiki/Flutter-build-release-channels) of flutter.
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](https://github.com/flutter/flutter/wiki/Flutter-build-release-channels) of Flutter.

### Go version

Expand All @@ -163,27 +74,6 @@ Updating Go is simple, and Go [seldomly has backwards incompatible changes](http

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

## Support

- [x] Linux :penguin:
- [x] Windows :checkered_flag:
- [x] MacOS :apple:
- [x] Importable go library
- [ ] Plugins [Medium article on how the Flutter's messaging works](https://medium.com/flutter-io/flutter-platform-channels-ce7f540a104e)
- [x] JSONMethodCodec
- [x] StandardMessageCodec, StandardMethodCodec
- [x] MethodChannel
- [ ] EventChannel
- [ ] System plugins [Platform channels used by the Flutter system](https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/services/system_channels.dart)
- [x] Window Title
- [x] Text input
- [x] Clipboard (through shortcuts and UI)
- [x] Keyboard shortcuts
- [x] <kbd>ctrl-c</kbd> <kbd>ctrl-v</kbd> <kbd>ctrl-x</kbd> <kbd>ctrl-a</kbd>
- [x] <kbd>Home</kbd> <kbd>End</kbd> <kbd>shift-Home</kbd> <kbd>shift-End</kbd>
- [x] <kbd>Left</kbd> <kbd>ctrl-Left</kbd> <kbd>ctrl-shift-Left</kbd>
- [x] <kbd>Right</kbd> <kbd>ctrl-Right</kbd> <kbd>ctrl-shift-Right</kbd>
- [x] <kbd>Backspace</kbd> <kbd>ctrl-Backspace</kbd> <kbd>Delete</kbd>
- [ ] <kbd>ctrl-Delete</kbd>
- [ ] Key events
- [ ] Hot reload
## License

[BSD 3-Clause License](LICENSE)
2 changes: 0 additions & 2 deletions example/simpleDemo/.build/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions example/simpleDemo/.gitignore

This file was deleted.

Binary file removed example/simpleDemo/assets/icon.png
Binary file not shown.
Loading