Loading...
Preparing your coding drills
Comprehensive reference for 29 Dart methods across 7 categories.
add
Adds a value to the end of the list, extending the length by one.
remove
Removes the first occurrence of a value from the list. Returns true if the value was found and removed.
contains
Returns true if the list contains an element equal to the given element.
sort
Sorts the list in place according to the provided compare function, or using the natural Comparable ordering if none is supplied.
sublist
Returns a new list containing the elements from start (inclusive) to end (exclusive). If end is omitted, it defaults to the length of the list.
indexOf
Returns the first index of the given element in the list, or -1 if the element is not found. Optionally starts searching from a given index.
split
Splits the string at matches of the specified pattern and returns a list of substrings.
trim
Returns a new string without any leading or trailing whitespace.
replaceAll
Replaces all occurrences of a pattern in the string with a replacement string.
substring
Returns the substring of this string from start (inclusive) to end (exclusive). If end is omitted, it goes to the end of the string.
startsWith
Returns true if this string starts with the given pattern, optionally beginning the check at a specified index.
putIfAbsent
Looks up the key in the map. If the key is not present, calls ifAbsent to compute a value and inserts it. Returns the existing or newly computed value.
containsKey
Returns true if the map contains the given key.
forEach
Applies the given function to each key-value pair in the map.
update
Updates the value for the given key. Calls update with the existing value, or ifAbsent if the key does not exist.
union
Returns a new set containing all elements from this set and the other set.
intersection
Returns a new set containing only the elements that are in both this set and the other set.
difference
Returns a new set containing elements in this set that are not in the other set.
map
Returns a new lazy iterable with elements that are created by calling the supplied function on each element of the original iterable.
where
Returns a new lazy iterable with all elements that satisfy the given predicate.
fold
Reduces a collection to a single value by iteratively combining each element with an existing accumulator value, starting with the provided initial value.
any
Returns true if any element of the iterable satisfies the given predicate. Stops iterating as soon as a match is found.
every
Returns true if every element of the iterable satisfies the given predicate. Stops iterating as soon as a non-match is found.
int.parse
Parses a string as an integer literal and returns the integer value. Optionally accepts a radix for different number bases.
double.parse
Parses a string as a double-precision floating-point literal and returns the value.
toList
Creates a List containing the elements of this iterable. The list is growable by default.
Future.then
Registers a callback to be called when the Future completes with a value. Returns a new Future that completes with the result of the callback.
Future.wait
Waits for all provided futures to complete and collects their values into a list. If any future completes with an error, the returned future completes with that error.
Stream.listen
Adds a subscription to this stream. Each time a data event is received, the onData handler is called. Returns a StreamSubscription that can be used to cancel the subscription.