This repository contains samples to experiment with rendering into multiple views from Flutter. Some samples are aspirational and may not actually work. Some samples may require a custom engine build to run. Some samples may be outdated and/or have other issues. DO NOT DEPEND ON ANYTHING IN THIS REPOSITORY.
This playground does not demonstrate a windowing API and creating/managing windows from a Flutter app is not yet supported. However, the rendering APIs demonstrated in this playground will form the foundation for future multi-window support in Flutter. Nothing in this repository shall be seen as a definite or "official" decision on windowing APIs, though. This is just an exploratory playground.
Please report any bugs you may encounter.
The demos in this repository run on the following platforms:
Platform | Support |
---|---|
macOS | |
Windows | |
Linux | ❌ |
Web | ✅ (flutter run -d chrome ) |
The samples are meant to be used with a custom (prototype) engine using the master branch of the framework.
-
Set up the Framework development environment: see the wiki page.
-
In the framework repo, switch to the master branch:
git checkout master
-
Set up the Engine development environment: see the wiki page.
-
Apply patches depending on platform:
-
macOS only: in the engine repo, apply this playground's patch:
git apply /path/to/playground/patches/macos/001-Add-multi-view-Flutter-macOS-APIs.patch
-
Windows only: in the engine repo, apply this playground's patch:
git apply /path/to/playground/patches/windows/001-Add-multi-view-Flutter-Windows-C++-APIs.patch
-
Build the custom engine: see the wiki page.
-
In this repo, update packages.
flutter pub get
-
Run a sample file (see below for options) with the custom engine. For example,
flutter run --local-engine=host_debug_unopt --local-engine-host=host_debug_unopt -d macos -t lib/raw_dynamic.dart
-
If everything goes well, the app should start up with a number of windows.
Renders some view-specific information into each FlutterView
available in PlatformDispatcher.views
using only APIs
exposed by dart:ui
. A new frame is only scheduled if the metrics of a FlutterView
change or if a view is
added/removed.
Renders a spinning rectangular into each FlutterView
available in PlatformDispatcher.views
using only APIs exposed
by dart:ui
. Frames are continuously scheduled to keep the animation running.
Renders some view-specific information into each FlutterView
available in PlatformDispatcher.views
using the Flutter
widget framework (package:flutter/widgets.dart
). A new frame is only scheduled if the metrics of a FlutterView
change or if a view is added/removed.
Renders a spinning rectangular into each FlutterView
available in PlatformDispatcher.views
using the Flutter
widget framework (package:flutter/widgets.dart
). Frames are continuously scheduled to keep the animation running.
Renders the Counter app (an interactive Material Design app) into each FlutterView
available in
PlatformDispatcher.views
.