maxDuration function

Duration maxDuration(
  1. Duration a,
  2. Duration b
)

Returns the maximum of two Duration values.

Parameters

  • a - The first duration.
  • b - The second duration.

Returns

The longer of the two durations.

Example

final longer = maxDuration(
  Duration(milliseconds: 100),
  Duration(milliseconds: 200),
); // Duration(milliseconds: 200)

Implementation

Duration maxDuration(Duration a, Duration b) {
  return a > b ? a : b;
}