【HarmonyOS NEXT】Flutter中Platform.isOhos找不到

【关键字】

Flutter / Platform.isOhos / platform.dart

【问题描述】

Flutter中Platform.isOhos找不到。

flutter_flutter\bin\cache\pkg\sky_engine\lib\io\platform.dart 中确实没有isOhos的定义。

三方库版本:

[!] Flutter (Channel dev, 3.7.12-ohos, on Microsoft Windows [版本 10.0.22631.3737], locale zh-CN)
      Flutter version 3.7.12-ohos on channel dev at D:\flutter_flutter
    ! Upstream repository https://gitee.com/openharmony-sig/flutter_flutter.git is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://gitee.com/openharmony-sig/flutter_flutter.git to dismiss
      this error.
      Framework revision 5d5b44473f (3 days ago), 2024-06-24 10:41:06 +0000
      Engine revision 1a65d409c7
      Dart version 2.19.6
      DevTools version 2.20.1
      Pub download mirror https://pub.flutter-io.cn
      Flutter download mirror https://storage.flutter-io.cn
      If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly
      to perform update checks and upgrades.

[✓] HarmonyOS toolchain - develop for HarmonyOS devices
      OpenHarmony Sdk at D:\DevEco Studio\sdk, available api versions has [12:HarmonyOS-NEXT-DB1]
      Ohpm version 5.0.2
      Node version v18.14.1
      Hvigorw binary at D:\DevEco Studio\tools\hvigor\bin\hvigorw

【解决方案】

可以引用该库来解决这个问题:https://pub.dev/packages/flutter_platform_utils,如果有Platform.isOhos 的判断,建议换成 PlatformUtils.isOhos。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值