-
Notifications
You must be signed in to change notification settings - Fork 106
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
大佬帮我看看 报了这个错 #39
Comments
@FullChargeComplete |
是的 �我调用了 BotToast.closeAllLoading(); |
可能是toast 已经被close 掉了才报这个错 |
@FullChargeComplete |
|
应该是我的问题 我每次请求会自动 toast 一下 完成都会closeAll ,有没有检查 是否还有toast 存在的方法? |
不知道能不能提供一个能复现的demo? |
import 'package:bot_toast/bot_toast.dart';
bool loading = false;
Set dict = Set();
void beforeRequest(uri, Map<dynamic, dynamic> options) {
dict.add(uri);
if (loading == false) {
showAppLoading(options);
loading = true;
}
}
void afterResponse(uri, Map<dynamic, dynamic> options) {
dict.remove(uri);
if (dict.length == 0 && loading == true) {
BotToast.closeAllLoading();
loading = false;
}
}
/*
* loading: 可配置参数
* requestOrComplete: 是否发送请求或已完成 true表示发送请求需要开启loading,false表示完成请求可关闭loading
*/
void showAppLoading(Map<dynamic, dynamic> options) {
options = {
'text': options['text'] ?? 'loading...'
};
BotToast.showLoading();
} |
这个是我的代码 |
@FullChargeComplete |
对的 经常出现 报这个 |
@FullChargeComplete SchedulerBinding.instance.addPostFrameCallback((_) {
Navigator.pop(context);
}); |
你能尝试把: _map.clear(); |
嗯嗯 谢谢大佬 我试试 |
@FullChargeComplete
|
这个错误本质上应该是和 #43 是一样的 |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! |
flutter: ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
flutter: The following assertion was thrown during a scheduler callback:
flutter: 'package:flutter/src/widgets/overlay.dart': Failed assertion: line 132 pos 12: '_overlay != null':
flutter: is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter: https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2 OverlayEntry.remove (package:flutter/src/widgets/overlay.dart:132:12)
flutter: #3 BotToastManager.removeAll.. (package:bot_toast/src/bot_toast_manager.dart:132:15)
flutter: #4 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
flutter: #5 BotToastManager.removeAll. (package:bot_toast/src/bot_toast_manager.dart:130:23)
flutter: #6 safeRun. (package:bot_toast/src/toast.dart:15:13)
flutter: #7 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
flutter: #8 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1049:9)
flutter: #9 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:957:5)
flutter: #13 _invoke (dart:ui/hooks.dart:259:10)
flutter: #14 _drawFrame (dart:ui/hooks.dart:217:3)
flutter: (elided 5 frames from class _AssertionError and package dart:async)
The text was updated successfully, but these errors were encountered: