humanize
1.2.1, released a year ago by an unverified publisher
Humanize provides locale‑aware helpers to format dates, numbers, lists and file sizes for UI strings.
What it does
It offers functions to turn raw dates, durations, numbers and collections into readable, natural language strings. The package includes built‑in English and French support and works on all Flutter platforms.
AI-written summary of version 1.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need quick, human‑friendly formatting for UI text without heavy i18n setup
- Your app targets English and French and wants concise helpers for dates, numbers, lists, and file sizes
Skip it when
- You require full locale coverage beyond en/fr
- You need currency, complex plural rules, or calendar systems not provided
Strengths
- Lightweight with only intl as a dependency
- Simple, chainable API for common UI phrasing
- Works across mobile, web and desktop
Weaknesses
- Limited to English and French locales
- Not a full replacement for intl's extensive i18n features
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:humanize/humanize.dart';
void main(){
print(naturaltime(DateTime.now().subtract(Duration(minutes:3)),locale:'en'));
print(intcomma(4500.2));
print(filesizeformat(1536));
}Alternatives
Packages that do the same job and could replace humanize.
- yaml
A Dart library for parsing YAML documents into Dart data structures.
92Compare - validators2
String validation and sanitization for Dart.
83Compare - extension_utils
Dart and Flutter extension library for strings, collections, dates, numbers, and colors.
74Compare - alphanum_comparator
Sorts string lists alphanumerically using The Alphanum Algorithm.
55Compare
Works with
Packages commonly used together with humanize: ones it builds on, ones built on it, and its own family.