mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00

- Split wm_tools into native/web implementations - Split initializers into native/web implementations - Add web stubs for window management functionality - Remove win32_registry dependency from web builds
46 lines
1.0 KiB
Dart
46 lines
1.0 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
class WindowSize {
|
|
final double height;
|
|
final double width;
|
|
final bool maximized;
|
|
|
|
WindowSize({
|
|
required this.height,
|
|
required this.width,
|
|
required this.maximized,
|
|
});
|
|
|
|
factory WindowSize.fromJson(Map<String, dynamic> json) => WindowSize(
|
|
height: json["height"],
|
|
width: json["width"],
|
|
maximized: json["maximized"],
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"height": height,
|
|
"width": width,
|
|
"maximized": maximized,
|
|
};
|
|
}
|
|
|
|
class WindowManagerTools with WidgetsBindingObserver {
|
|
static WindowManagerTools? _instance;
|
|
static WindowManagerTools get instance => _instance!;
|
|
|
|
WindowManagerTools._();
|
|
|
|
static Future<void> initialize() async {
|
|
// Web doesn't need window manager initialization
|
|
_instance = WindowManagerTools._();
|
|
WidgetsBinding.instance.addObserver(instance);
|
|
}
|
|
|
|
Size? _prevSize;
|
|
|
|
@override
|
|
void didChangeMetrics() async {
|
|
super.didChangeMetrics();
|
|
// Web implementation - no window size saving needed
|
|
}
|
|
} |