Add Windows runner files for high DPI support and console output
- Created runner.exe.manifest to enable DPI awareness and dark mode support. - Implemented utility functions in utils.cpp and utils.h for console creation and command line argument handling. - Developed Win32Window class in win32_window.cpp and win32_window.h to manage high DPI-aware windows, including theme updates and message handling.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class WindowStateStore {
|
||||
WindowStateStore._();
|
||||
|
||||
static final WindowStateStore instance = WindowStateStore._();
|
||||
|
||||
static const String _widthKey = 'window_width';
|
||||
static const String _heightKey = 'window_height';
|
||||
|
||||
Future<Size?> loadWindowSize() async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final double? width = prefs.getDouble(_widthKey);
|
||||
final double? height = prefs.getDouble(_heightKey);
|
||||
|
||||
if (width == null || height == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Size(width, height);
|
||||
}
|
||||
|
||||
Future<void> saveWindowSize(Size size) async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setDouble(_widthKey, size.width);
|
||||
await prefs.setDouble(_heightKey, size.height);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user