Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linux] onWindowResize() 死循环 #427

Open
110 opened this issue Dec 23, 2023 · 0 comments
Open

[linux] onWindowResize() 死循环 #427

110 opened this issue Dec 23, 2023 · 0 comments

Comments

@110
Copy link

110 commented Dec 23, 2023

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) {
 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant