ParamModel class

ParamModel class is used to define dynamic parameters for translations. Each parameter has a key that matches the placeholder in the translation string and a value that will replace that placeholder.

Example:

// For translation string: 'hello_{name}'
ParamModel name(String value) => ParamModel(key: 'name', value: value);

// Usage:
final param = ParamModel(key: 'name', value: 'John');
'hello_{name}'.tr('en', param); // Output: 'hello_John'

Constructors

ParamModel.new({required String key, required String value})
Creates a parameter model with a key and value. The key should match the placeholder name in your translation string (without braces). The value is what will appear in place of the placeholder in the final translation.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
key String
The key that matches the placeholder in the translation string (e.g., 'name' for '{name}')
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String
The value that will replace the placeholder in the final translation
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