window_manager
window_manager copied to clipboard
[linux] `onWindowResize() ` 死循环
windows 和mac 没有这个报错
但是Linux 一直在执行onWindowResize() 方法, 死循环状态
参考代码:
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:window_manager/window_manager.dart';
class HomePage extends ConsumerStatefulWidget {
const HomePage();
static const name = 'home';
@override
ConsumerState<HomePage> createState() => _HomePageState();
}
class _HomePageState extends ConsumerState<HomePage> with WindowListener {
@override
void initState() {
super.initState();
windowManager.addListener(this);
delayedInit();
}
@override
void dispose() {
windowManager.removeListener(this);
super.dispose();
}
@override
Future<void> onWindowResize() async {
debugPrint('onWindowResize');
}
@override
Widget build(BuildContext context) {
}
}