Giter Site home page Giter Site logo

awtrix's Introduction

Desktop Flutter Example

This is the standard Flutter template application, modified to run on desktop.

The linux and windows directories serve as early prototypes of what will eventually become the flutter create templates for desktop, and will be evolving over time to better reflect that goal. The macos directory has now become a flutter create template, so is largely identical to what that command creates.

Building and Running

See the main project README.

To build without running, use flutter build macos/windows/linux rather than flutter run, as with a standard Flutter project.

Dart Differences from Flutter Template

The main.dart and pubspec.yaml have minor changes to support desktop:

  • debugDefaultTargetPlatformOverride is set to avoid 'Unknown platform' exceptions.
  • The font is explicitly set to Roboto, and Roboto is bundled via pubspec.yaml, to ensure that text displays on all platforms.

See the Flutter Application Requirements section of the Flutter page on desktop support for more information.

Adapting for Another Project

Since flutter create is not yet supported for Windows and Linux, the easiest way to try out desktop support with an existing Flutter application on those platforms is to copy the platform directories from this example; see below for details. For macOS, just run flutter create . in your project, which will create the macOS folder (as long as you have macOS support enabled in flutter).

Be sure to read the Flutter page on desktop support before trying to run an existing project on desktop, especially the Flutter Application Requirements section.

Copying the Desktop Runners

The 'linux' and 'windows' directories are self-contained, and can be copied to an existing Flutter project, enabling flutter run for those platforms.

Be aware that neither the API surface of the Flutter desktop libraries nor the interaction between the flutter tool and the platform directories is stable, and no attempt will be made to provide supported migration paths as things change. You should expect that every time you update Flutter you may have to delete your copies of the platform directories and re-copy them from an updated version of flutter-desktop-embedding.

Customizing the Runners

See Application Customization for premilinary documenation on modifying basic application information like name and icon.

If you are building for macOS, you should also read about managing macOS security configurations.

awtrix's People

Contributors

hub058 avatar

Watchers

 avatar

Forkers

hub058

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.