|
List.generate(int length, E Function(int) generator, {bool growable = true})
|
List .generate(3, (int index) => index * index); // [0, 1, 4]
|
|
List.filled(int length, dynamic fill, {bool growable = false})
|
List .filled(3, 0, growable: true); // [0, 0, 0]
|
|
List.add(List<dynamic> value);
|
List.add('Madonna');
|
|
List.addAll(Iterable<List<dynamic>> iterable);
|
List.addAll([12,23,1235,532]);
|
|
List.insert(int index, List<dynamic> element);
|
List.insert(2,'HummingBird');
|
|
List.insertAll(int index, Iterable<List<dynamic>> iterable);
|
List.insertAll(3,[12,23,1235,532]);
|
|
var variable_name = <variable_type>{};
|
var nima = <String>{'nimakarimian'};
|
|
Set <variable_type> variable_name = {};
|
Set<String> nima = {'nimakarimian'};
|
|
Set.add(dynamic value);
|
Set.add(35);
|
|
Set.addAll(Iterable<dynamic> elements);
|
Set.addAll(1,2,3,4,5,7,6);
|
|
Set.elementAt(index);
|
It returns the element at the corresponding index.
|
|
Set.length;
|
returns the length of the set and the output is of integer type
|
|
Set.contains(element_name);
|
Returns boolean value if the element is present in the set
|
|
Set.remove(element_name);
|
Removes the Element from the Set
|
|
Set.forEach(...);
|
It runs the command defined inside forEach() function for all the elements inside the set.
|
|
Set.clear();
|
It deletes all the elements inside the set
|
|
List<type> list_variable_name = set_variable_name.toList();
|
List<int> idList = idListSet.toList();
|
|
Set.map();
|
converts the set into the map.
|
|
Set1.union(Set2);
|
Set1.intersection(Set2);
|
|
Set2.difference(Set1);
|
|
|
var map_name = { key1 : value1, key2 : value2, ..., key n : value n }
|
|
|
var map_name = new Map();
|
map_name [ key ] = value;
|
|
Queue variable_name = new Queue();has unnecessary new keyword
|
Queue Variable_name;
|
|
// With type notation(E) Queue<E> variable_name = new Queue<E>.from(list_name);
|
// Without type notation var variable_name = new Queue.from(list_name);
|
|
queue_name.add(element);
|
queue_name.addAll(collection_name)
|
|
queue_name.addFirst(element)
|
Adds the element from front inside the queue.
|
|
queue_name.addLast(element)
|
Adds the element from back in the queue.
|
|
queue_name.clear()
|
Removes all the elements from the queue.
|
|
queue_name.first()
|
Returns the first element from the queue.
|
|
queue_name.forEach(f(element))
|
Invokes action on each element of this iterable in iteration order.
|
|
queue_name.isEmpty
|
Returns boolean true if the queue is empty else return false.
|
|
queue_name.length
|
Returns the length of the queue.
|
|
queue_name.removeFirst()
|
Removes the first element from the queue.
|
|
queue_name.removeLast()
|
Removes the last element from the queue.
|
|
enum variable_name{ // Insert the data members as shown member1, member2, member3, ...., memberN }
|
|
|
Limitation of Enumerated Data Type: It cannot be subclassed or mixed in. It is not possible to explicitly instantiate an enum.
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.