add_to_app/multiple_flutters/README.md
This is a sample that shows how to use the Flutter Engine Groups API to embed multiple instances of Flutter into an existing Android or iOS project.
For iOS instructions, see: multiple_flutters_ios.
For Android instructions, see: multiple_flutters_android.
These examples use the Flutter Engine Group APIs on the host platform which allows engines to share memory and CPU intensive resources. This leads to easier embedding of Flutter into an existing app since multiple entrypoints can be maintained via a FlutterFragment on Android or a UIViewController on iOS. Before FlutterEngineGroup, users had to juggle the usage of a small number of engines judiciously.
More info on those API's can be found in the source code:
This sample code performs data synchronization to share data between the host platform and multiple instances of Flutter by combining the Observer design pattern and Flutter platform channels. Here is how it works:
This is just one possible way to synchronize the data between the host platform and multiple Flutter instances. A more complete implementation is proposed in the work of flutter/issues/72030.