TextFormat class

A class for handling text formats with singular and optional plural forms.

Constructors

TextFormat({required String singular, String? plural})
Creates a TextFormat instance with the specified singular form and optional plural form.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
plural → String
The plural form of the text. If not provided, it defaults to the singular form.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
singular → String
The singular form of the text.
final

Methods

apply(int counter) → String
Gets the appropriate text form based on the provided counter. If the counter is greater than 1, returns the plural form; otherwise, returns the singular form.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited