Flutter:是否可以创建App Widgets(Android)和Today Extensions(iOS)? [英] Flutter: Is it somehow possible to create App Widgets (Android) and Today Extensions (iOS)?

查看:112
本文介绍了Flutter:是否可以创建App Widgets(Android)和Today Extensions(iOS)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了一下构建移动应用程序的过程.是否可以在flutter应用程序中创建Widgets(不是flutter-widgets,而是App Widgets(Android)和Today Extensions(iOS))?我想用dart不能做到,但是有没有办法在Java/Swift中本地实现它们并将它们包含在flutter-app中呢?

I took a look at flutter for building a mobile app. Is it possible to create Widgets (not flutter-widgets, but App Widgets (Android) and Today Extensions (iOS)) in a flutter app? I guess it can't be done with dart, but is there a way of implementing them native in Java/Swift and include them in the flutter-app?

谢谢!

推荐答案

没有指南或文档显示如何为Flutter应用实现应用小部件.绝对有可能使用本机代码实现应用程序小部件.只需创建一个flutter项目并使用android studio打开android部分,只需实现您的主屏幕小部件,它就可以像超级按钮一样工作.

There is no guide or docs showing how to implement a App Widget for a flutter app. It is definitely possible to implement a app widget with native code. Just create a flutter project and open the android part with android studio, just implement your home screen widget, it'll work like a charm.

我刚刚为flutter应用程序编写了一个简单的应用程序小部件,点击该应用程序即可将您带到https://flutter.io链接. 此处是使用flutter创建的简单应用程序,并添加了本机代码.安装它并在主屏幕小部件上查找home_widget_example.

I just wrote a simple app widget for a flutter app that takes you to https://flutter.io link when tapped. Here is the simple app created with flutter and a app widget added with native code. Install it and look for home_widget_example on Home Screen Widgets.

如果您想查看源代码,并从源代码构建应用程序. 在这里.

If you wanted to look into the source code, and build app from source. Here it is.

希望有帮助!

这篇关于Flutter:是否可以创建App Widgets(Android)和Today Extensions(iOS)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆