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

Unhandled exception logged when adding a new project #6

Closed
neilweber opened this issue Oct 30, 2018 · 1 comment
Closed

Unhandled exception logged when adding a new project #6

neilweber opened this issue Oct 30, 2018 · 1 comment

Comments

@neilweber
Copy link

Steps to reproduce:
Open side panel
Expand Projects sublist
Click "Add Project" list entry
Create a new project

The console log displays:
E/flutter (26554): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (26554): Bad state: Cannot add new events after calling close
E/flutter (26554): #0 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:253:24)
E/flutter (26554): #1 _StreamSinkWrapper.add (dart:async/stream_controller.dart:858:13)
E/flutter (26554): #2 ProjectBloc._loadProjects. (package:flutter_app/pages/projects/project_bloc.dart:34:31)
E/flutter (26554): #3 _RootZone.runUnary (dart:async/zone.dart:1379:54)
E/flutter (26554): #4 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
E/flutter (26554): #5 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
E/flutter (26554): #6 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
E/flutter (26554): #7 Future._complete (dart:async/future_impl.dart:476:7)
E/flutter (26554): #8 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
E/flutter (26554): #9 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
E/flutter (26554): #10 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295:13)
E/flutter (26554): #11 ProjectDB.getProjects (package:flutter_app/pages/projects/project_db.dart)
E/flutter (26554):
E/flutter (26554): #12 ProjectBloc._loadProjects (package:flutter_app/pages/projects/project_bloc.dart:33:16)
E/flutter (26554): #13 ProjectBloc.refresh (package:flutter_app/pages/projects/project_bloc.dart:50:5)
E/flutter (26554): #14 ProjectExpansionTileWidget.buildProjects. (package:flutter_app/pages/projects/project_widget.dart:61:21)
E/flutter (26554):
E/flutter (26554): #15 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)

I'm studying this project to learn more about Flutter and using the BLoC pattern. Looking at the onTap() handler (which is somehow causing this exception), it's more complicated than I expected. Can you add some comments about why it's creating a second ProjectBloc object and why it's calling projectBloc.refresh(). IMHO, the point of Flutter and the BLoC pattern was to avoid things like refresh().

@burhanrashid52
Copy link
Owner

Fixed in master

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

2 participants