From 90043b58063b9aaee484673d4d811a8db4775600 Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Mon, 27 Jan 2020 19:20:39 +0000 Subject: [PATCH] Remove text sharing feature --- lib/main.dart | 1 - lib/pages/main.page.dart | 20 -------------------- pubspec.yaml | 1 - 3 files changed, 22 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 3421d67..209fdc1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,7 +22,6 @@ import 'package:device_info/device_info.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; import 'plugins/circular_slider/single_circular_slider.dart'; -import 'package:receive_sharing_intent/receive_sharing_intent.dart'; import 'plugins/dynamic_multi_column_layout.dart'; import 'plugins/spoiler_card.dart'; import 'package:uni_links/uni_links.dart'; diff --git a/lib/pages/main.page.dart b/lib/pages/main.page.dart index 52e7053..4a7a0ee 100644 --- a/lib/pages/main.page.dart +++ b/lib/pages/main.page.dart @@ -22,11 +22,9 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker StreamSubscription _showPopupMessageSubscription; StreamSubscription _reloadUISubscription; StreamSubscription _showPageSubscription; - StreamSubscription _intentDataStreamSubscription; int _previousViewCount; bool _showLoginButton = false; bool _preventAppRefresh = false; - String _savedSharedText; Entity _entityToShow; @override @@ -60,13 +58,6 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker _firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true)); - _intentDataStreamSubscription = ReceiveSharingIntent.getTextStream().listen((String value) { - Logger.d("[SHARED] Got share from stream: $value"); - _handleShare(value); - }, onError: (err) { - Logger.w("[SHARE] getLinkStream error: $err"); - }); - // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project var initializationSettingsAndroid = new AndroidInitializationSettings('mini_icon'); @@ -132,17 +123,7 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker }); } - _handleShare(String text) { - if (text != null && !HomeAssistant().isNoEntities) { - Navigator.pushNamed(context, "/play-media", arguments: {"url": text}); - } - } - _fetchData() async { - ReceiveSharingIntent.getInitialText().then((String value) { - Logger.d("[SHARED] Got initial share: $value"); - _handleShare(value); - }); await HomeAssistant().fetchData().then((_) { _hideBottomBar(); if (_entityToShow != null) { @@ -924,7 +905,6 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker _subscription?.cancel(); _showPageSubscription?.cancel(); _reloadUISubscription?.cancel(); - _intentDataStreamSubscription?.cancel(); //TODO disconnect //widget.homeAssistant?.disconnect(); super.dispose(); diff --git a/pubspec.yaml b/pubspec.yaml index 989f46d..345ef7d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -30,7 +30,6 @@ dependencies: workmanager: ^0.1.5 battery: ^0.3.1+1 sentry: ^2.3.1 - receive_sharing_intent: ^1.3.2 dev_dependencies: