helpers_plethora 1.0.0
helpers_plethora: ^1.0.0 copied to clipboard
A set of helpers who extend various classes.
Helpers #
A set of helpers that extends various classes.
extension on DateTime class #
The following additional functionality are provided in this extension:
belongsTo(). Returnstrueif this date belongs to a date-time range.isAfterOrAtSameMomentAs(). Returnstrueif this date is after or at same moment as other.isBeforeOrAtSameMomentAs(). Returnstrueif this date is before or at same moment as other.isBetween(). Returnstrueif this date is betweenstartandend(start < this <end).isBetweenOrAtSameMomentAs(). Returnstrueif this date is betweenstartandendor at same moment asstartor asend(start⩽ this ⩽end).
extension on DateTimeRange class #
The following additional functionality are provided in this extension:
belongsTo(). Returnstrueif this date-time range belongs to another one, that is, it’s completely included in the another.overlapWith(). Returnstrueif this date-time range overlaps, in part or completely, with another one.
extension on double class #
The following additional functionality are provided in this extension:
toStringWithThousands(). Returns the corresponding string to this number, with thousands separator, depending on locale.
extension on int class #
The following additional functionality are provided in this extension:
toStringWithThousands(). Returns the corresponding string to this number, with thousands separator, depending on locale.
extension on List<Comparable> #
The following additional functionality are provided in this extension:
distinctSort(). Returns this list sorted and without any repetition.
extension on List<DateTimeRange> #
The following additional functionality are provided in this extension:
duration. Returns the sum of all date-time ranges by counting overlapping ranges once. It uses theminimize()method in order to eliminate duplicate ranges where there are overlaps.minimize(). Returns a list of date-time ranges that cover the totality of the period of the sum of the ranges of this list, but without repeating any overlaps.
extension on List<num> #
The following additional functionality are provided in this extension:
progressiveSum(). Returns a list where each value corresponds to the sum of the elements up to that point of this list.sum(). Calculates and returns the sum of all the elements of this list.
extension on String class #
The following additional functionality are provided in this extension:
firstUpperCase(). Returns this string, but with 1º character uppercase.firstsUppercase(). Returns this string with the strings out of the split pattern with 1º character uppercase.
extension on TimeOfDay class #
The following additional functionality are provided in this extension:
isAfter(). Returnstrueif this time is after another one.isBefore(). Returnstrueif this time is before another one.toStringHm(). Returns a string representation of this time, which shows the hours and the minutes.