RxList initialize with empty list as default value if not provided
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -11,7 +11,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | @@ -11,7 +11,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | ||
11 | /// Create a list similar to `List<T>` | 11 | /// Create a list similar to `List<T>` |
12 | class RxList<E> implements List<E>, RxInterface<List<E>> { | 12 | class RxList<E> implements List<E>, RxInterface<List<E>> { |
13 | RxList([List<E> initial]) { | 13 | RxList([List<E> initial]) { |
14 | - _list = initial; | 14 | + _list = initial ?? []; |
15 | } | 15 | } |
16 | 16 | ||
17 | List<E> _list = <E>[]; | 17 | List<E> _list = <E>[]; |
-
Please register or login to post a comment