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

Exception thrown when logging out #319

Closed
giano574 opened this issue Mar 4, 2020 · 0 comments · Fixed by #337
Closed

Exception thrown when logging out #319

giano574 opened this issue Mar 4, 2020 · 0 comments · Fixed by #337
Assignees
Labels
Priority: medium Medium priority, it's neither high nor low priority Type: bug Bugs and other insects
Milestone

Comments

@giano574
Copy link
Contributor

giano574 commented Mar 4, 2020

Describe the bug
When logging out, setState() or markNeedsBuild() is called during build, which throws an exception. Seems to be caused by using a wrong context.
Also see bug report #185.

To Reproduce
Steps to reproduce the behavior:

  1. Start app.
  2. Log in.
  3. Press log out icon.
  4. Press 'Log ud'.

Expected behavior
No exceptions should be thrown.

Actual behavior
Manual 'stack trace':

#1 _authBlock.logout()                                      lib/blocs/toolbar_bloc.dart:334
#2 _api.account.logout()                                    lib/blocs/auth_bloc.dart:64
#3 _api.account.logout().listen()                           lib/blocs/auth_bloc.dart:64
#4 _loggedIn.add(false)                                     lib/blocs/auth_bloc.dart:65
#5 Routes.goHome(context)                                   lib/main.dart:52
#6 Navigator.of(context).popUntil((Route<dynamic> route)    lib/routes.dart:21
Exception caught by animation library
════════ Exception caught by animation library ═════════════════════════════════
The following assertion was thrown while notifying status listeners for AnimationController:
setState() or markNeedsBuild() called during build.

This _ModalScope<Center> 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: _ModalScope<Center>-[LabeledGlobalKey<_ModalScopeState<Center>>#4e5f0]
    state: _ModalScopeState<Center>#5c0d1
The widget which was currently being built when the offending call was made was: StreamBuilder<bool>
    dirty
    state: _StreamBuilderBaseState<bool, AsyncSnapshot<bool>>#9b86b
When the exception was thrown, this was the stack
#0      Element.markNeedsBuild.<anonymous closure> 
package:flutter/…/widgets/framework.dart:3896
#1      Element.markNeedsBuild 
package:flutter/…/widgets/framework.dart:3911
#2      State.setState 
package:flutter/…/widgets/framework.dart:1168
#3      _ModalScopeState._routeSetState 
package:flutter/…/widgets/routes.dart:664
#4      ModalRoute.setState 
package:flutter/…/widgets/routes.dart:784
...
The AnimationController notifying status listeners was: AnimationController#19fed(◀ 1.000; for _DialogRoute<Center>)

Screenshots
N/A.

Environment
N/A.

Additional context
N/A.

@giano574 giano574 added the Type: bug Bugs and other insects label Mar 4, 2020
@Lortemanden Lortemanden added the Priority: medium Medium priority, it's neither high nor low priority label Mar 9, 2020
@Lortemanden Lortemanden added this to To do in 2020f 1. sprint via automation Mar 9, 2020
@Lortemanden Lortemanden added this to the 2020S1 milestone Mar 9, 2020
@Lortemanden Lortemanden moved this from To do to Issues in progress in 2020f 1. sprint Mar 12, 2020
@antonhpalmer antonhpalmer linked a pull request Mar 18, 2020 that will close this issue
2020f 1. sprint automation moved this from Issues in progress to Issues done Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: medium Medium priority, it's neither high nor low priority Type: bug Bugs and other insects
Projects
No open projects
2020f 1. sprint
  
Issues done
Development

Successfully merging a pull request may close this issue.

9 participants