byte_flow
library
Functions
capitalize (String text )
→ String
Capitalizes the given string
chunk (List list , [int size = 1 ])
→ List
Creates an list of elements split into groups the length of size
.
If list
can't be split evenly, the final chunk will be the remaining elements.
Example
compact (List list )
→ List
Creates an list with all falsey values removed. The values false
, null
,
0
, ""
, and NaN
are falsey.
Example
drop (List list , [int n = 1 ])
→ List
Creates a slice of list
with n
elements dropped from the beginning.
dropRight (List list , [int n = 1 ])
→ List
Creates a slice of list
with n
elements dropRightped from the beginning.
duplicate (List list )
→ List
Find duplicate items in an list
fill (List list , dynamic value , [int start = 0 , int ? end ])
→ List
Fills elements of list
with value
from start
up to, but not
including, end
.
Example
findIndex (List list , dynamic element )
→ int
This method uses dart's default List.indexOf
Example
findLastIndex (List list , dynamic element )
→ int
This method finds the item in the list from right / last
using dart's List.indexOf()
method
Example
flatten (List list )
→ List
Flatten a list
head (List list )
→ dynamic
Finds the first element in the list
Uses dart's List.first
property
Example
initial (List list )
→ List
Gets all but the last element of list.
Example
intersect (List <List > arrays )
→ dynamic
Creates an list of unique values that are included in all given arrays
Example
join (List list , [String separator = ',' ])
→ String
Converts all elements in list into a string separated by separator.
Uses dart's List.join()
Example
last (List list )
→ dynamic
Gets the last element of list.
Uses dart's List.last
property
Example
map (List list , dynamic iteratee (dynamic element , int index , List list ) )
→ List
Creates an list of values by running each element of list
thru iteratee
.
The iteratee is invoked with three arguments: (value, index, list).
nth (List list , int n )
→ dynamic
Gets the element at index n
of list
. If n
is negative, the nth
element from the end is returned.
Example
pairs (List pairs )
→ Map
This method returns an object composed from key-value pairs
.
Example
slice (List list , [int start = 0 , int ? end ])
→ List
Creates a slice of list
from start
up to, but not including, end
.
Example
sortedIndex (List list , dynamic value )
→ int
Uses a binary search to determine the lowest index
at which value should be inserted into list in order to maintain its sort order.
Returns the index at which value should be inserted into list.
Example
tail (List list )
→ List
Gets all but the first element of list.
Example
take (List list , [int n = 1 ])
→ List
Creates a slice of list with n elements taken from the beginning.
Uses dart's native List.take(n)
method
Example
takeRight (List list , [int n = 1 ])
→ List
Creates a slice of list with n elements taken from the end.
Example
union (List <List > arrays )
→ dynamic
Creates an list of unique values, in order
unzip (List list )
→ List
This method Returns the new list of regrouped elements
Example
zip (List a , List b )
→ List
Zips two arrays
Credit