DurationExtensions extension

Extension methods on Duration for human-readable formatting.

print(Duration(minutes: 90).toHuman());            // "1 hour 30 minutes"
print(Duration(hours: 3).toHuman(short: true));    // "3h"
print(Duration(seconds: 45).toHuman());            // "45 seconds"
on

Methods

toHuman({bool short = false}) String

Available on Duration, provided by the DurationExtensions extension

Returns a human-readable representation of this Duration.