简体   繁体   English

我可以在没有任何 UI 的情况下运行我的 flutter 代码吗.. 就像 api 调用一样

[英]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.

相关问题 我在没有Rokon的情况下创建了一个UI,但是我想稍后再启动Rokon来运行我的游戏,可以这样做吗? - I created a UI without Rokon, but I'd like to start Rokon later to run my game, any way to do this? 我可以在没有 xcode 的情况下在 mac 上运行 flutter 吗? - Can I run flutter without xcode on mac? 有没有办法在eclipse上添加我的签名,以便我可以从Eclipse运行我的代码? - Is there any way to add my signature on the eclipse, so that i can run my code from Eclipse? 我可以通过没有任何API的Android应用程序执行此代码吗? - Can I execute this code through an Android app without any API's? 如何创建简单的api来测试我的移动应用程序而无需在服务器上编写api? - How can I create a simple api to test my mobile app without having to code the api out on a server? 我可以在Android Studio中运行API级别7(即eclair)的代码吗? - Can i run my code of API level 7 i.e eclair in android studio? 我可以让flutter代码可以运行python程序吗? - Can I make flutter code can run python program? React Native Redux我该如何更新UI,调用不使用标志的API后导航到新屏幕 - React Native Redux how can I update UI, navigate to new screen after call API that without used flag 如何在 flutter 的后台运行 dart 代码? - How can I run dart code in the background in flutter? 当我运行我的代码时,它会给出错误代码 400,但是当我进行热刷新时,它会在控制台中显示数据,同时从 flutter 中的 api 获取数据 - when i run my code it gives error code 400 but when i do hot refresh it shows data in console while getting data from api in flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM