Skip to content

Commit 1107bac

Browse files
committed
🎉 It's support Null Safety now
1 parent bc6eee8 commit 1107bac

21 files changed

+295
-407
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [3.0.0] - 2021.03.12
2+
3+
* 🎉 It's support Null Safety now
4+
15
## [2.2.2] - 2020.12.28
26

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

README-zh_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
```yaml
1818
dependencies:
19-
flutter_easyloading: ^2.2.2
19+
flutter_easyloading: ^3.0.0
2020
```
2121
2222
## 导入

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add this to your package's `pubspec.yaml` file:
1616

1717
```yaml
1818
dependencies:
19-
flutter_easyloading: ^2.2.2
19+
flutter_easyloading: ^3.0.0
2020
```
2121
2222
## Import

example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/custom_animation.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ class CustomAnimation extends EasyLoadingAnimation {
1010
AnimationController controller,
1111
AlignmentGeometry alignment,
1212
) {
13-
double opacity = controller?.value ?? 0;
1413
return Opacity(
15-
opacity: opacity,
14+
opacity: controller.value,
1615
child: RotationTransition(
1716
turns: controller,
1817
child: child,

example/lib/main.dart

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ class MyApp extends StatelessWidget {
4646
}
4747

4848
class MyHomePage extends StatefulWidget {
49-
MyHomePage({Key key, this.title}) : super(key: key);
49+
MyHomePage({Key? key, this.title}) : super(key: key);
5050

51-
final String title;
51+
final String? title;
5252

5353
@override
5454
_MyHomePageState createState() => _MyHomePageState();
5555
}
5656

5757
class _MyHomePageState extends State<MyHomePage> {
58-
Timer _timer;
59-
double _progress;
58+
Timer? _timer;
59+
late double _progress;
6060

6161
@override
6262
void initState() {
@@ -75,7 +75,7 @@ class _MyHomePageState extends State<MyHomePage> {
7575
Widget build(BuildContext context) {
7676
return Scaffold(
7777
appBar: AppBar(
78-
title: Text(widget.title),
78+
title: Text(widget.title ?? ''),
7979
),
8080
body: Container(
8181
width: MediaQuery.of(context).size.width,
@@ -89,8 +89,7 @@ class _MyHomePageState extends State<MyHomePage> {
8989
runAlignment: WrapAlignment.center,
9090
crossAxisAlignment: WrapCrossAlignment.center,
9191
children: <Widget>[
92-
FlatButton(
93-
textColor: Colors.blue,
92+
TextButton(
9493
child: Text('open test page'),
9594
onPressed: () {
9695
_timer?.cancel();
@@ -102,17 +101,15 @@ class _MyHomePageState extends State<MyHomePage> {
102101
);
103102
},
104103
),
105-
FlatButton(
106-
textColor: Colors.blue,
104+
TextButton(
107105
child: Text('dismiss'),
108106
onPressed: () async {
109107
_timer?.cancel();
110108
await EasyLoading.dismiss();
111109
print('EasyLoading dismiss');
112110
},
113111
),
114-
FlatButton(
115-
textColor: Colors.blue,
112+
TextButton(
116113
child: Text('show'),
117114
onPressed: () async {
118115
_timer?.cancel();
@@ -123,8 +120,7 @@ class _MyHomePageState extends State<MyHomePage> {
123120
print('EasyLoading show');
124121
},
125122
),
126-
FlatButton(
127-
textColor: Colors.blue,
123+
TextButton(
128124
child: Text('showToast'),
129125
onPressed: () {
130126
_timer?.cancel();
@@ -133,33 +129,29 @@ class _MyHomePageState extends State<MyHomePage> {
133129
);
134130
},
135131
),
136-
FlatButton(
137-
textColor: Colors.blue,
132+
TextButton(
138133
child: Text('showSuccess'),
139134
onPressed: () async {
140135
_timer?.cancel();
141136
await EasyLoading.showSuccess('Great Success!');
142137
print('EasyLoading showSuccess');
143138
},
144139
),
145-
FlatButton(
146-
textColor: Colors.blue,
140+
TextButton(
147141
child: Text('showError'),
148142
onPressed: () {
149143
_timer?.cancel();
150144
EasyLoading.showError('Failed with Error');
151145
},
152146
),
153-
FlatButton(
154-
textColor: Colors.blue,
147+
TextButton(
155148
child: Text('showInfo'),
156149
onPressed: () {
157150
_timer?.cancel();
158151
EasyLoading.showInfo('Useful Information.');
159152
},
160153
),
161-
FlatButton(
162-
textColor: Colors.blue,
154+
TextButton(
163155
child: Text('showProgress'),
164156
onPressed: () {
165157
_progress = 0;

example/lib/test.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/material.dart';
24
import 'package:flutter_easyloading/flutter_easyloading.dart';
3-
import 'package:dio/dio.dart';
45

56
class TestPage extends StatefulWidget {
67
@override
@@ -30,7 +31,10 @@ class _TestPageState extends State<TestPage> {
3031
void loadData() async {
3132
try {
3233
await EasyLoading.show();
33-
Response response = await Dio().get('https://github.com');
34+
HttpClient client = HttpClient();
35+
HttpClientRequest request =
36+
await client.getUrl(Uri.parse('https://github.com'));
37+
HttpClientResponse response = await request.close();
3438
print(response);
3539
await EasyLoading.dismiss();
3640
} catch (e) {
@@ -46,8 +50,7 @@ class _TestPageState extends State<TestPage> {
4650
title: Text('Test Page'),
4751
),
4852
body: Center(
49-
child: FlatButton(
50-
textColor: Colors.blue,
53+
child: TextButton(
5154
child: Text('loadData'),
5255
onPressed: () {
5356
loadData();

0 commit comments

Comments
 (0)