fix: ScrollContext.storageContext时element可能已经unmounted #510
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在某些情况下可能会出现下面的异常:
I/flutter ( 7932): Another exception was thrown: This widget has been unmounted, so the State no longer has a context (and should be considered defunct).
E/flutter ( 7932): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: This widget has been unmounted, so the State no longer has a context (and should be considered defunct).
E/flutter ( 7932): Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.
E/flutter ( 7932): #0 State.context. (package:flutter/src/widgets/framework.dart:909:9)
E/flutter ( 7932): #1 State.context (package:flutter/src/widgets/framework.dart:915:6)
E/flutter ( 7932): #2 ScrollableState.storageContext (package:flutter/src/widgets/scrollable.dart:620:38)
E/flutter ( 7932): #3 RefreshPhysics.createBallisticSimulation (package:pull_to_refresh/src/internals/refresh_physics.dart:268:52)