You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code:
_btnController.start();
var logoutData = await HttpService().logOut(api, body);
if (logoutData != null) {
_btnController.stop();
Navigator.of(context)
.pushNamedAndRemoveUntil(LoginScreen.routeName, (route) => false);
}
errors:
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: Bad state: Cannot add new events after calling close
#0 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:243:24) #1 Subject._add (package:rxdart/src/subjects/subject.dart:141:17) #2 Subject.add (package:rxdart/src/subjects/subject.dart:135:5) #3 _StreamSinkWrapper.add (package:rxdart/src/subjects/subject.dart:167:13) #4 RoundedLoadingButtonState._reset (package:rounded_loading_button/rounded_loading_button.dart:305:17)
The text was updated successfully, but these errors were encountered:
Abdullahfoysal
changed the title
Navigator.of(context) .pushNamedAndRemoveUntil(LoginScreen.routeName, (route) => false);Unhandled Exception: Bad state: Cannot add new events after calling close
Unhandled Exception: Bad state: Cannot add new events after calling close
Sep 21, 2021
You would get this error if one of the controller action methods is called after the widget is removed from the stack. My guess in the example would be that the stop() call is probably unnecessary as the widget is removed in the next line.
My code:
_btnController.start();
var logoutData = await HttpService().logOut(api, body);
if (logoutData != null) {
_btnController.stop();
Navigator.of(context)
.pushNamedAndRemoveUntil(LoginScreen.routeName, (route) => false);
}
errors:
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: Bad state: Cannot add new events after calling close
#0 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:243:24)
#1 Subject._add (package:rxdart/src/subjects/subject.dart:141:17)
#2 Subject.add (package:rxdart/src/subjects/subject.dart:135:5)
#3 _StreamSinkWrapper.add (package:rxdart/src/subjects/subject.dart:167:13)
#4 RoundedLoadingButtonState._reset (package:rounded_loading_button/rounded_loading_button.dart:305:17)
The text was updated successfully, but these errors were encountered: