From 933119a3085edecfe6131c182bc44ddd107061d1 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sat, 19 Jul 2025 10:33:03 +0200 Subject: [PATCH] refactor: Remove unused dependencies --- integration_test/app_test.dart | 5 -- .../homeserver_picker/homeserver_picker.dart | 12 ---- lib/utils/client_manager.dart | 7 -- linux/flutter/generated_plugin_registrant.cc | 4 -- linux/flutter/generated_plugins.cmake | 1 - macos/Flutter/GeneratedPluginRegistrant.swift | 4 -- pubspec.lock | 64 ------------------- pubspec.yaml | 4 -- .../flutter/generated_plugin_registrant.cc | 3 - windows/flutter/generated_plugins.cmake | 1 - 10 files changed, 105 deletions(-) diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index 90f423077..4b49aac6b 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -6,7 +6,6 @@ import 'package:fluffychat/pages/invitation_selection/invitation_selection_view. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:hive_flutter/hive_flutter.dart'; import 'package:integration_test/integration_test.dart'; import 'package:fluffychat/main.dart' as app; @@ -28,10 +27,6 @@ void main() { SharedPreferences.setMockInitialValues({ SettingKeys.showNoGoogle: false, }); - try { - Hive.deleteFromDisk(); - Hive.initFlutter(); - } catch (_) {} }, ); diff --git a/lib/pages/homeserver_picker/homeserver_picker.dart b/lib/pages/homeserver_picker/homeserver_picker.dart index 01d3c2184..b17a3bc06 100644 --- a/lib/pages/homeserver_picker/homeserver_picker.dart +++ b/lib/pages/homeserver_picker/homeserver_picker.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:collection/collection.dart'; import 'package:flutter_web_auth_2/flutter_web_auth_2.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive_flutter/hive_flutter.dart'; import 'package:matrix/matrix.dart'; import 'package:universal_html/html.dart' as html; import 'package:url_launcher/url_launcher_string.dart'; @@ -45,17 +44,6 @@ class HomeserverPickerController extends State { Future _checkTorBrowser() async { if (!kIsWeb) return; - Hive.openBox('test').then((value) => null).catchError( - (e, s) async { - await showOkAlertDialog( - context: context, - title: L10n.of(context).indexedDbErrorTitle, - message: L10n.of(context).indexedDbErrorLong, - ); - _checkTorBrowser(); - }, - ); - final isTor = await TorBrowserDetector.isTorBrowser; isTorBrowser = isTor; } diff --git a/lib/utils/client_manager.dart b/lib/utils/client_manager.dart index 25b5af34e..ddda56824 100644 --- a/lib/utils/client_manager.dart +++ b/lib/utils/client_manager.dart @@ -6,10 +6,8 @@ import 'package:collection/collection.dart'; import 'package:desktop_notifications/desktop_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_vodozemac/flutter_vodozemac.dart' as vod; -import 'package:hive_flutter/hive_flutter.dart'; import 'package:matrix/encryption/utils/key_verification.dart'; import 'package:matrix/matrix.dart'; -import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:universal_html/html.dart' as html; @@ -29,11 +27,6 @@ abstract class ClientManager { bool initialize = true, required SharedPreferences store, }) async { - if (PlatformInfos.isLinux) { - Hive.init((await getApplicationSupportDirectory()).path); - } else { - await Hive.initFlutter(); - } final clientNames = {}; try { final clientNamesList = store.getStringList(clientNamespace) ?? []; diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 016e81fd9..f6178cd62 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -45,9 +44,6 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) handy_window_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin"); handy_window_plugin_register_with_registrar(handy_window_registrar); - g_autoptr(FlPluginRegistrar) pasteboard_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin"); - pasteboard_plugin_register_with_registrar(pasteboard_registrar); g_autoptr(FlPluginRegistrar) record_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "RecordLinuxPlugin"); record_linux_plugin_register_with_registrar(record_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index a16d09682..9d145db6f 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -11,7 +11,6 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_webrtc gtk handy_window - pasteboard record_linux sqlcipher_flutter_libs url_launcher_linux diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 016f51cf6..dd7fa9ed5 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -21,12 +21,10 @@ import flutter_webrtc import geolocator_apple import just_audio import package_info_plus -import pasteboard import path_provider_foundation import record_macos import share_plus import shared_preferences_foundation -import sqflite_darwin import sqlcipher_flutter_libs import url_launcher_macos import video_compress @@ -51,12 +49,10 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) RecordMacOsPlugin.register(with: registry.registrar(forPlugin: "RecordMacOsPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) - SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) VideoCompressPlugin.register(with: registry.registrar(forPlugin: "VideoCompressPlugin")) diff --git a/pubspec.lock b/pubspec.lock index ebdd77dac..8d1f6b7de 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -475,14 +475,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_cache_manager: - dependency: "direct main" - description: - name: flutter_cache_manager - sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" - url: "https://pub.dev" - source: hosted - version: "3.4.1" flutter_driver: dependency: transitive description: flutter @@ -871,22 +863,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.1" - hive: - dependency: "direct main" - description: - name: hive - sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" - url: "https://pub.dev" - source: hosted - version: "2.2.3" - hive_flutter: - dependency: "direct main" - description: - name: hive_flutter - sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc - url: "https://pub.dev" - source: hosted - version: "1.1.0" html: dependency: "direct main" description: @@ -1284,14 +1260,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.21.45" - pasteboard: - dependency: "direct main" - description: - name: pasteboard - sha256: "1c8b6a8b3f1d12e55d4e9404433cda1b4abe66db6b17bc2d2fb5965772c04674" - url: "https://pub.dev" - source: hosted - version: "0.2.0" path: dependency: "direct main" description: @@ -1817,22 +1785,6 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" - sqflite: - dependency: transitive - description: - name: sqflite - sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03 - url: "https://pub.dev" - source: hosted - version: "2.4.2" - sqflite_android: - dependency: transitive - description: - name: sqflite_android - sha256: "2b3070c5fa881839f8b402ee4a39c1b4d561704d4ebbbcfb808a119bc2a1701b" - url: "https://pub.dev" - source: hosted - version: "2.4.1" sqflite_common: dependency: transitive description: @@ -1849,22 +1801,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.5" - sqflite_darwin: - dependency: transitive - description: - name: sqflite_darwin - sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" - url: "https://pub.dev" - source: hosted - version: "2.4.2" - sqflite_platform_interface: - dependency: transitive - description: - name: sqflite_platform_interface - sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" - url: "https://pub.dev" - source: hosted - version: "2.4.0" sqlcipher_flutter_libs: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 1b90ee76d..8438c4669 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,6 @@ dependencies: file_selector: ^1.0.3 flutter: sdk: flutter - flutter_cache_manager: ^3.4.1 flutter_foreground_task: ^6.1.3 flutter_highlighter: ^0.1.1 flutter_linkify: ^6.0.0 @@ -50,8 +49,6 @@ dependencies: geolocator: ^13.0.1 go_router: ^15.1.2 handy_window: ^0.4.0 - hive: ^2.2.3 - hive_flutter: ^1.1.0 html: ^0.15.4 http: ^1.2.0 image: ^4.1.7 @@ -65,7 +62,6 @@ dependencies: native_imaging: ^0.2.0 opus_caf_converter_dart: ^1.0.1 package_info_plus: ^8.0.2 - pasteboard: ^0.2.0 path: ^1.9.0 path_provider: ^2.1.2 permission_handler: ^11.0.1 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 7ab3698dc..d083bd166 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -39,8 +38,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FlutterWebRTCPlugin")); GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); - PasteboardPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("PasteboardPlugin")); PermissionHandlerWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); RecordWindowsPluginCApiRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 7e3e64db1..3276ee890 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -11,7 +11,6 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_secure_storage_windows flutter_webrtc geolocator_windows - pasteboard permission_handler_windows record_windows share_plus