Tags
Android, anonymous function, array, arrays in Dart, collection, Dart, dart functions, dart programming, Lambda in Dart, List, Lists in Dart, Mobile Device, Native iOS, Object Oriented Methodology, Object Oriented Programming, programming in dart

laern-dart-the-hard-way
This is the most common collection in every programming language: array or an “ordered group of objects”. In Dart, arrays are List objects. We will address them as ‘lists’ in our future discussion.
JavaScript array literals look like Dart lists. Here is a sample code we may consider to understand why this concept is important:
//code 2.14
main(List arguments) {
List fruitCollection = ['Mango', 'Apple', 'Jack fruit'];
print(fruitCollection[0]);
}
Consider another piece of code:
//code 2.15
main(List arguments) {
List fruitCollection = ['Mango', 'Apple', 'Jack fruit'];
var myIntegers = [1, 2, 3];
print(myIntegers[2]);
print(fruitCollection[0]);
}
What is the difference between these two code snippets? In the above code 2.14, we have explicitly mentioned that we are going to declare a collection of fruits. And we can pick any item from that collection from the key.
As we know, when in an array key is not mentioned with the value pair, it automatically infers that the key starts from 0. Therefore, the output of code 2.14 is ‘Mango’. In the second instance, Continue reading