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

I'm getting error when I was trying to use package with GetX package #7

Closed
AlimFreight opened this issue Feb 7, 2022 · 1 comment
Closed

Comments

@AlimFreight
Copy link

AlimFreight commented Feb 7, 2022

======== Exception caught by widgets library =======================================================
The following assertion was thrown building MainScreen(dirty, dependencies: [FlAppwriteAccountKit]):
setState() or markNeedsBuild() called during build.

This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
The widget on which setState() or markNeedsBuild() was called was: Overlay-[LabeledGlobalKey<OverlayState>#c5b77]
  state: OverlayState#cee5b(entries: [OverlayEntry#62e83(opaque: true; maintainState: false), OverlayEntry#a96c4(opaque: false; maintainState: true), OverlayEntry#82e01(opaque: false; maintainState: false), OverlayEntry#fdc08(opaque: false; maintainState: true)])
The widget which was currently being built when the offending call was made was: MainScreen
  dirty
  dependencies: [FlAppwriteAccountKit]
The relevant error-causing widget was: 
  MainScreen MainScreen:file:///Users/ruslan/StudioProjects/wizard_game/lib/main.dart:20:15
When the exception was thrown, this was the stack: 
#0      Element.markNeedsBuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:4424:11)
#1      Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:4439:6)
#2      State.setState (package:flutter/src/widgets/framework.dart:1141:15)
#3      OverlayState.rearrange (package:flutter/src/widgets/overlay.dart:444:5)
#4      NavigatorState._flushHistoryUpdates (package:flutter/src/widgets/navigator.dart:3950:16)
#5      NavigatorState._pushEntry (package:flutter/src/widgets/navigator.dart:4438:5)
#6      NavigatorState.push (package:flutter/src/widgets/navigator.dart:4366:5)
#7      GetNavigation.to (package:get/get_navigation/src/extension_navigation.dart:522:37)
#8      MainScreen.build (package:wizard_game/app/modules/login/views/main_screen.dart:23:13)
#9      StatelessElement.build (package:flutter/src/widgets/framework.dart:4827:28)
#10     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4754:15)
#11     Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
#12     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4735:5)
#13     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4729:5)
...     Normal element mounting (171 frames)
#184    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790:14)
#185    MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6422:36)
#186    MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6433:32)
...     Normal element mounting (403 frames)
#589    Element.inflateWidget (package:flutter/src/widgets/framework.dart:3790:14)
#590    Element.updateChild (package:flutter/src/widgets/framework.dart:3540:18)
#591    RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1198:16)
#592    RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1167:5)
#593    RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1112:18)
#594    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2600:19)
#595    RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1111:13)
#596    WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:944:7)
#597    WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:924:7)
(elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
====================================================================================================
D/eglCodecCommon(28630): setVertexArrayObject: set vao to 0 (0) 1 0
W/OpenGLRenderer(28630): dequeueBuffer failed, error = -110; switching to fallback
W/Gralloc3(28630): allocator 3.x is not supported
W/OpenGLRenderer(28630): reserveNext failed, error = -2147483648 (Unknown error -2147483648)
D/EGL_emulation(28630): eglMakeCurrent: 0xd541a420: ver 3 0 (tinfo 0xd540fd30)
E/flutter (28630): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 2845 pos 18: '!navigator._debugLocked': is not true.
E/flutter (28630): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter (28630): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter (28630): #2      _RouteEntry.handlePush.<anonymous closure> (package:flutter/src/widgets/navigator.dart:2845:18)
E/flutter (28630): #3      TickerFuture.whenCompleteOrCancel.thunk (package:flutter/src/scheduler/ticker.dart:407:15)
E/flutter (28630): #4      _rootRunUnary (dart:async/zone.dart:1434:47)
E/flutter (28630): #5      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter (28630): <asynchronous suspension>
E/flutter (28630): #6      TickerFuture.whenCompleteOrCancel.thunk (package:flutter/src/scheduler/ticker.dart:406:5)
E/flutter (28630): <asynchronous suspension>
E/flutter (28630): 
I/ght.wizard_gam(28630): WaitForGcToComplete blocked HeapTrim on None for 26.313ms

======== Exception caught by widgets library =======================================================
The following assertion was thrown building MainScreen(dirty, dependencies: [FlAppwriteAccountKit]):
'package:flutter/src/widgets/navigator.dart': Failed assertion: line 4429 pos 12: '!_debugLocked': is not true.



Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md


The relevant error-causing widget was: 
  MainScreen MainScreen:file:///Users/ruslan/StudioProjects/wizard_game/lib/main.dart:20:15
When the exception was thrown, this was the stack: 
#2      NavigatorState._pushEntry (package:flutter/src/widgets/navigator.dart:4429:12)
#3      NavigatorState.push (package:flutter/src/widgets/navigator.dart:4366:5)
#4      GetNavigation.to (package:get/get_navigation/src/extension_navigation.dart:522:37)
#5      MainScreen.build (package:wizard_game/app/modules/login/views/main_screen.dart:15:13)
#6      StatelessElement.build (package:flutter/src/widgets/framework.dart:4827:28)
#7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4754:15)
#8      Element.rebuild (package:flutter/src/widgets/framework.dart:4477:5)
#9      BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2659:19)
#10     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:882:21)
#11     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:363:5)
#12     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#13     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1081:9)
#14     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:995:5)
#18     _invoke (dart:ui/hooks.dart:151:10)
#19     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:308:5)
#20     _drawFrame (dart:ui/hooks.dart:115:31)
(elided 5 frames from class _AssertionError and dart:async)
====================================================================================================

@AlimFreight
Copy link
Author

Sorry it was my mistake.

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

1 participant