## 1. Project Overview & Quickstart (go-flutter-desktop/LICENSE)

# LICENSE

Open-source repository go-flutter-desktop/LICENSE

### Repository Details
- **Repository:** [go-flutter-desktop/LICENSE](https://github.com/go-flutter-desktop/LICENSE)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (go-flutter-desktop/website)

## File: README.md

# hover.build website

This repository contains the source for the [hover.build](https://hover.build) website.

Additions are welcome. Feel free to [open an issue](https://github.com/go-flutter-desktop/go-flutter/issues/new) if you want to discuss your idea before working on a PR.

## Developing

Install [hugo](https://gohugo.io/) and run `hugo serve --cleanDestinationDir` to test local changes before opening a PR.

## Theme

The themes folder contains a slightly modified copy of the [kube](https://themes.gohugo.io/kube/) theme.

## Hosting

The site is manually deployed and served with love by [Caddy](https://caddyserver.com/) on `sherlock4.geertjohan.net`.

---

## File: content/faq/_index.md

+++
title = "FAQ"
description = "Asked and answered"
+++

#### How does this compare to the "official" flutter desktop?

A elaborate answer was given in [issue#191](https://github.com/go-flutter-desktop/go-flutter/issues/191).

#### Is hover compatible with Visual Studio Code?

Yes, more details available in [issue#129](https://github.com/go-flutter-desktop/go-flutter/issues/129).

#### Is hover compatible with Android Studio?

No, the flutter-intellij plugin doesn't support attaching to existing process,
[issue#213](https://github.com/go-flutter-desktop/go-flutter/issues/213).

#### Where can I find example of go-flutter plugins?

On our [examples](https://github.com/go-flutter-desktop/examples), we shared
multiples plugins implementations. They are easy to explore and run.

For more sophisticate plugins, look at our [plugins](https://github.com/go-flutter-desktop/plugins) repo.

---

## File: content/docs/fonts.md

+++
title = "Fonts"
description = "Configure fonts for desktop"
weight = 30
toc = true
bref = "Fonts style your application, but how to use fonts on desktop? This guide walks you thorugh setting up fonts for desktop"
+++

### Fonts are assets

**Question:** What is the issue with fonts and cross-platform?

**Answer:** No text visible? Make sure you have used fonts added to the project asset.  
The default font for `MaterialApp`, Roboto, is not installed on all machines.


### Example

If the host is missing some fonts, it can cause the text to not be rendered or worse the app might crash, the
the [pointer_demo](https://github.com/go-flutter-desktop/examples/tree/master/pointer_demo)
solves this issue by including the fonts as asset.

```dart
class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Code Sample for widgets.Listener',
      theme: ThemeData(
        // If the host is missing some fonts, it can cause the
        // text to not be rendered or worse the app might crash.
        fontFamily: 'Roboto',
        primarySwatch: Colors.blue,
      ),
      home: MyStatefulWidget(),
    );
  }
}
```

```yaml
# [...]
flutter:

  fonts:
    - family: Roboto
      fonts:
        - asset: fonts/Roboto/Roboto-Thin.ttf
          weight: 100
        - asset: fonts/Roboto/Roboto-Light.ttf
          weight: 300
        - asset: fonts/Roboto/Roboto-Regular.ttf
          weight: 400
        - asset: fonts/Roboto/Roboto-Medium.ttf
          weight: 500
        - asset: fonts/Roboto/Roboto-Bold.ttf
          weight: 700
        - asset: fonts/Roboto/Roboto-Black.ttf
          weight: 900
```

```
Directory structure
.
├── pubspec.yaml
└── fonts
    └── Roboto
        ├── LICENSE.txt
        ├── Roboto-Black.ttf
        ├── Roboto-Bold.ttf
        ├── Roboto-Light.ttf
        ├── Roboto-Medium.ttf
        ├── Roboto-Regular.ttf
        └── Roboto-Thin.ttf
```

---

## File: content/docs/quick-start.md

+++
title = "Quick Start"
description = "Up and running in under a minute"
weight = 10
toc = true
bref = "Hover is a simple build tool to create 'go-'flutter desktop applications"
+++

### Install

Hover uses [Go](https://golang.org) to build your Flutter application to desktop. Hover itself is also written using the Go language. You will need to [install go](https://golang.org/doc/install) on your development machine.
Then install hover like this:


```bash
go get -u github.com/go-flutter-desktop/hover
```

If you get this error: `cmdApp.ProcessState.ExitCode undefined (type *os.ProcessState has no field or method ExitCode)`,
then update Go to at least version 1.12.

Run the same command to update when a newer version becomes available.

Install these dependencies:

* You need to make sure you have a C compiler.  
  The recommended C compiler are documented [here](https://github.com/golang/go/wiki/InstallFromSource#install-c-tools).

* You need to make sure you have dependencies of GLFW:
	* On macOS, you need Xcode or Command Line Tools for Xcode (`xcode-select --install`) for required headers and libraries.
	* On Ubuntu/Debian-like Linux distributions, you need `libgl1-mesa-dev xorg-dev` packages.
	* On CentOS/Fedora-like Linux distributions, you need `libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel` packages.
	* See [here](http://www.glfw.org/docs/latest/compile.html#compile_deps) for full details.

### Init

The first time you use hover for a project, you'll need to initialize the project for desktop. `hover init` requires a project path. This is usualy the path for your project on github or a self-hosted git service. _If you are unsure, just make something up, it can always be changed later._

First, cd into a flutter project.

```bash
cd projects/simpleApplication
```

```bash
hover init github.com/my-organization/simpleApplication
```

This creates the directory `desktop` and adds boilerplate files such as Go code and a default logo.

Make sure you have the following
[main_desktop.dart](https://github.com/go-flutter-desktop/examples/blob/master/pointer_demo/lib/main_desktop.dart)
in the root librairie of your application.


Optionally, you may add [plugins](https://github.com/go-flutter-desktop/plugins) to `desktop/cmd/options.go`  
Optionally, change the logo in `desktop/assets/logo.png`, which is used as icon for the window.

### Run with hot-restart

To run the application and attach flutter for hot-reload support:

```bash
hover run
```

By default, hover uses the file `lib/main_desktop.dart` as entrypoint. You may specify a different endpoint by using the `--target` flag.

The hot-reload is manual because you'll need to press 'r' in the terminal to hot-reload the application.  

If you want to integrate go-flutter with VSCode, read [this](https://github.com/go-flutter-desktop/go-flutter/issues/129#issuecomment-513590141) issue.

---

## File: content/docs/using-plugins.md

+++
title = "Using plugins"
description = "Plugins "
weight = 30
bref = "Plugins allow flutter applications to communicate with the host platform"
+++

  
Plugins are an important part when building applications that interact with the
host system. This guide explains how to use plugins across Android, iOS and
desktop with Hover.  

The [github wiki](https://github.com/go-flutter-desktop/go-flutter/wiki/Plugin-info) about using plugins is a good source of updated information.

---

## File: content/blog/one-year-in.md

---
title: "go-flutter: One Year In, What was the journey like?"
  The go-flutter project is now one year old. We want to let you know how the project has
  evolved over this past year.
date: 2019-08-17T19:19:27+02:00
categories: ["general"]
weight: 20
author: "Pierre Champion (@Drakirus)"
draft: false
---

**I'm very excited** to use this first post to talk about _go-flutter_, what it is, why it was created, and how it has evolved.

Before I explain what _go-flutter_ is, let's start with the **famous** flutter system overview.



Flutter's engine takes core technologies, Skia, a 2D graphics rendering library, and Dart, and hosts them in a shell. Different platforms have different shells; for example, there are [shells](https://github.com/flutter/engine/tree/master/shell/platform) available for Android and iOS.

The Flutter team also exposes an [embedder API](https://github.com/flutter/engine/tree/master/shell/platform/embedder) which allows Flutter's engine to be used as a library.

The _go-flutter_ project provides a shell that implements the embedder APIs using a single code base that runs on Windows, macOS, and Linux. Achieving cross-platform support from a single codebase was made easy by using Go as the primary programming language.

---

As the title says, this project was created a year ago, at that time, the embedder API was composed of [180 lines of C](https://github.com/go-flutter-desktop/go-flutter/blob/640dcea647f47ceca0e3fb67166d2ea124a09f24/flutter/library/flutter_embedder.h). **To begin with**, I wanted to reproduce a [simple example shell](https://gist.github.com/chinmaygarde/8abf44921f7d87f6da7bf026267c4792) created by **@chinmaygarde**, one of the core maintainer of the Flutter engine. At first, my goal was to learn the Golang programming language, but only after the first [commit](https://github.com/go-flutter-desktop/go-flutter/tree/640dcea647f47ceca0e3fb67166d2ea124a09f24), I realized that my approach had some advantage over [FDE](https://github.com/google/flutter-desktop-embedding):

- A single codebase for all desktops, instead of 3.  
  _(Doesn't this remind you one of Flutter main selling point?_ 😉).  
- At that time the Windows platform didn't support [text input](https://github.com/google/flutter-desktop-embedding/tree/1145c85a2f4717dabc7bf34387874ebb51d80ca8/windows).

_FDE is now part of the flutter project, making it the official desktop shell._

I was having fun, so I kept going, implementing features after feature. (Mostly by reproducing what **@stuartmorgan** added to _FDE_).

---

**Fast forward six months later**, I was having trouble with my studies/work/go-flutter/life balance, don't get me wrong, I did receive **fantastic** input from the community, but it was too much work, the embedder API was growing **fast** (it now has over [1100](https://github.com/flutter/engine/blob/master/shell/platform/embedder/embedder.h) LOC) and my poor Golang architectures decision started to become a burden.

That's when **@GeertJohan** showed up and joined the project. We [moved the project to an organization](https://github.com/go-flutter-desktop/go-flutter/issues/72) and began fixing architecture issues. Support for [flutter platform channels codecs/API](https://flutter.dev/docs/development/platform-integration/platform-channels) was implemented, along with support for plugins.

The [Hover](https://github.com/go-flutter-desktop/hover) tool was created to make building go-flutter applications easier.

---

**Additionally**, We also had minor input into the Flutter engine project. With *go-flutter*, we created a reliable unofficial shell that is used by dozens of users. We hope to create better consensus on desktop shells, differences between *go-flutter* and *FDE* were found and aligned, which is good. Interaction/discussion between different official/unofficial projects shapes the **'Google-controlled'** part of the Flutter project.

**Overall**, I'm very proud of what the project has become. I qualify the project to be **very** mature. We are now a real alternative to the official desktop shells, with a different approach. Our primary selling points are:

- Easy plugins writing, it is [more accessible](https://github.com/go-flutter-desktop/go-flutter/issues/191#issuecomment-511384007) (and by the nature of Golang, more maintainable) in *go-flutter* than on the official project.
- Single code-base for windows/mac/linux applications.
- Less dependencies.

We'd like to thank everyone who has contributed to the project so far. Many people have helped us, not just by writing code but also by testing new features, reporting [bugs](https://github.com/go-flutter-desktop/go-flutter/issues?q=is%3Aissue+is%3Aopen+label%3Abug), giving advice or sharing ideas. Also a big shout-out to the maintainers of the Flutter Engine project who've helped us out and shared their feedback. **Thanks!**

We hope to write more about *go-flutter* in future posts, to give you updates on the project.