You can use:
var newList = new List.from(list1)..addAll(list2);
If you have several lists you can use:
var newList = [list1, list2, list3].expand((x) => x).toList()
As of Dart 2 you can now use +:
var newList = list1 + list2 + list3;
As of Dart 2.3 you can use the spread operator:
var newList = [...list1, ...list2, ...list3];
'플러터(Flutter) > 다트(Dart)' 카테고리의 다른 글
[Dart] Exception Handling & Null Aware Operators (0) | 2020.03.19 |
---|---|
[Dart] Futures, Async & Await (0) | 2020.03.19 |
[Dart] Maps (0) | 2020.03.19 |
[Dart] Functions as First Order Objects (0) | 2020.03.19 |
[Dart] Enums (0) | 2020.03.19 |