基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。
update function getScreenInfo()
WhiteXero7b3fa0eb7042
diff --git a/lib/utils/utils.dart b/lib/utils/utils.dartindex d428109a..506cd702 100644--- a/lib/utils/utils.dart+++ b/lib/utils/utils.dart@@ -10,10 +10,30 @@ import 'package:flutter/services.dart';import 'package:flutter/material.dart';import 'package:path_provider/path_provider.dart';import 'package:kazumi/request/api.dart';+import 'package:screen_pixel/screen_pixel.dart';class Utils {static final Random random = Random();+ static Future<Map<String, double>?> getScreenInfo(BuildContext context) async {+ final screenPixelPlugin = ScreenPixel();+ Map<String, double>? screenResolution;+ final screenRatio = MediaQuery.of(context).devicePixelRatio;+ Map<String, double>? screenInfo = {};++ try {+ screenResolution = await screenPixelPlugin.getResolution();+ screenInfo = {+ 'width': screenResolution['width']!,+ 'height': screenResolution['height']!,+ 'ratio': screenRatio+ };+ } on PlatformException {+ screenInfo = null;+ }+ return screenInfo;+ }+static Future<String> getCookiePath() async {final Directory tempDir = await getApplicationSupportDirectory();final String tempPath = "${tempDir.path}/.plpl/";diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swiftindex 84d071f9..689617b8 100644--- a/macos/Flutter/GeneratedPluginRegistrant.swift+++ b/macos/Flutter/GeneratedPluginRegistrant.swift@@ -12,6 +12,7 @@ import fvpimport package_info_plusimport path_provider_foundationimport screen_brightness_macos+import screen_pixelimport screen_retrieverimport shared_preferences_foundationimport sqflite@@ -29,6 +30,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin"))+ ScreenPixelPlugin.register(with: registry.registrar(forPlugin: "ScreenPixelPlugin"))ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))diff --git a/pubspec.lock b/pubspec.lockindex a9da9484..d9c5e4a8 100644--- a/pubspec.lock+++ b/pubspec.lock@@ -949,6 +949,14 @@ packages:url: "https://pub.dev"source: hostedversion: "0.1.3"+ screen_pixel:+ dependency: "direct main"+ description:+ name: screen_pixel+ sha256: b7310d81d98289ba1d6fb381ec95094b30b43ee1e901fefb65a3cf4de7d77e6b+ url: "https://pub.dev"+ source: hosted+ version: "0.0.3"screen_retriever:dependency: transitivedescription:diff --git a/pubspec.yaml b/pubspec.yamlindex c3ebf00b..0b309d16 100644--- a/pubspec.yaml+++ b/pubspec.yaml@@ -76,6 +76,7 @@ dependencies:webdav_client: ^1.2.2tray_manager: ^0.2.3dlna_dart: ^0.0.8+ screen_pixel: ^0.0.3webview_windows:git:url: https://github.com/Predidit/flutter-webview-windows.gitdiff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.ccindex 43da4f81..e4bafd6d 100644--- a/windows/flutter/generated_plugin_registrant.cc+++ b/windows/flutter/generated_plugin_registrant.cc@@ -10,6 +10,7 @@#include <flutter_volume_controller/flutter_volume_controller_plugin_c_api.h>#include <fvp/fvp_plugin_c_api.h>#include <screen_brightness_windows/screen_brightness_windows_plugin.h>+#include <screen_pixel/screen_pixel_plugin_c_api.h>#include <screen_retriever/screen_retriever_plugin.h>#include <tray_manager/tray_manager_plugin.h>#include <url_launcher_windows/url_launcher_windows.h>@@ -25,6 +26,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {registry->GetRegistrarForPlugin("FvpPluginCApi"));ScreenBrightnessWindowsPluginRegisterWithRegistrar(registry->GetRegistrarForPlugin("ScreenBrightnessWindowsPlugin"));+ ScreenPixelPluginCApiRegisterWithRegistrar(+ registry->GetRegistrarForPlugin("ScreenPixelPluginCApi"));ScreenRetrieverPluginRegisterWithRegistrar(registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));TrayManagerPluginRegisterWithRegistrar(diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmakeindex 3e413b30..95b97016 100644--- a/windows/flutter/generated_plugins.cmake+++ b/windows/flutter/generated_plugins.cmake@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LISTflutter_volume_controllerfvpscreen_brightness_windows+ screen_pixelscreen_retrievertray_managerurl_launcher_windows