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,63 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:notas/platform/app_platform.dart';
|
||||
import 'package:notas/screens/home_screen.dart';
|
||||
import 'package:notas/theme/app_theme.dart';
|
||||
import 'package:notas/platform/window_state.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
class NotesApp extends StatefulWidget {
|
||||
const NotesApp({super.key});
|
||||
|
||||
@override
|
||||
State<NotesApp> createState() => _NotesAppState();
|
||||
}
|
||||
|
||||
class _NotesAppState extends State<NotesApp> with WindowListener {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (isDesktop) {
|
||||
windowManager.addListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (isDesktop) {
|
||||
windowManager.removeListener(this);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _saveWindowSize() async {
|
||||
if (await windowManager.isFullScreen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (await windowManager.isMaximized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Size currentSize = await windowManager.getSize();
|
||||
await WindowStateStore.instance.saveWindowSize(currentSize);
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowResize() {
|
||||
_saveWindowSize();
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowResized() {
|
||||
_saveWindowSize();
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Mis Notas',
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: AppTheme.theme,
|
||||
home: const HomeScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user