Chrome Extension

Concatenate two list in Flutter

List<String> _fruits = ["apple", "banana"];
List<String> _vegetables = ["Potato", "carrot"];

_fruits.addAll(_vegetables); //This will join the list
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
["apple", "banana", "Potato", "carrot"]

To concatenate or join two lists in dart or Flutter you can use .addAll() method. In the code snippet, we have defined two lists _fruits and _vegetables and we concatenate them.

Search Index Data (The code snippet can also be found with below search text)

Join two lists in dart
Was this helpful?
Join Devsheet Ask a Question