Create a List
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 += ['cupcake', 'donut', 'pie', 'brownie'];