3

Is it possible somehow to display Android homescreen widget as a Flutter widget?

I've read about PlatformView widget that can embed any Android view inside Flutter app. How is it possible to do the same with homescreen widgets?

emvaized
  • 884
  • 12
  • 23
  • Homescreen widget you mean Launcher widget? – Aawaz Gyawali May 28 '20 at 12:31
  • @AawazGyawali Exactly – emvaized May 28 '20 at 19:51
  • Displaying homescreen widgets from other apps will likely require writing lots of native Android code. Check this: [docs](https://developer.android.com/guide/topics/appwidgets/host), [tutorial](http://coderender.blogspot.com/2012/01/hosting-android-widgets-my.html) – Pavel May 29 '20 at 00:09
  • @Pavel Sure, I know. I just saw a lot of Flutter packages that embed native views, like this one: https://github.com/DevFatani/Web_Vuw – emvaized May 29 '20 at 09:45
  • And was just wondering, how it's possible to do a similar thing with homescreen widgets – emvaized May 29 '20 at 09:45

2 Answers2

1

I found a github project which is only for android in flutter but initially has much to solve the problem This flutter_home_screen_widget_example github repo

Also found a similar github issue26134 requesting for the same

Got two more related stackoverflow questions

questions/44120149/android-lock-screen-widget-in-flutter

questions/47870740/flutter-is-it-somehow-possible-to-create-app-widgets-android-and-today-extens#47887388

  • This github project, as far as I understand, is intended to show Flutter widgets on homescreen, not homescreen widgets in Flutter app – emvaized May 29 '20 at 12:57
0

There is no official support from flutter but you can take a look at this video explaining how to create a home widget using flutter unfortunately the speak he didn't post the code. It looks like the only solution to add the app widget android code in the generated code which means you should know android development in kotlin/java.