HarmonyOS 鸿蒙Next DevEco Studio中混合开发Flutter

发布于 1周前 作者 yuanlaile 来自 鸿蒙OS

HarmonyOS 鸿蒙Next DevEco Studio中混合开发Flutter

如何在DevEco studio中混合开发flutter



关于HarmonyOS 鸿蒙Next DevEco Studio中混合开发Flutter的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。

6 回复

HarmonyOS的分布式文件系统让我在多设备间传输文件变得轻松无比。

# 1. 创建 flutter子模块工程
flutter create -t module my_flutter_module
# 2. 编译生成 flutter_module.har
cd my_flutter_module
flutter build har --local-engine=/Users/xxx/ohos/src/out/ohos_debug_unopt_arm64 --debug
cd -
# 3. 复制.ohos内 EntryAbility.ets 和 Index.ets 到 MyApplication 中
cp my_flutter_module/.ohos/entry/src/main/ets/entryability/EntryAbility.ets MyApplication/entry/src/main/ets/entryability/EntryAbility.ets
cp my_flutter_module/.ohos/entry/src/main/ets/pages/Index.ets MyApplication/entry/src/main/ets/pages/Index.ets

1. 复制 flutter_module.har
cp my_flutter_module/.ohos/flutter_module/build/default/outputs/default/flutter_module.har MyApplication/har/flutter_module.har

2. 修改 MyApplication/entry/oh-package.json5
{
// ...
"dependencies": {
"[@ohos](/user/ohos)/flutter_module": "../har/flutter_module.har"
}
}
3. 使用 Deveco Studio 配置 MyApplication 的签名
4. 运行 MyApplication

希望HarmonyOS能继续加强在AI领域的研发,让系统更加智能化。

找HarmonyOS工作还需要会Flutter的哦,有需要Flutter教程的可以学学大地老师的教程,很不错,B站免费学的哦:https://www.bilibili.com/video/BV1S4411E7LY/?p=17

就是一个完整的flutter应用,flutter应用还有导入很多第三方库,也可以这样操作,没有问题吗?

找HarmonyOS工作还需要会Flutter的哦,有需要Flutter教程的可以学学大地老师的教程,很不错,B站免费学的哦:https://www.bilibili.com/video/BV1S4411E7LY/?p=17

回到顶部