diff --git a/lib/utils/home_widget_utils.dart b/lib/utils/home_widget_utils.dart index 024c16dc2..5d5f2bc8e 100644 --- a/lib/utils/home_widget_utils.dart +++ b/lib/utils/home_widget_utils.dart @@ -135,6 +135,9 @@ class HomeWidgetUtils { /////// Getter & Getterfunctions /////// //////////////////////////////////////// + Stream get widgetClicked => HomeWidget.widgetClicked; + Future initiallyLaunchedFromHomeWidget() => HomeWidget.initiallyLaunchedFromHomeWidget(); + Future> get _widgetIds async => (await HomeWidget.getWidgetData(keyWidgetIds))?.split(',') ?? []; // _packageId must be the exact id of the package variable in "AndroidManifest.xml" !! NOT the applicationId of the flavor !! @@ -692,4 +695,8 @@ class UnsupportedHomeWidgetUtils implements HomeWidgetUtils { Future updateTokenIfLinked(Token token) async {} @override Future updateTokensIfLinked(List tokens) async {} + @override + Future initiallyLaunchedFromHomeWidget() => Future.value(null); + @override + Stream get widgetClicked => const Stream.empty(); } diff --git a/lib/utils/riverpod_providers.dart b/lib/utils/riverpod_providers.dart index ec349e7b0..84dec40f3 100644 --- a/lib/utils/riverpod_providers.dart +++ b/lib/utils/riverpod_providers.dart @@ -4,7 +4,6 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:home_widget/home_widget.dart'; import 'package:uni_links/uni_links.dart'; import '../l10n/app_localizations.dart'; @@ -128,8 +127,8 @@ final deeplinkProvider = StateNotifierProvider( DeeplinkSource(name: 'uni_links', stream: uriLinkStream, initialUri: getInitialUri()), DeeplinkSource( name: 'home_widget', - stream: HomeWidget.widgetClicked, - initialUri: HomeWidget.initiallyLaunchedFromHomeWidget(), + stream: HomeWidgetUtils().widgetClicked, + initialUri: HomeWidgetUtils().initiallyLaunchedFromHomeWidget(), ), ]); },