Browse Source

整点对齐,开启之后,当点击倒计时按钮之后,等待当前时间对齐满十分钟,如当前时间 9:13,等到了 9:20 再开始倒计时

heavyrain 3 months ago
parent
commit
0e5700f2ca

+ 1 - 1
analysis_options.yaml

@@ -7,7 +7,7 @@
 
 
 # The following line activates a set of recommended lints for Flutter apps,
 # The following line activates a set of recommended lints for Flutter apps,
 # packages, and plugins designed to encourage good coding practices.
 # packages, and plugins designed to encourage good coding practices.
-include: package:flutter_lints/flutter.yaml
+# include: package:flutter_lints/flutter.yaml
 
 
 linter:
 linter:
   # The lint rules applied to this project can be customized in the
   # The lint rules applied to this project can be customized in the

+ 0 - 15
lib/index_page.dart

@@ -1,5 +1,3 @@
-import 'dart:async';
-import 'dart:math' as math;
 
 
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_clock/pages/alarm_page.dart';
 import 'package:flutter_clock/pages/alarm_page.dart';
@@ -23,9 +21,6 @@ class _IndexPageState extends State<IndexPage>
   late TabController _tabController;
   late TabController _tabController;
   late List<Widget> _tabs;
   late List<Widget> _tabs;
 
 
-  final _utcMidnightRadiansOffset = radiansFromDegrees(-64);
-  static const _secondsInDay = 86400;
-  DateTime _localTime = DateTime.now();
 
 
   @override
   @override
   void initState() {
   void initState() {
@@ -43,8 +38,6 @@ class _IndexPageState extends State<IndexPage>
       Tab(child: Text('Timer', style: TextStyle(fontSize: 16.sp))),
       Tab(child: Text('Timer', style: TextStyle(fontSize: 16.sp))),
     ];
     ];
     
     
-    Timer.periodic(Duration(seconds: 1),
-        (_) => setState(() => _localTime = DateTime.now()));
   }
   }
 
 
   @override
   @override
@@ -90,13 +83,5 @@ class _IndexPageState extends State<IndexPage>
     );
     );
   }
   }
 
 
-  static double radiansFromDegrees(double degrees) => degrees * math.pi / 180;
 
 
-  static double radiansFromTime(DateTime time) {
-    final midnightToday = DateTime(time.year, time.month, time.day);
-    final secondsSinceMidnight = midnightToday.difference(time).inSeconds;
-    final percent = secondsSinceMidnight / _secondsInDay;
-    final degrees = percent * 360;
-    return radiansFromDegrees(degrees);
-  }
 }
 }

+ 5 - 0
lib/model/timer_settings.dart

@@ -5,17 +5,20 @@ class TimerSettings {
   static const String _volumeKey = 'timer_volume';
   static const String _volumeKey = 'timer_volume';
   static const String _vibrateKey = 'timer_vibrate';
   static const String _vibrateKey = 'timer_vibrate';
   static const String _loopKey = 'timer_loop';
   static const String _loopKey = 'timer_loop';
+  static const String _alignToHourKey = 'timer_align_to_hour';
 
 
   String sound; 
   String sound; 
   double volume;
   double volume;
   bool vibrate; // 是否震动
   bool vibrate; // 是否震动
   bool loop;  // 是否循环
   bool loop;  // 是否循环
+  bool alignToHour; // 整点对齐
 
 
   TimerSettings({
   TimerSettings({
     this.sound = 'Dripping',
     this.sound = 'Dripping',
     this.volume = 0.7,
     this.volume = 0.7,
     this.vibrate = true,
     this.vibrate = true,
     this.loop = true,
     this.loop = true,
+    this.alignToHour = false,
   });
   });
 
 
   // Save settings to SharedPreferences
   // Save settings to SharedPreferences
@@ -25,6 +28,7 @@ class TimerSettings {
     await prefs.setDouble(_volumeKey, volume);
     await prefs.setDouble(_volumeKey, volume);
     await prefs.setBool(_vibrateKey, vibrate);
     await prefs.setBool(_vibrateKey, vibrate);
     await prefs.setBool(_loopKey, loop);
     await prefs.setBool(_loopKey, loop);
+    await prefs.setBool(_alignToHourKey, alignToHour);
   }
   }
 
 
   // Load settings from SharedPreferences
   // Load settings from SharedPreferences
@@ -35,6 +39,7 @@ class TimerSettings {
       volume: prefs.getDouble(_volumeKey) ?? 0.7,
       volume: prefs.getDouble(_volumeKey) ?? 0.7,
       vibrate: prefs.getBool(_vibrateKey) ?? true,
       vibrate: prefs.getBool(_vibrateKey) ?? true,
       loop: prefs.getBool(_loopKey) ?? true,
       loop: prefs.getBool(_loopKey) ?? true,
+      alignToHour: prefs.getBool(_alignToHourKey) ?? false,
     );
     );
   }
   }
 }
 }

+ 221 - 18
lib/pages/timer/timer_page.dart

@@ -15,7 +15,7 @@ class TimerPage extends StatefulWidget {
   _TimerPageState createState() => _TimerPageState();
   _TimerPageState createState() => _TimerPageState();
 }
 }
 
 
-enum TimerState { prepare, running, pause, finish }
+enum TimerState { prepare, running, pause, finish, waiting }
 
 
 class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
 class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
   // Timer duration values
   // Timer duration values
@@ -26,6 +26,10 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
   // For timer controller
   // For timer controller
   TimerState timerState = TimerState.prepare;
   TimerState timerState = TimerState.prepare;
   int _remainingSeconds = 0;
   int _remainingSeconds = 0;
+  
+  // Waiting for alignment timer
+  Timer? _alignmentTimer;
+  DateTime? _alignmentTargetTime;
 
 
   // Total timer duration in seconds (for progress calculation)
   // Total timer duration in seconds (for progress calculation)
   int _totalDurationSeconds = 0;
   int _totalDurationSeconds = 0;
@@ -60,6 +64,7 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
   void dispose() {
   void dispose() {
     _audioManager.dispose();
     _audioManager.dispose();
     _backgroundTimerService.dispose();
     _backgroundTimerService.dispose();
+    _alignmentTimer?.cancel();
     if (ScreenManager.isWakeLockEnabled) {
     if (ScreenManager.isWakeLockEnabled) {
       ScreenManager.disableWakeLock();
       ScreenManager.disableWakeLock();
     }
     }
@@ -116,6 +121,62 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
     });
     });
   }
   }
 
 
+  /// Calculate the next 10-minute alignment time
+  DateTime _calculateNextAlignmentTime() {
+    final now = DateTime.now();
+    // 计算下一个整10分钟的时间点
+    int nextMinutes = ((now.minute ~/ 10) + 1) * 10;
+    int nextHour = now.hour;
+    
+    // 处理进位
+    if (nextMinutes >= 60) {
+      nextMinutes = 0;
+      nextHour = (nextHour + 1) % 24;
+    }
+    
+    return DateTime(
+      now.year, 
+      now.month, 
+      now.day, 
+      nextHour, 
+      nextMinutes, 
+      0, 
+      0, 
+      0
+    );
+  }
+  
+  /// Wait until the next 10-minute mark and then start the timer
+  void _startTimerWithAlignment(int totalSeconds) {
+    // 取消任何现有的对齐定时器
+    _alignmentTimer?.cancel();
+    
+    // 计算下一个整10分钟的时间点
+    final alignmentTime = _calculateNextAlignmentTime();
+    _alignmentTargetTime = alignmentTime;
+    
+    // 设置状态为等待
+    setState(() {
+      timerState = TimerState.waiting;
+    });
+    
+    // 计算等待时间(毫秒)
+    final waitDuration = alignmentTime.difference(DateTime.now());
+    
+    // 创建定时器等待到指定时间
+    _alignmentTimer = Timer(waitDuration, () {
+      // 时间到了,启动实际的倒计时
+      setState(() {
+        timerState = TimerState.running;
+        _remainingSeconds = totalSeconds;
+        _totalDurationSeconds = totalSeconds;
+        _alignmentTargetTime = null;
+      });
+      
+      _backgroundTimerService.startTimer(totalSeconds);
+    });
+  }
+
   /// Start a new timer or resume an existing paused timer
   /// Start a new timer or resume an existing paused timer
   void _startTimer(String status) {
   void _startTimer(String status) {
     if (status == "resume") {
     if (status == "resume") {
@@ -132,32 +193,54 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
       // 计算总秒数
       // 计算总秒数
       final totalSeconds = _hourstmp * 3600 + _minutestmp * 60 + _secondstmp;
       final totalSeconds = _hourstmp * 3600 + _minutestmp * 60 + _secondstmp;
       if (totalSeconds <= 0) return;
       if (totalSeconds <= 0) return;
-
-      setState(() {
-        timerState = TimerState.running;
-        _remainingSeconds = totalSeconds;
-        _totalDurationSeconds = totalSeconds;
-      });
-
-      _backgroundTimerService.startTimer(totalSeconds);
+      
+      // 保存选择的时间值
+      _hours = _hourstmp;
+      _minutes = _minutestmp;
+      _seconds = _secondstmp;
+      
+      // 检查是否需要整点对齐
+      if (_settings.alignToHour && _settings.loop && totalSeconds >= 600) { // 只有在循环模式、时间至少10分钟时才启用整点对齐
+        _startTimerWithAlignment(totalSeconds);
+      } else {
+        setState(() {
+          timerState = TimerState.running;
+          _remainingSeconds = totalSeconds;
+          _totalDurationSeconds = totalSeconds;
+        });
+        
+        _backgroundTimerService.startTimer(totalSeconds);
+      }
     } else if (status == "loop") {
     } else if (status == "loop") {
       // 计算总秒数
       // 计算总秒数
       final totalSeconds = _hours * 3600 + _minutes * 60 + _seconds;
       final totalSeconds = _hours * 3600 + _minutes * 60 + _seconds;
       if (totalSeconds <= 0) return;
       if (totalSeconds <= 0) return;
-
-      setState(() {
-        timerState = TimerState.running;
-        _remainingSeconds = totalSeconds;
-        _totalDurationSeconds = totalSeconds;
-      });
-
-      _backgroundTimerService.startTimer(totalSeconds);
+      
+      // 检查是否需要整点对齐
+      if (_settings.alignToHour && _settings.loop && totalSeconds >= 600) { // 只有在循环模式、时间至少10分钟时才启用整点对齐
+        _startTimerWithAlignment(totalSeconds);
+      } else {
+        setState(() {
+          timerState = TimerState.running;
+          _remainingSeconds = totalSeconds;
+          _totalDurationSeconds = totalSeconds;
+        });
+        
+        _backgroundTimerService.startTimer(totalSeconds);
+      }
     }
     }
   }
   }
 
 
   /// Pause the running timer
   /// Pause the running timer
   void _pauseTimer() {
   void _pauseTimer() {
-    _backgroundTimerService.pauseTimer();
+    if (timerState == TimerState.waiting) {
+      // 如果在等待对齐状态,取消等待定时器
+      _alignmentTimer?.cancel();
+      _alignmentTargetTime = null;
+    } else {
+      _backgroundTimerService.pauseTimer();
+    }
+    
     setState(() {
     setState(() {
       timerState = TimerState.pause;
       timerState = TimerState.pause;
     });
     });
@@ -168,6 +251,9 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
     _backgroundTimerService.cancelTimer();
     _backgroundTimerService.cancelTimer();
     _audioManager.stopSound();
     _audioManager.stopSound();
     _audioManager.stopVibration();
     _audioManager.stopVibration();
+    _alignmentTimer?.cancel();
+    _alignmentTargetTime = null;
+    
     setState(() {
     setState(() {
       timerState = TimerState.prepare;
       timerState = TimerState.prepare;
     });
     });
@@ -201,6 +287,22 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
     final secs = seconds % 60;
     final secs = seconds % 60;
     return '${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}:${secs.toString().padLeft(2, '0')}';
     return '${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}:${secs.toString().padLeft(2, '0')}';
   }
   }
+  
+  // 格式化剩余等待时间
+  String _formatWaitingTime() {
+    if (_alignmentTargetTime == null) return "00:00";
+    
+    final now = DateTime.now();
+    final difference = _alignmentTargetTime!.difference(now);
+    
+    // 如果差异为负,说明已经过了目标时间
+    if (difference.isNegative) return "00:00";
+    
+    final minutes = difference.inMinutes;
+    final seconds = difference.inSeconds % 60;
+    
+    return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}';
+  }
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
@@ -310,6 +412,12 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
 
 
   Widget _buildCountdownView() {
   Widget _buildCountdownView() {
     final totalMinutes = _remainingSeconds ~/ 60;
     final totalMinutes = _remainingSeconds ~/ 60;
+    
+    // 如果处于等待整点对齐状态,显示不同的UI
+    if (timerState == TimerState.waiting) {
+      return _buildWaitingForAlignmentView();
+    }
+    
     return Scaffold(
     return Scaffold(
       backgroundColor: Colors.white,
       backgroundColor: Colors.white,
       body: Column(
       body: Column(
@@ -423,6 +531,101 @@ class _TimerPageState extends State<TimerPage> with WidgetsBindingObserver {
       ),
       ),
     );
     );
   }
   }
+  
+  // 构建等待整点对齐的视图
+  Widget _buildWaitingForAlignmentView() {
+    final nextAlignmentTime = _alignmentTargetTime;
+    
+    return Scaffold(
+      backgroundColor: Colors.white,
+      body: Column(
+        mainAxisAlignment: MainAxisAlignment.center,
+        children: [
+          Expanded(
+            child: Center(
+              child: Column(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: [
+                  Container(
+                    width: 300,
+                    height: 300,
+                    decoration: BoxDecoration(
+                      shape: BoxShape.circle,
+                      border: Border.all(
+                        color: Colors.orange.withOpacity(0.3),
+                        width: 3,
+                      ),
+                    ),
+                    child: Stack(
+                      alignment: Alignment.center,
+                      children: [
+                        // 倒计时进度(未开始,显示脉动效果)
+                        SizedBox(
+                          width: 300,
+                          height: 300,
+                          child: CircularProgressIndicator(
+                            value: null, // 显示不确定进度
+                            strokeWidth: 5,
+                            backgroundColor: Colors.grey.withOpacity(0.1),
+                            color: Colors.orange,
+                          ),
+                        ),
+                        // 等待时间显示
+                        Column(
+                          mainAxisAlignment: MainAxisAlignment.center,
+                          children: [
+                            Text(
+                              _formatWaitingTime(),
+                              style: TextStyle(
+                                  fontSize: 40, fontWeight: FontWeight.bold),
+                            ),
+                            Text(
+                              '等待对齐整10分钟',
+                              style: TextStyle(fontSize: 16, color: Colors.grey),
+                            ),
+                            SizedBox(height: 10),
+                            if (nextAlignmentTime != null)
+                              Text(
+                                '将在 ${nextAlignmentTime.hour.toString().padLeft(2, '0')}:${nextAlignmentTime.minute.toString().padLeft(2, '0')} 开始',
+                                style: TextStyle(fontSize: 14, color: Colors.orange),
+                              ),
+                          ],
+                        ),
+                      ],
+                    ),
+                  ),
+                ],
+              ),
+            ),
+          ),
+          Padding(
+            padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 20),
+            child: Row(
+              mainAxisAlignment: MainAxisAlignment.spaceAround,
+              children: [
+                // 唤醒屏幕
+                _buildCircleButton(
+                  Icons.sunny,
+                  Colors.grey[600]!,
+                  () {
+                    ScreenManager.toggleWakeLock();
+                    setState(() {});
+                  },
+                  isActive: ScreenManager.isWakeLockEnabled,
+                ),
+                // 在等待状态只显示取消按钮
+                _buildCircleButton(
+                  Icons.stop,
+                  Colors.red,
+                  () => _resetTimer(),
+                ),
+              ],
+            ),
+          ),
+        ],
+      ),
+    );
+  }
 
 
   Widget _buildCircleButton(IconData icon, Color color, VoidCallback onPressed,
   Widget _buildCircleButton(IconData icon, Color color, VoidCallback onPressed,
       {bool isActive = false}) {
       {bool isActive = false}) {

+ 59 - 0
lib/pages/timer/timer_settings_page.dart

@@ -19,6 +19,7 @@ class _TimerSettingsPageState extends State<TimerSettingsPage> {
   late double _volume;
   late double _volume;
   late bool _vibrate;
   late bool _vibrate;
   late bool _loop;
   late bool _loop;
+  late bool _alignToHour;
 
 
   final List<String> _availableSounds = ['Dripping', 'Alarm', 'Bell'];
   final List<String> _availableSounds = ['Dripping', 'Alarm', 'Bell'];
 
 
@@ -29,6 +30,7 @@ class _TimerSettingsPageState extends State<TimerSettingsPage> {
     _volume = widget.settings.volume;
     _volume = widget.settings.volume;
     _vibrate = widget.settings.vibrate;
     _vibrate = widget.settings.vibrate;
     _loop = widget.settings.loop;
     _loop = widget.settings.loop;
+    _alignToHour = widget.settings.alignToHour;
   }
   }
   
   
   // Save settings
   // Save settings
@@ -38,6 +40,7 @@ class _TimerSettingsPageState extends State<TimerSettingsPage> {
       volume: _volume,
       volume: _volume,
       vibrate: _vibrate,
       vibrate: _vibrate,
       loop: _loop,
       loop: _loop,
+      alignToHour: _alignToHour,
     );
     );
     await updatedSettings.saveSettings();
     await updatedSettings.saveSettings();
     return updatedSettings;
     return updatedSettings;
@@ -75,6 +78,7 @@ class _TimerSettingsPageState extends State<TimerSettingsPage> {
             _buildVolumeSetting(),
             _buildVolumeSetting(),
             _buildVibrateSetting(),
             _buildVibrateSetting(),
             _buildLoopSetting(),
             _buildLoopSetting(),
+            _buildAlignToHourSetting(),
           ],
           ],
         ),
         ),
       ),
       ),
@@ -198,6 +202,10 @@ class _TimerSettingsPageState extends State<TimerSettingsPage> {
                 onChanged: (value) {
                 onChanged: (value) {
                   setState(() {
                   setState(() {
                     _loop = value;
                     _loop = value;
+                    // 如果循环被关闭,也关闭整点对齐
+                    if (!value) {
+                      _alignToHour = false;
+                    }
                   });
                   });
                   _saveSettings();
                   _saveSettings();
                 },
                 },
@@ -209,6 +217,57 @@ class _TimerSettingsPageState extends State<TimerSettingsPage> {
       ],
       ],
     );
     );
   }
   }
+  
+  Widget _buildAlignToHourSetting() {
+    // 只有当倒计时满10分钟且启用了循环倒计时时才启用该选项
+    bool isEnabled = _loop;
+    
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.start,
+      children: [
+        Padding(
+          padding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: [
+              Column(
+                crossAxisAlignment: CrossAxisAlignment.start,
+                children: [
+                  Text(
+                    '整点对齐',
+                    style: TextStyle(
+                      fontSize: 18,
+                      color: isEnabled ? Colors.black : Colors.grey,
+                    ),
+                  ),
+                  Text(
+                    '倒计时将等待整10分钟再开始',
+                    style: TextStyle(
+                      fontSize: 12,
+                      color: Colors.grey,
+                    ),
+                  ),
+                ],
+              ),
+              Switch(
+                value: _alignToHour && isEnabled,
+                activeColor: Colors.orange,
+                onChanged: isEnabled
+                    ? (value) {
+                        setState(() {
+                          _alignToHour = value;
+                        });
+                        _saveSettings();
+                      }
+                    : null,
+              ),
+            ],
+          ),
+        ),
+        Divider(),
+      ],
+    );
+  }
 
 
   void _showSoundPicker() {
   void _showSoundPicker() {
     showModalBottomSheet(
     showModalBottomSheet(

+ 0 - 2
lib/utils/background_timer_service.dart

@@ -3,7 +3,6 @@ import 'dart:isolate';
 import 'dart:ui';
 import 'dart:ui';
 
 
 import 'package:flutter_clock/model/timer_data.dart';
 import 'package:flutter_clock/model/timer_data.dart';
-import 'package:flutter_clock/utils/audio_manager.dart';
 
 
 /// A service to handle background timer operations
 /// A service to handle background timer operations
 class BackgroundTimerService {
 class BackgroundTimerService {
@@ -12,7 +11,6 @@ class BackgroundTimerService {
   // Isolate for background processing
   // Isolate for background processing
   Isolate? _isolate;
   Isolate? _isolate;
   ReceivePort? _receivePort;
   ReceivePort? _receivePort;
-  SendPort? _sendPort;
   
   
   // Callback when timer completes
   // Callback when timer completes
   Function? _onTimerComplete;
   Function? _onTimerComplete;

+ 1 - 1
lib/views/side_menu_item.dart

@@ -42,7 +42,7 @@ class SideMenuItem extends StatelessWidget {
                     SizedBox(width: kDefaultPadding * 0.75),
                     SizedBox(width: kDefaultPadding * 0.75),
                     Text(
                     Text(
                       title,
                       title,
-                      style: Theme.of(context).textTheme.button?.copyWith(
+                      style: Theme.of(context).textTheme.labelLarge?.copyWith(
                             color:
                             color:
                                 (isActive || isHover) ? kTextColor : kGrayColor,
                                 (isActive || isHover) ? kTextColor : kGrayColor,
                           ),
                           ),

+ 8 - 0
linux/flutter/generated_plugin_registrant.cc

@@ -7,9 +7,17 @@
 #include "generated_plugin_registrant.h"
 #include "generated_plugin_registrant.h"
 
 
 #include <audioplayers_linux/audioplayers_linux_plugin.h>
 #include <audioplayers_linux/audioplayers_linux_plugin.h>
+#include <screen_retriever/screen_retriever_plugin.h>
+#include <window_manager/window_manager_plugin.h>
 
 
 void fl_register_plugins(FlPluginRegistry* registry) {
 void fl_register_plugins(FlPluginRegistry* registry) {
   g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
   g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
       fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
       fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
   audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
   audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
+  g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
+      fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
+  screen_retriever_plugin_register_with_registrar(screen_retriever_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);
 }
 }

+ 2 - 0
linux/flutter/generated_plugins.cmake

@@ -4,6 +4,8 @@
 
 
 list(APPEND FLUTTER_PLUGIN_LIST
 list(APPEND FLUTTER_PLUGIN_LIST
   audioplayers_linux
   audioplayers_linux
+  screen_retriever
+  window_manager
 )
 )
 
 
 list(APPEND FLUTTER_FFI_PLUGIN_LIST
 list(APPEND FLUTTER_FFI_PLUGIN_LIST

+ 6 - 0
windows/flutter/generated_plugin_registrant.cc

@@ -7,8 +7,14 @@
 #include "generated_plugin_registrant.h"
 #include "generated_plugin_registrant.h"
 
 
 #include <audioplayers_windows/audioplayers_windows_plugin.h>
 #include <audioplayers_windows/audioplayers_windows_plugin.h>
+#include <screen_retriever/screen_retriever_plugin.h>
+#include <window_manager/window_manager_plugin.h>
 
 
 void RegisterPlugins(flutter::PluginRegistry* registry) {
 void RegisterPlugins(flutter::PluginRegistry* registry) {
   AudioplayersWindowsPluginRegisterWithRegistrar(
   AudioplayersWindowsPluginRegisterWithRegistrar(
       registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
       registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
+  ScreenRetrieverPluginRegisterWithRegistrar(
+      registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));
+  WindowManagerPluginRegisterWithRegistrar(
+      registry->GetRegistrarForPlugin("WindowManagerPlugin"));
 }
 }

+ 2 - 0
windows/flutter/generated_plugins.cmake

@@ -4,6 +4,8 @@
 
 
 list(APPEND FLUTTER_PLUGIN_LIST
 list(APPEND FLUTTER_PLUGIN_LIST
   audioplayers_windows
   audioplayers_windows
+  screen_retriever
+  window_manager
 )
 )
 
 
 list(APPEND FLUTTER_FFI_PLUGIN_LIST
 list(APPEND FLUTTER_FFI_PLUGIN_LIST