Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Combine Lists

This video was last updated on Apr 26 2022

Take your list skills to the next level by creating a new list based on certain conditions.


Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a Professional subscription.

Often times, you’ll want to combine lists and with Dart, this is actually quite easy to do. We use the plus operator between two lists, and basically, we add the two lists together. So Dart makes this operation really easy to do.

var yourCards = ['8♦️', '3♣️', 'J♠️'];
var myCards = ['10❤️', 'Q♦️', '2♠️'];
var bonusCard = 'A♠️';
var cards = [yourCards, myCards, bonusCard];
var cards = [...yourCards, ...myCards, bonusCard];
 List<String>? emptyHand = null; 
var cards = [...yourCards, ...myCards, bonusCard, ...emptyHand];
var cards = [...yourCards, ...myCards, bonusCard, ...emptyHand];