nslogx / flutter_easyloading

✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
https://pub.dev/packages/flutter_easyloading
MIT License
1.24k stars 219 forks source link

Multiple widgets used the same GlobalKey. #221

Open daoxingwudao opened 1 year ago

daoxingwudao commented 1 year ago

======== Exception caught by widgets library ======================================================= The following assertion was thrown while finalizing the widget tree: Multiple widgets used the same GlobalKey.

The key [LabeledGlobalKey#c5af6] was used by multiple widgets. The parents of those widgets were different widgets that both had the following description: _EffectiveTickerMode(effective mode: enabled) A GlobalKey can only be specified on one widget at a time in the widget tree. When the exception was thrown, this was the stack:

0 BuildOwner._debugVerifyGlobalKeyReservation... (package:flutter/src/widgets/framework.dart:2883:13)

1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)

2 BuildOwner._debugVerifyGlobalKeyReservation.. (package:flutter/src/widgets/framework.dart:2827:20)

3 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)

4 BuildOwner._debugVerifyGlobalKeyReservation. (package:flutter/src/widgets/framework.dart:2822:36)

5 BuildOwner._debugVerifyGlobalKeyReservation (package:flutter/src/widgets/framework.dart:2891:6)

6 BuildOwner.finalizeTree. (package:flutter/src/widgets/framework.dart:2950:11)

7 BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3032:8)

8 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:885:19)

9 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:378:5)

10 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)

11 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1104:9)

12 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1015:5)

13 _invoke (dart:ui/hooks.dart:148:13)

14 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:318:5)

15 _drawFrame (dart:ui/hooks.dart:115:31)

====================================================================================================

github-actions[bot] commented 1 year ago

Thanks for taking the time to open an issue. I will have a look and answer as soon as possible.