An interface that represents an ISO-standardized object.
The IsoStandardized interface is used to represent objects that conform to ISO standards. The interface defines properties for the ISO code, the name of the object, and other optional properties.
The Name type parameter is used to specify the type of the name property.
The name property can be any object that represents the name of the object.
Example usage:
class NaturalLanguage implements IsoStandardized<String> {
const NaturalLanguage({
required this.name,
required this.code,
this.namesNative,
this.codeShort,
});
final String code;
final String? codeShort;
final String name;
final List<String>? namesNative;
@override
String get codeOther => codeShort;
}
In this example the NaturalLanguage class implements the IsoStandardized
interface with a String type parameter for the name property. The class
defines properties for the ISO code, the name of the natural language, and
other optional properties. The IsoStandardized interface is used to ensure
that the NaturalLanguage class conforms to ISO standards.
- Available extensions
Properties
- code → String
-
A string representing the ISO (usually a 3-letter) code for the object.
final
- codeOther → String
-
An string representing an alternative ISO code for the object.
This is typically used for short code (2-letter, as codeShort) or numeric
code (3-digit, as codeNumeric).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- internationalName → String
-
An String representing the international name of the object. This is
typically a English name of the ISO object.
no setter
- name → Name
-
An object representing the name of the object.
final
-
namesNative
→ List<
Name> ? -
An optional list of objects representing the native names of the object.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
mapWhenOrNull<
T extends Object> ({T? country(WorldCountry country)?, T? currency(FiatCurrency currency)?, T? language(NaturalLanguage language)?, T? script(Script script)?, T? orElse(IsoStandardized< Object> iso)?}) → T? -
Available on IsoStandardized<
Pattern-matching helper for ISO types.Object> ?, provided by the IsoStandardizedWorldCountryExtension extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
{bool short = true}) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- codeLength → const int
- The regular length of the ISO code (3 characters). However, it's important to note that this length is not standardized for all ISO codes. Some ISO codes may have a different length. For example, the ISO 15924 code has a length of 4. To determine the specific length of the code for a particular ISO realization of this interface, please refer to the documentation of that realization.
- codeShortLength → const int
- The regular length of the short ISO code (2 characters).
- standardAcronym → const String
- The acronym for the International Organization for Standardization (ISO).