any_timeago library

Classes

EnTimeAgoLocaleFunctions
Const, non-Intl British English locale operations.
EnUsTimeAgoLocaleFunctions
Const, non-Intl US English locale operations.
IntlTimeAgoLocaleFunctions
Locale operations backed by package:intl.
LocaleConfig
Self-contained labels and locale operations. Import locale files individually; no global registry or package default locale is installed.
TimeAgoBuilder
Resolves time-ago configuration and delegates live updates to TimeAgoRenderer.
TimeAgoContext
Shared, immutable input for time-ago resolution callbacks.
TimeAgoCustomStep
A step whose text is produced by a required custom formatter.
TimeAgoCustomUnit
Contract for an application- or locale-defined time unit.
TimeAgoCustomUnitFormatter
Formats a custom multiplied unit from localized plural patterns.
TimeAgoCustomUnitStep
A const-capable custom step backed by a reusable unit definition.
TimeAgoCustomUnitTranslation
Standard label-based implementation of TimeAgoCustomUnit.
TimeAgoDirectionPatterns
One wrapper applied to a complete multi-unit list.
TimeAgoFormatLabels
All labels for one TimeAgoFormat.
TimeAgoFormatSet<T>
An immutable set of label widths with optional narrow and mini labels.
TimeAgoListPatterns
Localized list composition patterns.
TimeAgoLocaleFunctions
Plural, number, and date operations used by LocaleConfig.
TimeAgoMinTimeContext
Input used to resolve a step's dynamic minimum threshold.
TimeAgoNowLabels
Present, near-past, and near-future labels.
TimeAgoPluralLabels
Plural-sensitive string patterns. {0} is replaced with the localized number.
TimeAgoProvider
Supplies nested, non-global defaults and a shared update scheduler.
TimeAgoProviderData
Resolved inherited configuration.
TimeAgoRelativeLabels
Labels used by each relative-time unit in a presentation style.
TimeAgoRelativeUnitLabels
Directional labels for one relative-time unit.
TimeAgoRenderer
Evaluates a time-ago result and rebuilds at its requested update times.
TimeAgoResult
Formatted text, its underlying values, and the instruction for its next evaluation.
TimeAgoScheduler
Coordinates all live time-ago widgets under a provider with one timer.
TimeAgoStep
A threshold and numeric policy in a single-unit formatting step.
TimeAgoStepContext
Input used after a step or standalone cutoff has been selected.
TimeAgoSteps
Immutable, reusable single-unit step presets.
TimeAgoSubscription
A live widget's handle into a TimeAgoScheduler.
TimeAgoText
A Text widget backed by TimeAgoBuilder.
TimeAgoUnitLabels
Directionless unit labels used to compose multi-unit output.
TimeAgoUnitStep
A locale-backed step with a required numeric or now unit.
TimeAgoUpdate
The update instruction returned by a custom step.
TimeAgoUpdateAfter
TimeAgoUpdateNever
TimeAgoUpdateUnknown

Enums

TimeAgoFormat
TimeAgoPluralCategory
Unicode plural categories available to locale definitions.
TimeAgoRounding
Numeric rounding for a single TimeAgoStep.
TimeAgoUnit
Units supported by single-step and multi-unit formatting.

Extensions

TimeAgoExtension on BuildContext
One-shot formatting that resolves omitted values from TimeAgoProvider.

Constants

englishTimeAgoLocaleFunctions → const EnTimeAgoLocaleFunctions
Const British English operations used as the default non-Intl fallback.
enUsTimeAgoLocaleFunctions → const EnUsTimeAgoLocaleFunctions
Const US English operations for use as a non-Intl fallback.

Functions

durationAgo(Duration duration, {required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoStep>? steps, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) String
Formats a signed duration. Positive durations are in the past and negative durations are in the future.
durationAgoMulti(Duration duration, {required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoUnit>? units, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) String
Formats a signed duration as a localized list of components.
durationAgoMultiResult(Duration duration, {required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoUnit>? units, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) TimeAgoResult
Decomposes a duration into multiple units and returns its stable result.
durationAgoResult(Duration duration, {required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoStep>? steps, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) TimeAgoResult
Formats one selected duration step and returns text with a stable deadline.
initializeTimeAgoDateFormatting() Future<void>
Loads Intl date symbols for all locales bundled by package:intl.
timeAgo(DateTime time, {DateTime? to, required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoStep>? steps, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) String
Formats time relative to to, or relative to the current clock.
timeAgoMulti(DateTime time, {DateTime? to, required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoUnit>? units, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) String
Formats time as a localized list of relative-time components.
timeAgoMultiResult(DateTime time, {DateTime? to, required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoUnit>? units, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) TimeAgoResult
Decomposes time into multiple units and returns the text and next update.
timeAgoResult(DateTime time, {DateTime? to, required LocaleConfig locale, TimeAgoFormat format = TimeAgoFormat.long, bool? directional, bool future = false, List<TimeAgoStep>? steps, TimeAgoStep? cutoffStep, TimeAgoLocaleFunctions fallbackFunctions = englishTimeAgoLocaleFunctions}) TimeAgoResult
Formats one selected step and returns its text and next update deadline.

Typedefs

TimeAgoCutoffFormat = ({String pattern, TimeAgoPluralCategory plural})
A plural form and localized-number pattern for cutoff output.
TimeAgoCutoffResolver = TimeAgoCutoffFormat Function(int amount)
Resolves cutoff formatting for a configured numeric amount.
TimeAgoMinTimeResolver = Duration Function(TimeAgoMinTimeContext context)
TimeAgoNextUpdateResolver = TimeAgoUpdate Function(TimeAgoStepContext context)
TimeAgoResultBuilder = Widget Function(BuildContext context, TimeAgoResult result)
TimeAgoResultResolver = TimeAgoResult Function(BuildContext context)
TimeAgoStepFormatter = String Function(TimeAgoStepContext context)
TimeAgoValue = ({TimeAgoStep step, int value})
A formatting step and its numeric value before locale-specific formatting is applied.
TimeAgoWidgetBuilder = Widget Function(BuildContext context, String value)

Exceptions / Errors

TimeAgoIntlException
An error raised when an operation cannot be completed by package:intl.