plus method

  1. @Possible({RangeError})
  2. @useResult
Offset plus({
  1. int hours = 0,
  2. int minutes = 0,
  3. int seconds = 0,
})

Returns a copy of this with the sum of the units of time added.

Contract

Throws a RangeError if the result is outside the valid range.

Example

Offset(16).plus(hours: 2); // Offset(18)

Offset(18).plus(hours: 2); // throws RangeError

Implementation

@Possible({RangeError})
@useResult
Offset plus({int hours = 0, int minutes = 0, int seconds = 0}) => Offset.fromMicroseconds(_microseconds + sumMicroseconds(hours, minutes, seconds));