diff --git a/lib/src/create_notification.dart b/lib/src/create_notification.dart index 766ce24a..0302ffb7 100644 --- a/lib/src/create_notification.dart +++ b/lib/src/create_notification.dart @@ -172,7 +172,7 @@ class OSCreateNotification extends JSONStringRepresentable { // adds buttons if (this.buttons != null) { - var btns = []; + var btns = List>.empty(growable: true); this.buttons!.forEach((btn) => btns.add(btn.mapRepresentation())); json['buttons'] = btns; } diff --git a/lib/src/notification.dart b/lib/src/notification.dart index aadadcb5..baeda628 100644 --- a/lib/src/notification.dart +++ b/lib/src/notification.dart @@ -248,7 +248,7 @@ class OSNotification extends JSONStringRepresentable { } if (json.containsKey('buttons')) { - this.buttons = []; + this.buttons = List.empty(growable: true); var btns = json['buttons'] as List; for (var btn in btns) { var serialized = btn.cast();