FLUTTER ECOSYSTEM

relative_time

Expresses a DateTime object relative to the current time in text form.

Latest version
5.0.0
30-day downloads
9.8K
Likes
22
Pub points
160

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The relative_time package converts a DateTime object into a human-readable string that expresses the time relative to the current moment. For example, it can display '2 minutes ago' or 'in 3 hours' instead of raw timestamps. It supports multiple languages and is designed for simplicity and performance across all major platforms including Android, iOS, Web, macOS, Windows, and Linux. Ideal for apps needing dynamic, user-friendly time displays in feeds, notifications, or chat interfaces.

Use cases
  • Displaying time since a post was published
  • Showing countdowns or reminders
  • Enhancing chat message timestamps
  • Updating real-time activity indicators
  • Improving UX in social media apps
Key features
  • Simple API with minimal setup
  • Supports localization
  • Cross-platform compatibility
  • Automatic updates for real-time accuracy
  • Lightweight and efficient
Suitable for
  • Apps with real-time data feeds
  • Social networking applications
  • Task and reminder tools
  • Chat and messaging platforms
  • User interface components requiring dynamic time labels
Considerations
  • Requires manual refresh for real-time updates
  • Limited to relative time formatting only
  • No built-in support for custom time units
  • Depends on system clock accuracy
  • May need additional handling for timezone differences
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add relative_time

Categories

Dependencies

Dependency list 2 items

Source repository

Related projects