Skip to content

Commit

Permalink
更新包版本
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyaocz committed May 28, 2024
1 parent 2b400ca commit 464439f
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 27 deletions.
13 changes: 6 additions & 7 deletions simple_live_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void main() async {
await migrateData();
await initWindow();
MediaKit.ensureInitialized();
await migrateData();
await Hive.initFlutter(
(!Platform.isAndroid && !Platform.isIOS)
? (await getApplicationSupportDirectory()).path
Expand Down Expand Up @@ -157,9 +156,8 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
bool isDynamicColor = Get.find<AppSettingsController>().isDynamic.value;
Color styleColor =
Color(Get.find<AppSettingsController>().styleColor.value);
bool isDynamicColor = AppSettingsController.instance.isDynamic.value;
Color styleColor = Color(AppSettingsController.instance.styleColor.value);
return DynamicColorBuilder(
builder: ((ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
ColorScheme? lightColorScheme;
Expand Down Expand Up @@ -226,10 +224,11 @@ class MyApp extends StatelessWidget {
},
),
},
child: RawKeyboardListener(
child: KeyboardListener(
focusNode: FocusNode(),
onKey: (RawKeyEvent event) async {
if (event.logicalKey == LogicalKeyboardKey.escape) {
onKeyEvent: (KeyEvent event) async {
if (event is KeyDownEvent &&
event.logicalKey == LogicalKeyboardKey.escape) {
// ESC退出全屏
// 如果处于全屏状态,退出全屏
if (!Platform.isAndroid && !Platform.isIOS) {
Expand Down
4 changes: 4 additions & 0 deletions simple_live_app/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@

#include "generated_plugin_registrant.h"

#include <dynamic_color/dynamic_color_plugin.h>
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
#include <media_kit_video/media_kit_video_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
Expand Down
1 change: 1 addition & 0 deletions simple_live_app/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
media_kit_libs_linux
media_kit_video
screen_retriever
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
import FlutterMacOS
import Foundation

import connectivity_plus
import device_info_plus
import dynamic_color
import media_kit_libs_macos_video
import media_kit_video
import network_info_plus
import package_info_plus
import path_provider_foundation
import screen_brightness_macos
Expand All @@ -18,10 +21,13 @@ import wakelock_plus
import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
MediaKitLibsMacosVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitLibsMacosVideoPlugin"))
MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
ScreenBrightnessMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenBrightnessMacosPlugin"))
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
Expand Down
34 changes: 16 additions & 18 deletions simple_live_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:

# 框架、工具
get: ^4.6.6 #状态管理、路由管理、国际化
dio: ^5.3.2 #网络请求
dio: ^5.4.3+1 #网络请求
hive: 2.2.3 #持久化存储
hive_flutter: 1.1.0 #持久化存储
logger: ^2.0.2 #日志
Expand All @@ -26,7 +26,7 @@ dependencies:
uuid: ^4.3.3 #UUID

#Widget
flutter_staggered_grid_view: ^0.6.2 #瀑布流/GridView
flutter_staggered_grid_view: ^0.7.0 #瀑布流/GridView
flutter_easyrefresh: 2.2.2 #下拉刷新、上拉加载
extended_image: ^8.2.0 #拓展Image,支持缓存
flutter_smart_dialog: ^4.9.2 #各种弹窗 Toast/Dialog/Popup
Expand All @@ -39,23 +39,23 @@ dependencies:


#系统交互
package_info_plus: ^4.0.2 #包信息
device_info_plus: ^9.0.2 #设备信息
url_launcher: ^6.1.11 #打开链接
share_plus: ^7.0.2 #分享
path_provider: ^2.0.15 #常用路径
cross_file: ^0.3.3+4 #跨平台文件
permission_handler: ^10.3.0 #权限处理
image_gallery_saver: ^2.0.2 #图片保存到相册
package_info_plus: ^8.0.0 #包信息
device_info_plus: ^10.1.0 #设备信息
url_launcher: ^6.2.6 #打开链接
share_plus: ^9.0.0 #分享
path_provider: ^2.1.3 #常用路径
cross_file: ^0.3.4+1 #跨平台文件
permission_handler: ^11.3.1 #权限处理
image_gallery_saver: ^2.0.3 #图片保存到相册
perfect_volume_control: ^1.0.5 #音量控制
screen_brightness: ^0.2.2+1 #亮度控制
auto_orientation: ^2.3.1 #屏幕方向
wakelock_plus: ^1.1.1 #屏幕常亮
file_picker: ^5.3.3 #文件选择
window_manager: ^0.3.7 #窗口管理
wakelock_plus: ^1.2.5 #屏幕常亮
file_picker: ^8.0.3 #文件选择
window_manager: ^0.3.9 #窗口管理
floating: ^2.0.1 #PIP画中画
flutter_inappwebview: ^5.8.0 #WebView
connectivity_plus: ^5.0.2 #网络状态
connectivity_plus: ^6.0.3 #网络状态
qr_code_scanner: ^1.0.1 #二维码扫描

# 网络相关
Expand All @@ -64,17 +64,15 @@ dependencies:
network_info_plus: 3.0.5

# 视频播放
media_kit: ^1.1.10
media_kit: ^1.1.10+1
media_kit_video: ^1.2.4
media_kit_libs_video: ^1.0.4

flutter:
sdk: flutter
flutter_localizations:
sdk: flutter

dependency_overrides:
win32: 3.1.4


dev_dependencies:
flutter_lints: ^2.0.0
Expand Down
7 changes: 6 additions & 1 deletion simple_live_app/windows/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")

# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()

# === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")

Expand Down Expand Up @@ -92,7 +97,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

#include "generated_plugin_registrant.h"

#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <media_kit_libs_windows_video/media_kit_libs_windows_video_plugin_c_api.h>
#include <media_kit_video/media_kit_video_plugin_c_api.h>
#include <network_info_plus/network_info_plus_windows_plugin.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <screen_brightness_windows/screen_brightness_windows_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
Expand All @@ -16,10 +19,16 @@
#include <window_manager/window_manager_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitLibsWindowsVideoPluginCApi"));
MediaKitVideoPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi"));
NetworkInfoPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("NetworkInfoPlusWindowsPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
ScreenBrightnessWindowsPluginRegisterWithRegistrar(
Expand Down
3 changes: 3 additions & 0 deletions simple_live_app/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
connectivity_plus
dynamic_color
media_kit_libs_windows_video
media_kit_video
network_info_plus
permission_handler_windows
screen_brightness_windows
screen_retriever
Expand Down

0 comments on commit 464439f

Please sign in to comment.