我们可以使用Flutter为Wear OS和Watch OS构建一个应用吗?

huangapple go评论76阅读模式
英文:

can we build an app for both wear OS and watch OS using flutter?

问题

可以使用Flutter开发一个应用程序,用于获取心率、血氧、步数、血压等数据,并支持Wear OS和Watch OS吗?

至于设计,我只在pub.dev中找到适用于Wear OS的依赖项(wear plugin),但找不到同时支持Wear OS和Watch OS的依赖项。

英文:

can we build an app for both wear OS and watch OS using flutter, to get heart rate, blood oxygen, step count, blood pressure, etc.

For design, there is only dependency for wear OS (wear plugin) in pub.dev. I can't find any dependency for both wear OS and watch OS

答案1

得分: 2

你无法使用第三方UI框架构建WatchOS应用程序。因为你的代码运行在扩展进程中。苹果将WatchOS的UI暴露给某种代理接口(WKInterfaceObjectSwiftUI)来处理,而实际的UI接口(UIResponder)是完全无法访问的。

因此,CoreAnimation、UIView、MetalKit(Flutter大量使用它)都不可用。

英文:

You can't build WatchOS App with Third party UI framework. Since your codes runs in extension process. Apple exposed WatchOS UI to be handled by some kind of proxy interface(WKInterfaceObject, SwiftUI) while actual UI interface(UIResponder) is totally inaccessible.

So, CoreAnimation, UIView, MetalKit(flutter heavily use it) is not available.

huangapple
  • 本文由 发表于 2023年4月4日 09:39:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/75924881.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定