Flutter添加到应用程序,我们可以在本地项目中添加多个Flutter模块吗?

时间:2020-05-27 15:26:09

标签: flutter

我在这里对Flutter的添加到应用的当前限制有疑问。

请参阅此文档。 https://flutter.dev/docs/development/add-to-app

As of Flutter v1.12, add-to-app is supported for the basic scenario of integrating one full-screen Flutter instance at a time per app. It currently has the following limitations:

- Running multiple Flutter instances or running in partial screen views may have undefined behavior.
- Using Flutter in background mode is still a WIP.
- Packing multiple Flutter libraries into an application isn’t supported.
- Plugins used in add-to-app on Android should migrate to the [new Android plugin APIs][], based on FlutterPlugin.
Plugins that don’t support FlutterPlugin may have unexpected behaviors if they make assumptions that are untenable in add-to-app (such as assuming that a Flutter Activity is always present).

- As of v1.17, the Flutter module only supports AndroidX applications on 

此声明

不支持将多个Flutter库打包到一个应用程序中

我正确理解我们只能创建1个Flutter模块项目并将其添加到我们的android或ios项目中吗?

如果是,那么是否有任何解决方法?

1 个答案:

答案 0 :(得分:1)

您可以通过在主Flutter模块中实现子模块来分离模块,每个子模块将由Flutter引擎控制,这意味着您将拥有多个Flutter引擎,因此每个模块中的状态都将保留并分离与其他人。

您可以在此处https://github.com/duytq94/demo-integrate-flutter参阅我的​​演示,部分屏幕和全屏是彼此分开的。