Git Product home page Git Product logo

flutter2js's Introduction

Build Status Join Gitter Chat Channel -

Introduction

Flutter2js is an experimental project that investigates feasibility of making Flutter apps run in browser using drawing primitives (canvas, CSS and SVG).

Licensed under the BSD 3-Clause License.

Implications of the approach

If the project gets drawing working, the approach taken by this project ("drawing, no HTML elements") has the following implications:

  • All Flutter widgets will work.
  • Apps look (more or less) identical to iOS/Android.
  • Scrolling/animation performance is bad compared to web apps (but possibly acceptable).
  • Code size and accessibility are inevitably poor compared to normal web apps.

Status

Ready

  • Flutter SDK and sample apps compile

Next

  • "Hello world"-like examples draw correctly
  • Mouse/tap handling

You can help!

Notes for developers

  • The project uses dart2js. Unfortunately dartdevc seems to have issues with Flutter SDK packages.

Getting started

Hello world

Clone Git repository

git clone https://github.com/flutter2js/flutter2js

Try "Hello world"

cd examples/hello_world-browser
pub get
pub run webdev serve

Open browser at: http://localhost:8080/main.html

Technical details

Libraries from original Flutter SDK

Flutter SDK libraries are derived from the original Flutter SDK.

These include:

  • dart:ui (original, docs)
    • Because Pub doesn't allow overriding "dart:something" packages, it's exposed as "package:flutter/ui.dart".
  • package:flutter (original, docs)
  • package:flutter_localization (original, docs)
  • package:flutter_test (original, docs)

The modifications include:

  • Many classes in dart:ui such as Canvas delegate implementation to package:flutter2js or expose previously private/external fields.
  • Eliminated usage of language features not supported by dart2js:
    • Assertions in initializers. After dart2js started to support them, this became unnecessary.
    • Some mixins (issue #23770)

flutter2js's People

Contributors

jban332 avatar

Watchers

Kiswono Prayogo avatar  avatar

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.