Im-Kevin / cool_ui

用flutter实现一些我认为好看的UI控件,有Popover,仿Weui的Toast,自定义键盘
Apache License 2.0
460 stars 74 forks source link

 pub.dev上的0.4.1和github上的代码没同步 #37

Closed gongqinjing closed 4 years ago

gongqinjing commented 4 years ago

导致有两个键盘切换的时候有一系列报错,github上的代码没有问题

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.57. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Im-Kevin commented 4 years ago

请贴一下具体报错信息

gongqinjing commented 4 years ago

═══════ Exception caught by scheduler library ═════════════════════════════════ The following assertion was thrown during a scheduler callback: setState() called after dispose(): KeyboardPageState#836dd(lifecycle state: defunct, not mounted)

This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.

The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree. This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack

0 State.setState.

package:flutter/…/widgets/framework.dart:1112

1 State.setState

package:flutter/…/widgets/framework.dart:1147

2 KeyboardPageState.updateHeight.

package:cool_ui/keyboards/keyboard_manager.dart:424

3 SchedulerBinding._invokeFrameCallback

package:flutter/…/scheduler/binding.dart:1102

4 SchedulerBinding.handleDrawFrame

package:flutter/…/scheduler/binding.dart:1049 ... ═══════════════════════════════════════════════ 用的代码是example ,没有改动

Im-Kevin commented 4 years ago

请查看最新版本