kota's memex

lists

void main() {
  List<String> names = [
    'Kota',
    'Jazzi',
    'Henry',
    'Matthew',
  ];
  for (var name in names) {
    print(name);
  }
}

Lists use zero-based indexing, where 0 is the index of the first value and list.length - 1 is the index of the last value.

To create a list that’s a compile-time constant, add const before the list literal:

var constantList = const [1, 2, 3];