Skip to content

Commit f2686f6

Browse files
committed
Update List usage
* Replace [] initialization deprecated to List<MyClass>.empty(growable: true);
1 parent 4d1b3a4 commit f2686f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/src/create_notification.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class OSCreateNotification extends JSONStringRepresentable {
172172

173173
// adds buttons
174174
if (this.buttons != null) {
175-
var btns = [];
175+
var btns = List<Map<String, dynamic>>.empty(growable: true);
176176
this.buttons!.forEach((btn) => btns.add(btn.mapRepresentation()));
177177
json['buttons'] = btns;
178178
}

lib/src/notification.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class OSNotification extends JSONStringRepresentable {
248248
}
249249

250250
if (json.containsKey('buttons')) {
251-
this.buttons = [];
251+
this.buttons = List<OSActionButton>.empty(growable: true);
252252
var btns = json['buttons'] as List<dynamic>;
253253
for (var btn in btns) {
254254
var serialized = btn.cast<String, dynamic>();

0 commit comments

Comments
 (0)