File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change
1
+ ## [ 0.6.0] - 2022/07/01.
2
+
3
+ * Fix issue #23 .
4
+
1
5
## [ 0.5.0] - 2022/05/16.
2
6
3
7
* Flutter 3.
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class LifecycleObserver extends NavigatorObserver with WidgetsBindingObserver {
13
13
static final List <LifecycleObserver > _cache = [];
14
14
15
15
/// Avoid calling this constructor in [build] method.
16
- /// Call [dispose] when you will never use it .
16
+ /// Call [dispose] when it will never be used, e.g. call it in State#dispose .
17
17
LifecycleObserver () {
18
18
_cache.add (this );
19
19
WidgetsBinding .instance.addObserver (this );
@@ -23,16 +23,12 @@ class LifecycleObserver extends NavigatorObserver with WidgetsBindingObserver {
23
23
@protected
24
24
factory LifecycleObserver .internalGet (BuildContext context) {
25
25
NavigatorState navigator = Navigator .of (context);
26
- LifecycleObserver ? targetObserver;
27
26
for (int i = _cache.length - 1 ; i >= 0 ; i-- ) {
28
27
LifecycleObserver observer = _cache[i];
29
28
if (observer.navigator == navigator) {
30
- targetObserver = observer;
29
+ return observer;
31
30
}
32
31
}
33
- if (targetObserver != null ) {
34
- return targetObserver;
35
- }
36
32
throw Exception (
37
33
'Can not get associated LifecycleObserver, did you forget to register it in MaterialApp or Navigator?' );
38
34
}
Original file line number Diff line number Diff line change 1
1
name : lifecycle
2
2
description : Lifecycle support for Flutter widgets.
3
- version : 0.5 .0
3
+ version : 0.6 .0
4
4
homepage : https://github.com/chenenyu/lifecycle
5
5
6
6
environment :
You can’t perform that action at this time.
0 commit comments