helpers_plethora 0.2.0-nullsafety.1
helpers_plethora: ^0.2.0-nullsafety.1 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()
. Returnstrue
if this date belongs to a date-time range.isAfterOrAtSameMomentAs()
. Returnstrue
if this date is after or at same moment as other.isBeforeOrAtSameMomentAs()
. Returnstrue
if this date is before or at same moment as other.isBetween()
. Returnstrue
if this date is betweenstart
andend
(start < this <end
).isBetweenOrAtSameMomentAs()
. Returnstrue
if this date is betweenstart
andend
or at same moment asstart
or asend
(start
⩽ this ⩽end
).
extension
on DateTimeRange
class #
The following additional functionality are provided in this extension:
belongsTo()
. Returnstrue
if this date-time range belongs to another one, that is, it’s completely included in the another.overlapWith()
. Returnstrue
if 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()
. Returnstrue
if this time is after another one.isBefore()
. Returnstrue
if this time is before another one.toStringHm()
. Returns a string representation of this time, which shows the hours and the minutes.