Skip to content

Commit d5e29e5

Browse files
committed
Null Safety Migration
*Migrate library and example to null safety.
1 parent 2ccb2d6 commit d5e29e5

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

example/lib/main.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class MyApp extends StatelessWidget {
7171
}
7272
}
7373

74-
Widget subHeaderText(String title, {String subtitle}) {
74+
Widget subHeaderText(String title, {String? subtitle}) {
7575
return Padding(
7676
padding: EdgeInsets.fromLTRB(16, 16, 16, 8),
7777
child: Column(
@@ -100,16 +100,16 @@ Widget subHeaderText(String title, {String subtitle}) {
100100
class ShowcaseCard extends StatelessWidget {
101101
final Widget child;
102102
final double width;
103-
final String caption;
104-
final String label;
103+
final String? label;
104+
final String? caption;
105105

106-
const ShowcaseCard(
107-
{Key key,
108-
@required this.child,
109-
this.width = 200,
110-
this.caption,
111-
this.label})
112-
: super(key: key);
106+
const ShowcaseCard({
107+
Key? key,
108+
required this.child,
109+
this.width = 200,
110+
this.label,
111+
this.caption,
112+
}) : super(key: key);
113113

114114
@override
115115
Widget build(BuildContext context) {
@@ -124,7 +124,7 @@ class ShowcaseCard extends StatelessWidget {
124124
child: Align(
125125
alignment: Alignment.centerLeft,
126126
child: Text(
127-
label,
127+
label!,
128128
style: TextStyle(
129129
fontSize: 14,
130130
color: Color(0xFF3A3A3C),
@@ -164,7 +164,7 @@ class ShowcaseCard extends StatelessWidget {
164164
child: Align(
165165
alignment: Alignment.centerLeft,
166166
child: Text(
167-
caption,
167+
caption!,
168168
style: TextStyle(
169169
fontSize: 12,
170170
color: Color(0xFF8E8E93),

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: An example app to demonstrate loading indicator GIFs.
33
version: 1.0.0+1
44

55
environment:
6-
sdk: ">=2.4.0 <3.0.0"
6+
sdk: '>=2.12.0 <3.0.0'
77

88
dependencies:
99
flutter:
@@ -14,7 +14,7 @@ dependencies:
1414
dev_dependencies:
1515
flutter_test:
1616
sdk: flutter
17-
flutter_launcher_icons: ^0.7.5
17+
flutter_launcher_icons: ^0.9.0
1818

1919
flutter_icons:
2020
android: true

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ issue_tracker: https://github.com/Codelessly/FlutterLoadingGIFs/issues
77
documentation: https://github.com/Codelessly/FlutterLoadingGIFs
88

99
environment:
10-
sdk: ">=2.4.0 <3.0.0"
10+
sdk: '>=2.12.0 <3.0.0'
1111

1212
dependencies:
1313
flutter:

0 commit comments

Comments
 (0)