Skip to content

Commit 367080a

Browse files
authored
Merge pull request nslogx#171 from hkloudou/develop
3.0.4(flutter 3.0 support)
2 parents 2113c7c + af47677 commit 367080a

File tree

7 files changed

+100
-82
lines changed

7 files changed

+100
-82
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,8 @@ build/
7373
!**/ios/**/default.pbxuser
7474
!**/ios/**/default.perspectivev3
7575
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
76+
77+
78+
# add some ignore
79+
.vscode
80+
pubspec.lock

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [3.0.4] - 2022.05.19
2+
3+
* 🎉 It's support flutter 3.0 and previous version now
4+
* fixed [#169](https://github.com/nslog11/flutter_easyloading/issues/169)
15
## [3.0.3] - 2021.08.31
26

37
* fixed [#126](https://github.com/nslog11/flutter_easyloading/issues/126)

example/pubspec.lock

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,58 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
url: "https://pub.flutter-io.cn"
8+
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.8.1"
10+
version: "2.8.2"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
15-
url: "https://pub.flutter-io.cn"
15+
url: "https://pub.dartlang.org"
1616
source: hosted
1717
version: "2.1.0"
1818
characters:
1919
dependency: transitive
2020
description:
2121
name: characters
22-
url: "https://pub.flutter-io.cn"
22+
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0"
24+
version: "1.2.0"
2525
charcode:
2626
dependency: transitive
2727
description:
2828
name: charcode
29-
url: "https://pub.flutter-io.cn"
29+
url: "https://pub.dartlang.org"
3030
source: hosted
3131
version: "1.3.1"
3232
clock:
3333
dependency: transitive
3434
description:
3535
name: clock
36-
url: "https://pub.flutter-io.cn"
36+
url: "https://pub.dartlang.org"
3737
source: hosted
3838
version: "1.1.0"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
43-
url: "https://pub.flutter-io.cn"
43+
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0"
45+
version: "1.16.0"
4646
cupertino_icons:
4747
dependency: "direct main"
4848
description:
4949
name: cupertino_icons
50-
url: "https://pub.flutter-io.cn"
50+
url: "https://pub.dartlang.org"
5151
source: hosted
5252
version: "0.1.3"
5353
fake_async:
5454
dependency: transitive
5555
description:
5656
name: fake_async
57-
url: "https://pub.flutter-io.cn"
57+
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.2.0"
59+
version: "1.3.0"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -66,16 +66,16 @@ packages:
6666
dependency: "direct main"
6767
description:
6868
name: flutter_easyloading
69-
url: "https://pub.flutter-io.cn"
69+
url: "https://pub.dartlang.org"
7070
source: hosted
71-
version: "3.0.0"
71+
version: "3.0.3"
7272
flutter_spinkit:
7373
dependency: transitive
7474
description:
7575
name: flutter_spinkit
76-
url: "https://pub.flutter-io.cn"
76+
url: "https://pub.dartlang.org"
7777
source: hosted
78-
version: "5.0.0"
78+
version: "5.1.0"
7979
flutter_test:
8080
dependency: "direct dev"
8181
description: flutter
@@ -85,23 +85,30 @@ packages:
8585
dependency: transitive
8686
description:
8787
name: matcher
88-
url: "https://pub.flutter-io.cn"
88+
url: "https://pub.dartlang.org"
89+
source: hosted
90+
version: "0.12.11"
91+
material_color_utilities:
92+
dependency: transitive
93+
description:
94+
name: material_color_utilities
95+
url: "https://pub.dartlang.org"
8996
source: hosted
90-
version: "0.12.10"
97+
version: "0.1.4"
9198
meta:
9299
dependency: transitive
93100
description:
94101
name: meta
95-
url: "https://pub.flutter-io.cn"
102+
url: "https://pub.dartlang.org"
96103
source: hosted
97104
version: "1.7.0"
98105
path:
99106
dependency: transitive
100107
description:
101108
name: path
102-
url: "https://pub.flutter-io.cn"
109+
url: "https://pub.dartlang.org"
103110
source: hosted
104-
version: "1.8.0"
111+
version: "1.8.1"
105112
sky_engine:
106113
dependency: transitive
107114
description: flutter
@@ -111,58 +118,51 @@ packages:
111118
dependency: transitive
112119
description:
113120
name: source_span
114-
url: "https://pub.flutter-io.cn"
121+
url: "https://pub.dartlang.org"
115122
source: hosted
116-
version: "1.8.1"
123+
version: "1.8.2"
117124
stack_trace:
118125
dependency: transitive
119126
description:
120127
name: stack_trace
121-
url: "https://pub.flutter-io.cn"
128+
url: "https://pub.dartlang.org"
122129
source: hosted
123130
version: "1.10.0"
124131
stream_channel:
125132
dependency: transitive
126133
description:
127134
name: stream_channel
128-
url: "https://pub.flutter-io.cn"
135+
url: "https://pub.dartlang.org"
129136
source: hosted
130137
version: "2.1.0"
131138
string_scanner:
132139
dependency: transitive
133140
description:
134141
name: string_scanner
135-
url: "https://pub.flutter-io.cn"
142+
url: "https://pub.dartlang.org"
136143
source: hosted
137144
version: "1.1.0"
138145
term_glyph:
139146
dependency: transitive
140147
description:
141148
name: term_glyph
142-
url: "https://pub.flutter-io.cn"
149+
url: "https://pub.dartlang.org"
143150
source: hosted
144151
version: "1.2.0"
145152
test_api:
146153
dependency: transitive
147154
description:
148155
name: test_api
149-
url: "https://pub.flutter-io.cn"
156+
url: "https://pub.dartlang.org"
150157
source: hosted
151-
version: "0.4.2"
152-
typed_data:
153-
dependency: transitive
154-
description:
155-
name: typed_data
156-
url: "https://pub.flutter-io.cn"
157-
source: hosted
158-
version: "1.3.0"
158+
version: "0.4.9"
159159
vector_math:
160160
dependency: transitive
161161
description:
162162
name: vector_math
163-
url: "https://pub.flutter-io.cn"
163+
url: "https://pub.dartlang.org"
164164
source: hosted
165-
version: "2.1.0"
165+
version: "2.1.2"
166166
sdks:
167-
dart: ">=2.12.0 <3.0.0"
167+
dart: ">=2.17.0-0 <3.0.0"
168168
flutter: ">=2.0.0"

lib/src/widgets/container.dart

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ import 'package:flutter/scheduler.dart';
2828
import '../theme.dart';
2929
import '../easy_loading.dart';
3030

31+
//https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0
32+
T? _ambiguate<T>(T? value) => value;
33+
3134
class EasyLoadingContainer extends StatefulWidget {
3235
final Widget? indicator;
3336
final String? status;
@@ -60,8 +63,9 @@ class EasyLoadingContainerState extends State<EasyLoadingContainer>
6063
late AlignmentGeometry _alignment;
6164
late bool _dismissOnTap, _ignoring;
6265

66+
//https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0
6367
bool get isPersistentCallbacks =>
64-
SchedulerBinding.instance?.schedulerPhase ==
68+
_ambiguate(SchedulerBinding.instance)!.schedulerPhase ==
6569
SchedulerPhase.persistentCallbacks;
6670

6771
@override
@@ -98,8 +102,9 @@ class EasyLoadingContainerState extends State<EasyLoadingContainer>
98102
Future<void> show(bool animation) {
99103
if (isPersistentCallbacks) {
100104
Completer<void> completer = Completer<void>();
101-
SchedulerBinding.instance?.addPostFrameCallback((_) => completer
102-
.complete(_animationController.forward(from: animation ? 0 : 1)));
105+
_ambiguate(SchedulerBinding.instance)!.addPostFrameCallback((_) =>
106+
completer
107+
.complete(_animationController.forward(from: animation ? 0 : 1)));
103108
return completer.future;
104109
} else {
105110
return _animationController.forward(from: animation ? 0 : 1);
@@ -109,8 +114,9 @@ class EasyLoadingContainerState extends State<EasyLoadingContainer>
109114
Future<void> dismiss(bool animation) {
110115
if (isPersistentCallbacks) {
111116
Completer<void> completer = Completer<void>();
112-
SchedulerBinding.instance?.addPostFrameCallback((_) => completer
113-
.complete(_animationController.reverse(from: animation ? 1 : 0)));
117+
_ambiguate(SchedulerBinding.instance)!.addPostFrameCallback((_) =>
118+
completer
119+
.complete(_animationController.reverse(from: animation ? 1 : 0)));
114120
return completer.future;
115121
} else {
116122
return _animationController.reverse(from: animation ? 1 : 0);

lib/src/widgets/overlay_entry.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
import 'package:flutter/material.dart';
2424
import 'package:flutter/scheduler.dart';
2525

26+
//https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0
27+
T? _ambiguate<T>(T? value) => value;
28+
2629
class EasyLoadingOverlayEntry extends OverlayEntry {
2730
final WidgetBuilder builder;
2831

@@ -32,9 +35,9 @@ class EasyLoadingOverlayEntry extends OverlayEntry {
3235

3336
@override
3437
void markNeedsBuild() {
35-
if (SchedulerBinding.instance?.schedulerPhase ==
38+
if (_ambiguate(SchedulerBinding.instance)!.schedulerPhase ==
3639
SchedulerPhase.persistentCallbacks) {
37-
SchedulerBinding.instance?.addPostFrameCallback((_) {
40+
_ambiguate(SchedulerBinding.instance)!.addPostFrameCallback((_) {
3841
super.markNeedsBuild();
3942
});
4043
} else {

0 commit comments

Comments
 (0)