Skip to content

Commit

Permalink
State Unmounted issue on Change in Event Queue
Browse files Browse the repository at this point in the history
  • Loading branch information
jillellamudisurya committed Sep 12, 2024
1 parent 3b2eb2e commit a2bcf15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.4"
version: "1.0.6"
leak_tracker:
dependency: transitive
description:
Expand Down
7 changes: 6 additions & 1 deletion lib/livedata.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
export 'src/livedata.dart'
show LiveData, MutableLiveData, LiveDataObserver, LiveDataBuilder, LiveDataListener;
show
LiveData,
MutableLiveData,
LiveDataObserver,
LiveDataBuilder,
LiveDataListener;
1 change: 1 addition & 0 deletions lib/src/eventqueue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class _EventListenerState<T> extends State<EventListener<T>> {
if (!_handledInitialValue) {
_handledInitialValue = true;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
_onChange(context, widget.eventQueue._nextEvent.value);
});
}
Expand Down

0 comments on commit a2bcf15

Please sign in to comment.