flinq 0.3.0 flinq: ^0.3.0 copied to clipboard
Extended capabilities for collections. It's a bunch of shortcuts to avoid unnecesary boilerplate work with collections.
flinq #
Extended capabilities for collections. It's a bunch of shortcuts to avoid unnecesary boilerplate work with collections.
Getting Started #
This package will help to reduce amount of boilerplate code by adding folowing extension for Iterable
s:
- getter
firstOrNull
and methodfirstOrNullWhere(bool test(T))
for getting first value, and if it will not be found returnsnull
- getter
lastOrNull
and methodlastOrNullWhere(bool test(T))
for getting last value, and if it will not be found returnsnull
- getter
singleOrNull
and methodsingleOrNullWhere(bool test(T))
for getting single value, and if it will not be found returnsnull
, and if there will be too many elements it'll throw theStateError
- method
mapList
, which maps collection and casts it toList
- getter
min
andmax
for getting minimal or maximal value from collection ofComparable
s - getter
sum
andaverage
for getting sum and average from collection ofnum
s - getter
distinct
which will returnList
with unique values in collection - method
union
which will returnList
with union of two collections with only unique values in resulting collection - method
intersection
which will returnList
with elements that contains both collections with only unique values in resulting collection - method
difference
which will returnList
with difference between two collections with only unique values in resulting collection
Examples #
Will be added soon For now navigate to Examples section/folder
Milestones for next releases #
- Add notNull getter
- Add minWhere method
- Add maxWhere method
- Add minOrNullWhere method
- Add maxOrNullWhere method
- Add groupBy method