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

连续多次打开toast后无法关闭toast #122

Closed
yhz199132 opened this issue Mar 17, 2023 · 6 comments
Closed

连续多次打开toast后无法关闭toast #122

yhz199132 opened this issue Mar 17, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@yhz199132
Copy link

版本信息

  • Flutter版本:[v3.7.7]
  • flutter_smart_dialog版本:[v4.9.0+3]

描述bug/需求

快速的连续多次调用SmartDialog.showToast后,toast会一直显示无法关闭,当displayType为SmartToastType.onlyRefresh时稳定复现。下面是异常信息
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/overlay.dart': Failed assertion: line 164 pos 12: '_overlay != null': is not true.
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2 OverlayEntry.remove (package:flutter/src/widgets/overlay.dart:164:12)
#3 ToastTool.dismiss (package:flutter_smart_dialog/src/custom/toast/toast_tool.dart:29:38)

问题demo

SmartDialog.showToast( '这是toast信息', alignment: alignment ?? Alignment.topCenter, displayTime: const Duration(milliseconds: 1800), displayType: SmartToastType.onlyRefresh, builder: (context) { return ToastView( toastType: toastType, message: message, ); });

@xdd666t xdd666t self-assigned this Mar 17, 2023
@xdd666t xdd666t added the bug Something isn't working label Mar 17, 2023
xdd666t added a commit that referenced this issue Mar 18, 2023
@xdd666t
Copy link
Member

xdd666t commented Mar 18, 2023

  • 这个问题已经解决了哈,更新到新版本试试
dependencies:
  flutter_smart_dialog: ^4.9.0+4

@yhz199132
Copy link
Author

@xdd666t 版本4.9.0+4 无法拉取 pub get 报错 depends on flutter_smart_dialog ^4.9.0+4 which doesn't match any versions, version solving failed.
pub get failed

@xdd666t
Copy link
Member

xdd666t commented Mar 20, 2023

  • 检查下你的写法吧,我这边能拉新版本

image

@yhz199132
Copy link
Author

  • 检查下你的写法吧,我这边能拉新版本

image

确认写法没有问题 ,+3的版本可以正常拉取

错误信息:
Because mobile_client depends on flutter_smart_dialog ^4.9.0+4 which doesn't match any versions, version solving failed.
pub get failed
command: "/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example"
pub env: {
"FLUTTER_ROOT": "/flutter",
"PUB_ENVIRONMENT": "flutter_cli:get",
"PUB_CACHE": "/.pub-cache",
}
exit code: 1

@xdd666t
Copy link
Member

xdd666t commented Mar 20, 2023

按理来说,不会拉不成功的,这个包早就发布成功了

或许可以新建个flutter项目,然后写入这个版本,尝试拉下看看

  • 我感觉可能是缓存的原因,或者代理的原因,或者尝试切换其他的pub代理源

image

@yhz199132
Copy link
Author

按理来说,不会拉不成功的,这个包早就发布成功了

或许可以新建个flutter项目,然后写入这个版本,尝试拉下看看

  • 我感觉可能是缓存的原因,或者代理的原因,或者尝试切换其他的pub代理源

image

确实是pub代理源问题 https://mirror.sjtu.edu.cn/ 可以,https://pub.flutter-io.cn不行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants