ABausG / home_widget

Flutter Package for Easier Creation of Home Screen Widgets
773 stars 212 forks source link

Widget not update background when app killed ( home_widget: ^0.4.0-alpha.0 ) #168

Open Jasco07122021 opened 1 year ago

Jasco07122021 commented 1 year ago

My device is Android ( Samsung S10 )

void main() { HomeWidget.registerInteractivityCallback(backgroundCallbackHomeWidget); ... }

@pragma('vm:entry-point') Future backgroundCallbackHomeWidget(Uri? uri) async { print('uri $uri ${uri?.host}'); await AppWidgetBackground.initCall(); bool isRegistered = locator.isRegistered(); if (!isRegistered) { try { await configureDependenciesHomeWidget(envDev); isRegistered = true; } catch (e) { log('Error $e'); AppWidgetBackground.closeWithoutInject(); } } if (isRegistered) { AppWidgetBackground.init(locator, uri); } }

ABausG commented 1 year ago

Is the callback invoked by the widget?

Jasco07122021 commented 1 year ago

Sorry, it worked, but the widget refreshes in 3.4 seconds on the first click after the app is closed or the first widget is created. I think it takes time to connect the flutter engine. Can we add a new function for this bad case?