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 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 saveWindowSize(Size size) async { final SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setDouble(_widthKey, size.width); await prefs.setDouble(_heightKey, size.height); } }