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

Boost your skills with a raywenderlich.com 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.

Create a List

Dart’s List documentation: [https://api.dart.dev/stable/2.14.4/dart-core/List-class.html)

Learn how to use lists in Dart to store an ordered list of values.

Contributors

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 raywenderlich.com Professional subscription.

In this episode, you’ll learn about a collection type that you’ll be using in all your programs - the List otherwise known as the array. In dart, a list is synonymous with an array so you can use them interchangeably. For the sake of consistency, I’ll refer to them as Lists, but if you hear or read the word array in any Dart or a Flutter tutorial, just understand it is just a list.

const pastries =
const pastries = [];
const pastries = ["cookie", "cupcake", "donut", "pie"];
const List<String> pastries = ["cookie", "cupcake", "donut", "pie"];
var pastries = <String>[];
pastries.add('danish');
pastries += ['cupcake', 'donut', 'pie', 'brownie'];
print(pastries);

Reviews

Comments