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

BrnBottomWritePicker 调用异常 #240

Closed
MeiChao opened this issue Jun 13, 2022 · 5 comments
Closed

BrnBottomWritePicker 调用异常 #240

MeiChao opened this issue Jun 13, 2022 · 5 comments

Comments

@MeiChao
Copy link

MeiChao commented Jun 13, 2022

问题提交

标题格式:[BUG]:
Unhandled Exception: BrnBottomPickerWidgetState#01adf(tickers: tracking 1 ticker) was disposed with an active Ticker.

内容需包含:

1、BUG 描述

V/AudioManager( 6577): querySoundEffectsEnabled...
W/InputMethodManager( 6577): startInputReason = 3
W/HwRemoteInputMethodManager( 6577): isCasting false because IHwDistributedWindowManager is invalid.
I/InputMethodManager( 6577): showSoftInput
I/InputMethodManager( 6577): showSoftInput
I/AssistStructure( 6577): Flattened final assist data: 492 bytes, containing 1 windows, 3 views
E/flutter ( 6577): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: BrnBottomPickerWidgetState#01adf(tickers: tracking 1 ticker) was disposed with an active Ticker.
E/flutter ( 6577): BrnBottomPickerWidgetState created a Ticker via its TickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. All Tickers must be disposed before calling super.dispose().
E/flutter ( 6577): Tickers used by AnimationControllers should be disposed by calling dispose() on the AnimationController itself. Otherwise, the ticker will leak.
E/flutter ( 6577): The offending ticker was:
E/flutter ( 6577):   _WidgetTicker(created by BrnBottomPickerWidgetState#01adf)
E/flutter ( 6577):   The stack trace when the _WidgetTicker was actually created was:
E/flutter ( 6577):   #0      new Ticker.<anonymous closure> (package:flutter/src/scheduler/ticker.dart:67:40)
E/flutter ( 6577):   #1      new Ticker (package:flutter/src/scheduler/ticker.dart:69:6)
E/flutter ( 6577):   #2      new _WidgetTicker (package:flutter/src/widgets/ticker_provider.dart:385:81)
E/flutter ( 6577):   #3      TickerProviderStateMixin.createTicker (package:flutter/src/widgets/ticker_provider.dart:295:34)
E/flutter ( 6577):   #4      new AnimationController (package:flutter/src/animation/animation_controller.dart:246:21)
E/flutter ( 6577):   #5      BrnBottomPickerWidgetState.initState (package:bruno/src/components/picker/brn_bottom_picker.dart:109:9)
E/flutter ( 6577):   #6      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4893:57)
E/flutter ( 6577):   #7      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729:5)
E/flutter ( 6577):   ...     Normal element mounting (198 frames)
E/flutter ( 6577):   #205    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790:14)
E/flutter ( 6577):   #206    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6422:36)
E/flutter ( 6577):   #207    Element.updateChild (package:flutter/src/widgets/framework.dart:3540:18)
E/flutter ( 6577):   #208    RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5845:32)
E/flutter ( 6577):   #209    MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6445:17)
E/flutter ( 6577):   #210    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #211    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780:16)
E/flutter ( 6577):   #212    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928:11)
E/flutter ( 6577):   #213    Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
E/flutter ( 6577):   #214    StatefulElement.update (package:flutter/src/widgets/framework.dart:4960:5)
E/flutter ( 6577):   #215    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #216    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780:16)
E/flutter ( 6577):   #217    Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
E/flutter ( 6577):   #218    ProxyElement.update (package:flutter/src/widgets/framework.dart:5108:5)
E/flutter ( 6577):   #219    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #220    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780:16)
E/flutter ( 6577):   #221    Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
E/flutter ( 6577):   #222    ProxyElement.update (package:flutter/src/widgets/framework.dart:5108:5)
E/flutter ( 6577):   #223    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:111:11)
E/flutter ( 6577):   #224    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #225    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6291:14)
E/flutter ( 6577):   #226    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #227    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4780:16)
E/flutter ( 6577):   #228    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4928:11)
E/flutter ( 6577):   #229    Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
E/flutter ( 6577):   #230    StatefulElement.update (package:flutter/src/widgets/framework.dart:4960:5)
E/flutter ( 6577):   #231    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #232    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6291:14)
E/flutter ( 6577):   #233    Element.updateChild (package:flutter/src/widgets/framework.dart:3501:15)
E/flutter ( 6577):   #234    Sin

2、复现步骤
BrnBottomWritePicker.show(
context,
title: '这里是标题',
hintText: '请输入',
cancelDismiss: true,
confirmDismiss: false,
onConfirm: (context, string) {
BrnToast.show(string ?? '', context);
return;
},
onCancel: (_) {
Navigator.of(context).pop();
return;
},
defaultText: "",
);

点击空白处关闭弹窗异常

3、期望行为

4、运行环境

  • 运行设备
  • 系统
  • Bruno 版本 ^2.2.0
  • Flutter Doctor 信息

5、附加信息

包括视频、图片等补充信息

@violinday
Copy link
Collaborator

@MeiChao
感谢反馈,我在本地使用 iOS 15.2 模拟器运行【复现步骤】中代码,没有复现这个问题.
可否提供下复现的操作步骤,机型,flutter SDK 等信息。: )

@MeiChao
Copy link
Author

MeiChao commented Jun 24, 2022

@violinday 你好
操作步骤:

BrnBottomWritePicker.show(
context,
title: '这里是标题',
hintText: '请输入',
cancelDismiss: true,
confirmDismiss: false,
onConfirm: (context, string) {
BrnToast.show(string ?? '', context);
return;
},
onCancel: (_) {
Navigator.of(context).pop();
return;
},
defaultText: "",
);

点击BrnBottomWritePicker.show弹窗
关闭点阴影空白处异常

项目中Bruno 版本:
environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
bruno: ^2.2.0

Flutter Doctor 信息:
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.4 21F79 darwin-x64, locale zh-Hans-CN)
• Flutter version 2.10.3 at /Users/cmei/developer/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e9793dee1 (4 months ago), 2022-03-02 11:23:12 -0600
• Engine revision bd539267b4
• Dart version 2.16.1
• DevTools version 2.9.2
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

机型 HUAWEI Mate 20
[✓] Connected device (1 available)
• HMA AL00 (mobile) • 66J5T18B17004744 • android-arm64 • Android 10 (API 29)

@zhoujuanjuan
Copy link
Collaborator

你好,我们努力尝试复现,在相似机型中目前没有发现该问题,该 issue 保留我们将继续观察反馈

@MeiChao
Copy link
Author

MeiChao commented Jul 8, 2022

@zhoujuanjuan 修改建议:

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: BrnBottomPickerWidgetState#5fa81(tickers: tracking 1 ticker) was disposed with an active Ticker.
E/flutter (10682): BrnBottomPickerWidgetState created a Ticker via its TickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. All Tickers must be disposed before calling super.dispose().

Tickers used by AnimationControllers should be disposed by calling dispose() on the AnimationController itself. Otherwise, the ticker will leak.

brn_bottom_picker.dart dispose方法 _controller.dispose(); 要在super.dispose();之前调用

@OverRide
void dispose() {
_controller.dispose();
super.dispose();
}

@zhoujuanjuan
Copy link
Collaborator

已修复,感谢反馈

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

3 participants