DVTranslationKey class

A translation key, typed rather than a bare string.

No == override, and that is load-bearing rather than an omission. Dart refuses a key without primitive equality in a const map -- "does not have a primitive equality" -- so overriding it made the catalogue shape the spec documents impossible to write:

const DVTranslationCatalog(
  messages: <DVTranslationKey, String>{AppText.settingsTitle: '...'},
)

Const instances canonicalise, so two const DVTranslationKey('a') are identical and compare equal anyway. Keys built at runtime are matched by value instead, because the catalogue is indexed by value when it is loaded rather than looked up by object.

Constructors

DVTranslationKey(String value)
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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