HarmonyOS flutter混编,shared\_preferences三方库应该如何正确使用?

flutter混编,shared\_preferences三方库应该如何正确使用,混编模式下不起效,而且混编模式无法调试flutter代码,不知道问题出在哪里,能否给个示例代码。

阅读 653
1 个回答

flutter混编:ohos工程引入flutter工程,主要通过module引入。

三方库使用方式:

dev_dependencies:
  shared_preferences:
    git:
    url: "https://gitee.com/openharmony-sig/flutter_packages.git"
    path: "packages/shared_preferences"

调试flutter:ets代码使用 DevEco-Studio 进行调试。

dart代码可以使用vscode进行调试。flutter HarmonyOS版本调试时,需要加上参数–local-engine=/Users/xxx/ohos/engine/src/out/ohos\_debug\_unopt\_arm64

参考链接:https://gitee.com/openharmony-sig/flutter\_samples/blob/master/ohos/docs/06\_debug/%E8%B0%83%E8%AF%95dart%E4%BB%A3%E7%A0%81.md

flutter HarmonyOS开发指导:https://gitee.com/openharmony-sig/flutter\_samples/tree/master/ohos/docs