Skip to content

Commit 08446d8

Browse files
committed
Apply null-safety migration changes
1 parent 1d60dfd commit 08446d8

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

example/pubspec.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,42 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0-nullsafety.1"
10+
version: "2.6.1"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.1.0-nullsafety.1"
17+
version: "2.1.0"
1818
characters:
1919
dependency: transitive
2020
description:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0-nullsafety.3"
24+
version: "1.1.0"
2525
charcode:
2626
dependency: transitive
2727
description:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0-nullsafety.1"
31+
version: "1.2.0"
3232
clock:
3333
dependency: transitive
3434
description:
3535
name: clock
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "1.1.0-nullsafety.1"
38+
version: "1.1.0"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0-nullsafety.3"
45+
version: "1.15.0"
4646
cupertino_icons:
4747
dependency: "direct main"
4848
description:
@@ -56,7 +56,7 @@ packages:
5656
name: fake_async
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.2.0-nullsafety.1"
59+
version: "1.2.0"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -80,21 +80,21 @@ packages:
8080
name: matcher
8181
url: "https://pub.dartlang.org"
8282
source: hosted
83-
version: "0.12.10-nullsafety.1"
83+
version: "0.12.10"
8484
meta:
8585
dependency: transitive
8686
description:
8787
name: meta
8888
url: "https://pub.dartlang.org"
8989
source: hosted
90-
version: "1.3.0-nullsafety.3"
90+
version: "1.3.0"
9191
path:
9292
dependency: transitive
9393
description:
9494
name: path
9595
url: "https://pub.dartlang.org"
9696
source: hosted
97-
version: "1.8.0-nullsafety.1"
97+
version: "1.8.0"
9898
sky_engine:
9999
dependency: transitive
100100
description: flutter
@@ -106,56 +106,56 @@ packages:
106106
name: source_span
107107
url: "https://pub.dartlang.org"
108108
source: hosted
109-
version: "1.8.0-nullsafety.2"
109+
version: "1.8.1"
110110
stack_trace:
111111
dependency: transitive
112112
description:
113113
name: stack_trace
114114
url: "https://pub.dartlang.org"
115115
source: hosted
116-
version: "1.10.0-nullsafety.1"
116+
version: "1.10.0"
117117
stream_channel:
118118
dependency: transitive
119119
description:
120120
name: stream_channel
121121
url: "https://pub.dartlang.org"
122122
source: hosted
123-
version: "2.1.0-nullsafety.1"
123+
version: "2.1.0"
124124
string_scanner:
125125
dependency: transitive
126126
description:
127127
name: string_scanner
128128
url: "https://pub.dartlang.org"
129129
source: hosted
130-
version: "1.1.0-nullsafety.1"
130+
version: "1.1.0"
131131
term_glyph:
132132
dependency: transitive
133133
description:
134134
name: term_glyph
135135
url: "https://pub.dartlang.org"
136136
source: hosted
137-
version: "1.2.0-nullsafety.1"
137+
version: "1.2.0"
138138
test_api:
139139
dependency: transitive
140140
description:
141141
name: test_api
142142
url: "https://pub.dartlang.org"
143143
source: hosted
144-
version: "0.2.19-nullsafety.2"
144+
version: "0.3.0"
145145
typed_data:
146146
dependency: transitive
147147
description:
148148
name: typed_data
149149
url: "https://pub.dartlang.org"
150150
source: hosted
151-
version: "1.3.0-nullsafety.3"
151+
version: "1.3.0"
152152
vector_math:
153153
dependency: transitive
154154
description:
155155
name: vector_math
156156
url: "https://pub.dartlang.org"
157157
source: hosted
158-
version: "2.1.0-nullsafety.3"
158+
version: "2.1.0"
159159
sdks:
160-
dart: ">=2.10.0-110 <2.11.0"
160+
dart: ">=2.12.0 <3.0.0"
161161
flutter: ">=1.20.0"

lib/flutter_split.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class FlutterSplit {
1818
}
1919
}
2020

21-
Future<String> getTreatment(String key, Map<String, dynamic> attr) async {
21+
Future<String?> getTreatment(String key, Map<String, dynamic> attr) async {
2222
Map<String, dynamic> attributes = {"key": key, "attributes": attr};
2323

2424
try {
@@ -30,7 +30,7 @@ class FlutterSplit {
3030
}
3131
}
3232

33-
Future<SplitResult> getTreatmentWithConfig(
33+
Future<SplitResult?> getTreatmentWithConfig(
3434
String key, Map<String, dynamic> attr) async {
3535
Map<String, dynamic> attributes = {"key": key, "attributes": attr};
3636

@@ -49,13 +49,13 @@ class FlutterSplit {
4949
}
5050
}
5151

52-
Future<Map<String, String>> getTreatments(
52+
Future<Map<String, String?>> getTreatments(
5353
List<String> keys, Map<String, dynamic> attr) async {
5454
Map<String, dynamic> attributes = {"keys": keys, "attributes": attr};
5555

5656
var data = await _channel.invokeMethod('getTreatments', attributes);
5757

58-
Map<String, String> result = Map();
58+
Map<String, String?> result = Map();
5959
for (var key in keys) {
6060
try {
6161
result[key] = data[key];
@@ -96,7 +96,7 @@ class FlutterSplit {
9696
return await _channel.invokeMethod('dispose');
9797
}
9898

99-
Future<bool> trackEvent(
99+
Future<bool?> trackEvent(
100100
String eventType, String trafficType, Map<String, dynamic> props) async {
101101
return await _channel.invokeMethod('trackEvent', {
102102
'trafficType': trafficType,

lib/split_result.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class SplitResult {
2-
String splitName;
3-
String treatment;
4-
Map<String, dynamic> config;
2+
String? splitName;
3+
String? treatment;
4+
Map<String, dynamic>? config;
55

66
SplitResult.fromJson(json) {
77
this.splitName = json['splitName'];

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author:
55
homepage:
66

77
environment:
8-
sdk: ">=2.7.0 <3.0.0"
8+
sdk: '>=2.12.0 <3.0.0'
99
flutter: ">=1.20.0"
1010

1111
dependencies:

0 commit comments

Comments
 (0)