rrousselGit/state_notifier

Use of the Future in the StateNotifier

kmartins opened this issue · 2 comments

When I use the future in StateNotifier and the state is changed with the response this future, but the response arrives after the dispose of the Statenotifier.

Do I have to verify mounted before changed the state always?

Because I'm getting:
Tried to use $runtimeType after `dispose` was called. Consider checking `mounted`.

You should preferably override dispose to cancel pending futures.

Right, but why do not replace assert (_debugIsMounted (), ‘’); for the if (mounted) in the set state?