xxxxxxxxxx
/*
Cascade notation is syntactic sugar in Dart that allows you to make a sequence of
operations on the same object. You can use the "double dot" to call functions on
objects and access properties. This "operator" is simply used to make your code cleaner
and concise. It often saves you from having to create temporary variables.
*/
/// Without using cascade notaion
void main() {
List myList = [1, 2, 3];
myList.clear();
myList.add(4);
myList.add(5);
myList.add(6);
print(myList);
}
/// using the "Cascade Notaion"
void main() {
List myList = [1, 2, 3];
myList
..clear()
..add(4)
..add(5)
..add(6);
print(myList);
}
/// Assingning values to object parameters
myObject
..a = 88
..bSetter(53)
..printValues();