Skip to content
pubscout

humanize_duration

0.0.2, released 3 years ago by iheb.tech

Humanize a duration into a readable format across multiple languages.

WASM-ready
$ flutter pub add humanize_duration
Source repository

What it does

Converts Duration objects into readable strings such as '6 minutes, 1 second'. It supports multiple built-in languages, custom language definitions, and fine-grained formatting options like delimiters, spacers, conjunctions, and unit selection.

AI-written summary of version 0.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display durations in a human-readable format to users
  • You require multi-language support for time formatting

Skip it when

  • You need complex date-time arithmetic rather than duration formatting

Strengths

  • Supports multiple languages out of the box
  • Allows adding custom languages and detailed formatting options like delimiters and conjunctions

Weaknesses

  • Limited to duration formatting functionality

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
humanizeDuration(const Duration(milliseconds: 97320000));

Alternatives

Packages that do the same job and could replace humanize_duration.