From aa3ca5d8dec4d312bf5b1cd7d1acab02dc34ee73 Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Sat, 23 Mar 2024 03:54:01 +0100 Subject: [PATCH] Changed library --- lib/main.dart | 14 +++++++------- pubspec.lock | 8 ++++---- pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 09b0f83..67cd369 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,7 +9,7 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:dynamic_color/dynamic_color.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:package_info_plus/package_info_plus.dart'; -import 'package:receive_sharing_intent/receive_sharing_intent.dart'; +import 'package:receive_sharing_intent_plus/receive_sharing_intent_plus.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -76,10 +76,10 @@ class MyApp extends HookConsumerWidget { useEffect( () { // When app is on background - ReceiveSharingIntent.getMediaStream().listen( + ReceiveSharingIntentPlus.getTextStream().listen( (value) { if (value.isNotEmpty) { - ref.read(receiveSharingIntentUrlProvider.notifier).setValue(value[0].path); + ref.read(receiveSharingIntentUrlProvider.notifier).setValue(value); ref.read(routerProvider).go(RoutesPaths.bookmarks); } }, @@ -87,12 +87,12 @@ class MyApp extends HookConsumerWidget { ); // When app is closed - ReceiveSharingIntent.getInitialMedia().then((value) { - if (value.isNotEmpty) { - ref.read(receiveSharingIntentUrlProvider.notifier).setValue(value[0].path); + ReceiveSharingIntentPlus.getInitialText().then((value) { + if (value != null) { + ref.read(receiveSharingIntentUrlProvider.notifier).setValue(value); ref.read(routerProvider).go(RoutesPaths.bookmarks); } - ReceiveSharingIntent.reset(); + ReceiveSharingIntentPlus.reset(); }); return null; diff --git a/pubspec.lock b/pubspec.lock index 06a5724..20e6056 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -854,14 +854,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - receive_sharing_intent: + receive_sharing_intent_plus: dependency: "direct main" description: - name: receive_sharing_intent - sha256: "8fdf5927934041264becf65199ef8057b8b176e879d95ffa0420cd2a6219c0fd" + name: receive_sharing_intent_plus + sha256: "89020b3c72a0c70409c07f549ae7fc614a56278ecc9bde0a637e49918e00b083" url: "https://pub.dev" source: hosted - version: "1.6.7" + version: "1.0.1" riverpod: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 89253f9..642fd92 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,7 +63,7 @@ dependencies: url: https://github.com/JGeek00/flutter_split_view ref: master-alt super_context_menu: ^0.8.5 - receive_sharing_intent: ^1.6.7 + receive_sharing_intent_plus: ^1.0.1 dev_dependencies: build_runner: ^2.4.8