From 6657ff6ebd2b9312e6cbe551d53e773a9e83229f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 20 Dec 2025 13:50:11 +0800 Subject: [PATCH] :lipstick: Better desktop view --- lib/logic/window_helpers.dart | 30 ++ lib/main.dart | 6 + lib/providers/settings_provider.dart | 27 ++ lib/ui/screens/library_screen.dart | 69 ++--- lib/ui/shell.dart | 260 +++++++++++++++++- linux/flutter/generated_plugin_registrant.cc | 8 + linux/flutter/generated_plugins.cmake | 2 + macos/Flutter/GeneratedPluginRegistrant.swift | 4 + macos/Podfile.lock | 12 + pubspec.lock | 48 ++++ pubspec.yaml | 1 + .../flutter/generated_plugin_registrant.cc | 6 + windows/flutter/generated_plugins.cmake | 2 + 13 files changed, 429 insertions(+), 46 deletions(-) create mode 100644 lib/logic/window_helpers.dart diff --git a/lib/logic/window_helpers.dart b/lib/logic/window_helpers.dart new file mode 100644 index 0000000..0e52dd0 --- /dev/null +++ b/lib/logic/window_helpers.dart @@ -0,0 +1,30 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:window_manager/window_manager.dart'; + +Future initializeWindowManager() async { + await windowManager.ensureInitialized(); + + const windowOptions = WindowOptions( + size: Size(1200, 800), + minimumSize: Size(800, 600), + center: true, + backgroundColor: Colors.transparent, + skipTaskbar: false, + titleBarStyle: TitleBarStyle.hidden, + ); + + await windowManager.waitUntilReadyToShow(windowOptions, () async { + await windowManager.show(); + await windowManager.focus(); + }); +} + +bool isDesktopPlatform() { + return !Platform.isIOS && !Platform.isAndroid; +} + +bool isWideScreen(BuildContext context) { + return MediaQuery.of(context).size.width > 900; +} diff --git a/lib/main.dart b/lib/main.dart index 1908bd3..95641c8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:groovybox/logic/audio_handler.dart'; +import 'package:groovybox/logic/window_helpers.dart'; import 'package:groovybox/providers/audio_provider.dart'; import 'package:groovybox/providers/theme_provider.dart'; import 'package:groovybox/ui/shell.dart'; @@ -13,6 +14,11 @@ Future main() async { WidgetsFlutterBinding.ensureInitialized(); MediaKit.ensureInitialized(); + // Initialize window manager for desktop platforms + if (isDesktopPlatform()) { + await initializeWindowManager(); + } + // Initialize AudioService _audioHandler = await audio_service.AudioService.init( builder: () => AudioHandler(), diff --git a/lib/providers/settings_provider.dart b/lib/providers/settings_provider.dart index 598696a..adb5588 100644 --- a/lib/providers/settings_provider.dart +++ b/lib/providers/settings_provider.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -38,6 +40,7 @@ class SettingsState { final LyricsMode lyricsMode; final bool continuePlays; final Set supportedFormats; + final Size? windowSize; const SettingsState({ this.importMode = ImportMode.mixed, @@ -56,6 +59,7 @@ class SettingsState { '.wma', '.opus', }, + this.windowSize, }); SettingsState copyWith({ @@ -66,6 +70,7 @@ class SettingsState { LyricsMode? lyricsMode, bool? continuePlays, Set? supportedFormats, + Size? windowSize, }) { return SettingsState( importMode: importMode ?? this.importMode, @@ -75,6 +80,7 @@ class SettingsState { lyricsMode: lyricsMode ?? this.lyricsMode, continuePlays: continuePlays ?? this.continuePlays, supportedFormats: supportedFormats ?? this.supportedFormats, + windowSize: windowSize ?? this.windowSize, ); } } @@ -87,6 +93,8 @@ class SettingsNotifier extends _$SettingsNotifier { static const String _defaultPlayerScreenKey = 'default_player_screen'; static const String _lyricsModeKey = 'lyrics_mode'; static const String _continuePlaysKey = 'continue_plays'; + static const String _windowWidthKey = 'window_width'; + static const String _windowHeightKey = 'window_height'; @override Future build() async { @@ -108,6 +116,14 @@ class SettingsNotifier extends _$SettingsNotifier { final continuePlays = prefs.getBool(_continuePlaysKey) ?? false; + // Load window size + Size? windowSize; + final windowWidth = prefs.getDouble(_windowWidthKey); + final windowHeight = prefs.getDouble(_windowHeightKey); + if (windowWidth != null && windowHeight != null) { + windowSize = Size(windowWidth, windowHeight); + } + return SettingsState( importMode: importMode, autoScan: autoScan, @@ -115,6 +131,7 @@ class SettingsNotifier extends _$SettingsNotifier { defaultPlayerScreen: defaultPlayerScreen, lyricsMode: lyricsMode, continuePlays: continuePlays, + windowSize: windowSize, ); } @@ -173,6 +190,16 @@ class SettingsNotifier extends _$SettingsNotifier { state = AsyncValue.data(state.value!.copyWith(continuePlays: enabled)); } } + + Future setWindowSize(Size size) async { + final prefs = await SharedPreferences.getInstance(); + await prefs.setDouble(_windowWidthKey, size.width); + await prefs.setDouble(_windowHeightKey, size.height); + + if (state.hasValue) { + state = AsyncValue.data(state.value!.copyWith(windowSize: size)); + } + } } // Convenience providers for specific settings diff --git a/lib/ui/screens/library_screen.dart b/lib/ui/screens/library_screen.dart index e61c1a5..54cb615 100644 --- a/lib/ui/screens/library_screen.dart +++ b/lib/ui/screens/library_screen.dart @@ -80,7 +80,7 @@ class LibraryScreen extends HookConsumerWidget { onPressed: clearSelection, ), title: Text('${selectedTrackIds.value.length} selected'), - backgroundColor: Theme.of(context).primaryColorDark, + backgroundColor: Theme.of(context).colorScheme.primary, actions: [ IconButton( icon: const Icon(Symbols.playlist_add), @@ -110,6 +110,9 @@ class LibraryScreen extends HookConsumerWidget { ], ) : AppBar( + backgroundColor: Theme.of(context).colorScheme.surfaceContainer, + elevation: 0, + scrolledUnderElevation: 0, title: isLargeScreen ? Row( children: [ @@ -187,33 +190,37 @@ class LibraryScreen extends HookConsumerWidget { const Gap(8), ], ), - body: Column( - children: [ - const Divider(height: 1), - Expanded( - child: Row( - children: [ - NavigationRail( - extended: isExtraLargeScreen, - selectedIndex: selectedTab!.value, - onDestinationSelected: (index) => selectedTab.value = index, - destinations: const [ - NavigationRailDestination( - icon: Icon(Symbols.audiotrack), - label: Text('Tracks'), - ), - NavigationRailDestination( - icon: Icon(Symbols.album), - label: Text('Albums'), - ), - NavigationRailDestination( - icon: Icon(Symbols.queue_music), - label: Text('Playlists'), - ), - ], + body: Container( + color: Theme.of(context).colorScheme.surfaceContainer, + child: Row( + children: [ + NavigationRail( + backgroundColor: Colors.transparent, + extended: isExtraLargeScreen, + selectedIndex: selectedTab!.value, + onDestinationSelected: (index) => selectedTab.value = index, + destinations: const [ + NavigationRailDestination( + icon: Icon(Symbols.audiotrack), + label: Text('Tracks'), ), - const VerticalDivider(width: 1), - Expanded( + NavigationRailDestination( + icon: Icon(Symbols.album), + label: Text('Albums'), + ), + NavigationRailDestination( + icon: Icon(Symbols.queue_music), + label: Text('Playlists'), + ), + ], + ), + Expanded( + child: ClipRRect( + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(16), + ), + child: ColoredBox( + color: Theme.of(context).colorScheme.surface, child: _buildTabContent( selectedTab.value, ref, @@ -224,10 +231,10 @@ class LibraryScreen extends HookConsumerWidget { isSelectionMode, ), ), - ], + ), ), - ), - ], + ], + ), ), ); } else { @@ -241,7 +248,7 @@ class LibraryScreen extends HookConsumerWidget { onPressed: clearSelection, ), title: Text('${selectedTrackIds.value.length} selected'), - backgroundColor: Theme.of(context).primaryColorDark, + backgroundColor: Theme.of(context).colorScheme.primary, actions: [ IconButton( icon: const Icon(Symbols.playlist_add), diff --git a/lib/ui/shell.dart b/lib/ui/shell.dart index a6a25f8..1012fe9 100644 --- a/lib/ui/shell.dart +++ b/lib/ui/shell.dart @@ -1,26 +1,256 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:gap/gap.dart'; +import 'package:groovybox/logic/window_helpers.dart'; +import 'package:groovybox/providers/settings_provider.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:material_symbols_icons/symbols.dart'; +import 'package:styled_widget/styled_widget.dart'; +import 'package:window_manager/window_manager.dart'; +import 'dart:io'; import 'screens/library_screen.dart'; import 'widgets/mini_player.dart'; -class Shell extends StatelessWidget { +// Navigation intents and actions +class PopIntent extends Intent { + const PopIntent(); +} + +class PopAction extends Action { + final WidgetRef ref; + + PopAction(this.ref); + + @override + void invoke(PopIntent intent) { + // Handle pop navigation + // Since we don't have a router, we can handle back navigation here if needed + } +} + +// Window management helpers +class _WindowSizeObserver extends WidgetsBindingObserver { + final VoidCallback callback; + + _WindowSizeObserver(this.callback); + + @override + void didChangeMetrics() { + callback(); + } +} + +class _WindowMaximizeListener extends WindowListener { + final ValueNotifier isMaximized; + + _WindowMaximizeListener(this.isMaximized); + + @override + void onWindowMaximize() { + isMaximized.value = true; + } + + @override + void onWindowUnmaximize() { + isMaximized.value = false; + } + + @override + void onWindowRestore() { + isMaximized.value = false; + } +} + +class Shell extends HookConsumerWidget { const Shell({super.key}); @override - Widget build(BuildContext context) { - return const Scaffold( - body: Stack( - children: [ - // Main Content - Positioned.fill( - child: LibraryScreen(), - // Note: LibraryScreen might need padding at bottom to avoid occlusion by mini player - // We can wrap LibraryScreen content or handle it there. - // For now, let's just place it. - ), + Widget build(BuildContext context, WidgetRef ref) { + final isMaximized = useState(false); - // Mini Player - Positioned(left: 0, right: 0, bottom: 0, child: MiniPlayer()), - ], + // Add window resize listener for desktop platforms + useEffect(() { + if (isDesktopPlatform()) { + void saveWindowSize() { + windowManager.getBounds().then((bounds) { + final settingsNotifier = ref.read(settingsProvider.notifier); + settingsNotifier.setWindowSize(bounds.size); + }); + } + + // Save window size when app is about to close + WidgetsBinding.instance.addObserver( + _WindowSizeObserver(saveWindowSize), + ); + + final maximizeListener = _WindowMaximizeListener(isMaximized); + windowManager.addListener(maximizeListener); + windowManager.isMaximized().then((max) => isMaximized.value = max); + + return () { + // Cleanup observer when widget is disposed + WidgetsBinding.instance.removeObserver( + _WindowSizeObserver(saveWindowSize), + ); + windowManager.removeListener(maximizeListener); + }; + } + return null; + }, []); + + final pageActionsButton = [ + IconButton( + icon: Icon(Symbols.home), + onPressed: () => Navigator.of(context).pushAndRemoveUntil( + MaterialPageRoute(builder: (context) => const LibraryScreen()), + (route) => false, + ), + iconSize: 16, + padding: EdgeInsets.all(8), + constraints: BoxConstraints(), + color: Theme.of(context).iconTheme.color, + ), + const Gap(8), + ]; + + if (isDesktopPlatform()) { + return Shortcuts( + shortcuts: { + LogicalKeySet(LogicalKeyboardKey.escape): const PopIntent(), + }, + child: Actions( + actions: >{PopIntent: PopAction(ref)}, + child: Material( + color: Theme.of(context).colorScheme.surfaceContainer, + child: Stack( + fit: StackFit.expand, + children: [ + Column( + children: [ + DragToMoveArea( + child: Platform.isMacOS + ? Stack( + alignment: Alignment.center, + children: [ + if (isWideScreen(context)) + Row( + children: [ + const Spacer(), + ...pageActionsButton, + ], + ) + else + SizedBox(height: 32), + Text( + 'GroovyBox', + textAlign: TextAlign.center, + style: TextStyle( + color: Theme.of( + context, + ).colorScheme.onSurface, + ), + ), + ], + ) + : Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Row( + children: [ + Image.asset( + Theme.of(context).brightness == + Brightness.dark + ? 'assets/images/icon-dark.png' + : 'assets/images/icon.jpg', + width: 20, + height: 20, + ), + const SizedBox(width: 8), + Text( + 'GroovyBox', + textAlign: TextAlign.start, + ), + ], + ).padding(horizontal: 12, vertical: 5), + ), + ...pageActionsButton, + IconButton( + icon: Icon(Symbols.minimize), + onPressed: () => windowManager.minimize(), + iconSize: 16, + padding: EdgeInsets.all(8), + constraints: BoxConstraints(), + color: Theme.of(context).iconTheme.color, + ), + IconButton( + icon: Icon( + isMaximized.value + ? Symbols.fullscreen_exit + : Symbols.fullscreen, + ), + onPressed: () async { + if (await windowManager.isMaximized()) { + windowManager.restore(); + } else { + windowManager.maximize(); + } + }, + iconSize: 16, + padding: EdgeInsets.all(8), + constraints: BoxConstraints(), + color: Theme.of(context).iconTheme.color, + ), + IconButton( + icon: Icon(Symbols.close), + onPressed: () => windowManager.hide(), + iconSize: 16, + padding: EdgeInsets.all(8), + constraints: BoxConstraints(), + color: Theme.of(context).iconTheme.color, + ), + ], + ), + ), + Expanded( + child: Stack( + children: [ + // Main Content + Positioned.fill(child: LibraryScreen()), + // Mini Player + Positioned( + left: 0, + right: 0, + bottom: 0, + child: MiniPlayer(), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } + + return Shortcuts( + shortcuts: { + LogicalKeySet(LogicalKeyboardKey.escape): const PopIntent(), + }, + child: Actions( + actions: >{PopIntent: PopAction(ref)}, + child: Stack( + fit: StackFit.expand, + children: [ + Positioned.fill(child: LibraryScreen()), + Positioned(left: 0, right: 0, bottom: 0, child: MiniPlayer()), + ], + ), ), ); } diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 7529e35..22aaa19 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -8,7 +8,9 @@ #include #include +#include #include +#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) flutter_media_metadata_registrar = @@ -17,7 +19,13 @@ void fl_register_plugins(FlPluginRegistry* registry) { 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); + g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); + screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin"); sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar); + g_autoptr(FlPluginRegistrar) window_manager_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin"); + window_manager_plugin_register_with_registrar(window_manager_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index cfab8d0..ce8853a 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -5,7 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_media_metadata media_kit_libs_linux + screen_retriever_linux sqlite3_flutter_libs + window_manager ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index efa3637..111eb8d 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -11,9 +11,11 @@ import file_picker import flutter_media_metadata import media_kit_libs_macos_audio import path_provider_foundation +import screen_retriever_macos import shared_preferences_foundation import sqflite_darwin import sqlite3_flutter_libs +import window_manager func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioServicePlugin.register(with: registry.registrar(forPlugin: "AudioServicePlugin")) @@ -22,7 +24,9 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FlutterMediaMetadataPlugin.register(with: registry.registrar(forPlugin: "FlutterMediaMetadataPlugin")) MediaKitLibsMacosAudioPlugin.register(with: registry.registrar(forPlugin: "MediaKitLibsMacosAudioPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) + WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) } diff --git a/macos/Podfile.lock b/macos/Podfile.lock index e7104d3..cac0ae8 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -14,6 +14,8 @@ PODS: - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS + - screen_retriever_macos (0.0.1): + - FlutterMacOS - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS @@ -45,6 +47,8 @@ PODS: - sqlite3/perf-threadsafe - sqlite3/rtree - sqlite3/session + - window_manager (0.5.0): + - FlutterMacOS DEPENDENCIES: - audio_service (from `Flutter/ephemeral/.symlinks/plugins/audio_service/darwin`) @@ -54,9 +58,11 @@ DEPENDENCIES: - FlutterMacOS (from `Flutter/ephemeral`) - media_kit_libs_macos_audio (from `Flutter/ephemeral/.symlinks/plugins/media_kit_libs_macos_audio/macos`) - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`) - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`) + - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`) SPEC REPOS: trunk: @@ -77,12 +83,16 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/media_kit_libs_macos_audio/macos path_provider_foundation: :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + screen_retriever_macos: + :path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos shared_preferences_foundation: :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin sqflite_darwin: :path: Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin sqlite3_flutter_libs: :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin + window_manager: + :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos SPEC CHECKSUMS: audio_service: aa99a6ba2ae7565996015322b0bb024e1d25c6fd @@ -92,10 +102,12 @@ SPEC CHECKSUMS: FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 media_kit_libs_macos_audio: 06f3cf88d6d89c7c3c87eae57689d1c6adb335b2 path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880 + screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 sqlite3: 8d708bc63e9f4ce48f0ad9d6269e478c5ced1d9b sqlite3_flutter_libs: d13b8b3003f18f596e542bcb9482d105577eff41 + window_manager: b729e31d38fb04905235df9ea896128991cad99e PODFILE CHECKSUM: 54d867c82ac51cbd61b565781b9fada492027009 diff --git a/pubspec.lock b/pubspec.lock index c4fb9f9..2f12ac4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -984,6 +984,46 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + screen_retriever: + dependency: transitive + description: + name: screen_retriever + sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_linux: + dependency: transitive + description: + name: screen_retriever_linux + sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_macos: + dependency: transitive + description: + name: screen_retriever_macos + sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_platform_interface: + dependency: transitive + description: + name: screen_retriever_platform_interface + sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_windows: + dependency: transitive + description: + name: screen_retriever_windows + sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" + url: "https://pub.dev" + source: hosted + version: "0.2.0" shared_preferences: dependency: "direct main" description: @@ -1373,6 +1413,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.15.0" + window_manager: + dependency: "direct main" + description: + name: window_manager + sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd" + url: "https://pub.dev" + source: hosted + version: "0.5.1" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index affadf4..b5dc902 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,7 @@ dependencies: cached_network_image: ^3.4.1 flutter_cache_manager: ^3.4.1 material_symbols_icons: ^4.2892.0 + window_manager: ^0.5.1 dev_dependencies: flutter_test: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 5d701b7..ae0d1fe 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -8,13 +8,19 @@ #include #include +#include #include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { FlutterMediaMetadataPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterMediaMetadataPlugin")); MediaKitLibsWindowsAudioPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("MediaKitLibsWindowsAudioPluginCApi")); + ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); Sqlite3FlutterLibsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("Sqlite3FlutterLibsPlugin")); + WindowManagerPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("WindowManagerPlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 022bf00..a67d5e7 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -5,7 +5,9 @@ list(APPEND FLUTTER_PLUGIN_LIST flutter_media_metadata media_kit_libs_windows_audio + screen_retriever_windows sqlite3_flutter_libs + window_manager ) list(APPEND FLUTTER_FFI_PLUGIN_LIST