dart array of objects code example
Example 1: declaring and initializing a list in dart
import 'dart:core';
void main() {
List<int> intArr = [1,2,3,4,5];
print(intArr);
List<String> strArr = ['hello', 'world'];
print(strArr);
}
Example 2: dart have array
import 'dart:convert';
void main() {
var arr = new List(5);
arr[0] = 'a';
arr[1] = 'b';
arr[2] = 'c';
arr[3] = 'd';
arr[4] = 'e';
print(arr);
}
Example 3: how to get data from an array of objects in dart
list[index] ,
list.last ,
list.last.value1,