LICENSE Documentation

Official TypeScript developer resources and documentation for go-flutter-desktop/LICENSE. Verified technical context for AI.

0 stars TypeScript TypeScript 1 file ยท ~3,161 tokens
RAW Doc

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

LICENSE

Open-source repository go-flutter-desktop/LICENSE

Repository Details

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 website.

Additions are welcome. Feel free to open an issue if you want to discuss your idea before working on a PR.

Developing

Install hugo 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 theme.

Hosting

The site is manually deployed and served with love by Caddy 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.

Is hover compatible with Visual Studio Code?

Yes, more details available in issue#129.

Is hover compatible with Android Studio?

No, the flutter-intellij plugin doesn't support attaching to existing process,
issue#213.

Where can I find example of go-flutter plugins?

On our examples, we shared
multiples plugins implementations. They are easy to explore and run.

For more sophisticate plugins, look at our 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
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
text
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 to build your Flutter application to desktop. Hover itself is also written using the Go language. You will need to install go 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.

  • 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 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
in the root librairie of your application.

Optionally, you may add 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 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 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 available for Android and iOS.

The Flutter team also exposes an embedder API 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. To begin with, I wanted to reproduce a simple example shell 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, I realized that my approach had some advantage over FDE:

  • 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.

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 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 and began fixing architecture issues. Support for flutter platform channels codecs/API was implemented, along with support for plugins.

The 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 (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, 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.