There are two main forms of HarmonyOS Flutter hybrid development.
1. Harr-based
The Flutter module is packaged into a HAR package, which is introduced in the form of a HAR package in the native HarmonyOS project.
The advantage is that the main project developer can not pay attention to the Flutter implementation, and there is no need to install and configure the Flutter development environment, and the disadvantage is that the Flutter code cannot be modified in time, and there is no hot reload.
2.Based on source code
At the time of the source code dependency, the Flutter module was introduced in the native HarmonyOS project.
The advantage is that it is easy to maintain and update Flutter code, and hot reload can also be used. The disadvantage is that you need to set up a Flutter development environment, and developers need to master Flutter.
The project structure is similar to the following:
.
āāā AppScope
ā āāā app.json5
ā āāā resources
ā āāā base
ā āāā rawfile
āāā build-profile.json5
āāā dependencies
ā āāā hvigor-4.1.1.tgz
ā āāā hvigor-ohos-arkui-x-plugin-3.1.0.tgz
ā āāā hvigor-ohos-plugin-4.1.1.tgz
āāā entry
ā āāā build-profile.json5
ā āāā hvigorfile.ts
ā āāā oh-package.json5
ā āāā src
ā āāā main
āāā flutter_module
ā āāā BuildProfile.ets
ā āāā Index.ets
ā āāā build-profile.json5
ā āāā consumer-rules.txt
ā āāā hvigorfile.ts
ā āāā libs
ā ā āāā arm64-v8a
ā āāā obfuscation-rules.txt
ā āāā oh-package.json5
ā āāā src
ā āāā main
ā āāā ohosTest
ā āāā test
āāā har
ā āāā GT-HM-1.0.4.har
ā āāā flutter.har
ā āāā flutter_boost.har
ā āāā flutter_module.har
ā āāā lib_base.har
āāā hvigor
ā āāā hvigor-config.json5
āāā hvigorfile.ts
āāā local.properties
āāā oh-package.json5
āāā package-lock.json
āāā package.json
Top comments (1)
HarmonyOS Flutter in Action 07 shows hybrid app development combining Flutter with native HarmonyOS.