helpers_plethora 0.1.0-nullsafety.1
helpers_plethora: ^0.1.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(). 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 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.