Skip to content

Latest commit

 

History

History
89 lines (55 loc) · 1.99 KB

README.md

File metadata and controls

89 lines (55 loc) · 1.99 KB

All platform example

The repository goal is to provide an example of a cross-platform application (android, ios, linux, macos, windows, web) written in Flutter.

In this example we use API, that are different based on the platform, to save and load the value of the counter.

We use Mobx.dart to manage the state of the application.

WARNING: this is highly experimental and subject to change/bug/crash at every time.

Blog post with the detail on how it work https://medium.com/@segaud.kevin/flutter-cross-platform-a2371fe790e7.

How can I launch the application

1. Configuring Flutter

You will need to be on the master channel of Flutter

flutter channel master && flutter upgrade

2. Settings some env variable

You will need to set some environment variable to allow Flutter access new feature.

For linux :

export ENABLE_FLUTTER_DESKTOP=true
export FLUTTER_WEB=true
export CHROME_EXECUTABLE="google-chrome"

For macos :

export ENABLE_FLUTTER_DESKTOP=true
export FLUTTER_WEB=true

For windows :

TBD

3. Launching the application

You can launch the application with F5 on vscode for desktop and mobile.

If you want to test the application on the web you will need to use the command line.

some example:

  • Linux
flutter run -d linux
  • Web
flutter run -d web
  • MacOs

    CocoaPods needs to be installed. It is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins

    To install CocoaPods:

brew install cocoapods
pod setup

Launch on mac:

flutter run -d macos

4. Hm there is a bug :/

If you encounter a problem please create an issue here and we will see what we can do about it.