mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
* fix: resolve Linux window close handler to prevent app hang - Add delete-event callback that properly quits the application when window is closed * feat: Add desktop scaling and fix linux postinst - Implement desktop interface scaling in main.dart using FittedBox. - Add desktop scaling setting UI. - Add desktopScale to storage preference. - Fix typos and logic in Linux postinst script. - Update piliplus.desktop with StartupWMClass. * update Signed-off-by: dom <githubaccount56556@proton.me> --------- Signed-off-by: Shao Guohao <shao.gh.98@gmail.com> Co-authored-by: dom <githubaccount56556@proton.me>
37 lines
712 B
Dart
37 lines
712 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class StatefulBuilder extends StatefulWidget {
|
|
const StatefulBuilder({
|
|
super.key,
|
|
this.onInit,
|
|
this.onDispose,
|
|
required this.builder,
|
|
});
|
|
|
|
final VoidCallback? onInit;
|
|
|
|
final VoidCallback? onDispose;
|
|
|
|
final StatefulWidgetBuilder builder;
|
|
|
|
@override
|
|
State<StatefulBuilder> createState() => _StatefulBuilderState();
|
|
}
|
|
|
|
class _StatefulBuilderState extends State<StatefulBuilder> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
widget.onInit?.call();
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
widget.onDispose?.call();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) => widget.builder(context, setState);
|
|
}
|