Flutter: Is it somehow possible to create App Widgets (Android) and Today Extensions (iOS)?

耗尽温柔 提交于 2019-11-27 12:20:28

问题


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!


回答1:


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.

Hope that helped!



来源:https://stackoverflow.com/questions/47870740/flutter-is-it-somehow-possible-to-create-app-widgets-android-and-today-extens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!