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

hendra picture hendra · Dec 18, 2017 · Viewed 15k times · Source

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!

Answer

Hemanth Raj picture Hemanth Raj · Dec 19, 2017

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.

Gif image

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