[英]Can I run my flutter code without any UI.. like an api call
I have notification which has buttons.我有带有按钮的通知。 On a button click I want to call an API and just patch its value.
单击按钮时,我想调用 API 并修补其值。
Its something like Whatsapp reply where we don't want the app to launch.它类似于 Whatsapp 回复,我们不希望该应用程序启动。
I know we can write native code for android and ios seperately.我知道我们可以分别为 android 和 ios 编写本机代码。 But it would be really great if i could run a snippet of dart code.
但如果我能运行一段 dart 代码,那就太好了。
Since you have only asked if you can, yes you can.既然你只问是否可以,是的,你可以。 We did it in our android app a while back.
不久前,我们在 android 应用程序中做到了这一点。 The whole point of flutter engine is not only to render UIs but also to run code inside it without any UIs as well.
flutter 引擎的重点不仅在于渲染 UI,而且还可以在没有任何 UI 的情况下在其中运行代码。 Use platform channels for communication.
使用平台渠道进行沟通。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.