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

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

问题描述

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

谢谢!

解决方案

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

我刚刚为 Flutter 应用程序编写了一个简单的应用程序小部件,点击后可将您带到 https://flutter.io 链接.

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

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?

Thanks!

解决方案

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.

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天全站免登陆