Couple of hour I have been struggling with this issue. There are some solution for BLoC and StreamController but there is no proper solution for GetX.
As their suggestion from BloC answer, I got an idea that, it might be related to GetXController dispose. Then I apply dispose() method for controller in my page where I initialized the user_controller. But still having the error like below
Unhandled Exception: 'package:get/get_rx/src/rx_stream/get_stream.dart': Failed assertion: line 90 pos 12: '!isClosed': You cannot add event to closed Stream
E/flutter (21576): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
E/flutter (21576): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
E/flutter (21576): #2 GetStream.add (package:get/get_rx/src/rx_stream/get_stream.dart:90:12)
E/flutter (21576): #3 NotifyManager.addListener.<anonymous closure> (package:get/get_rx/src/rx_types/rx_core/rx_impl.dart:139:15)
E/flutter (21576): #4 GetStream._notifyData (package:get/get_rx/src/rx_stream/get_stream.dart:47:21)
E/flutter (21576): #5 GetStream.add (package:get/get_rx/src/rx_stream/get_stream.dart:92:5)
E/flutter (21576): #6 RxObjectMixin.value= (package:get/get_rx/src/rx_types/rx_core/rx_impl.dart:101:13)
E/flutter (21576): #7 UserController.getUserData (package:hellobabybox/controllers/user_controller.dart:20:12)
Thanks in Advance
question from:
https://stackoverflow.com/questions/66064080/flutter-getxcontroller-unhandled-exception-isclosed-you-cannot-add-event 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…