D4UserRelaxer class abstract
Base class for user-provided relaxer factories.
Extend this class to add type argument cases to existing auto-generated relaxer wrappers, or to register entirely new wrapper classes for generic types not covered by generation.
Classes extending D4UserRelaxer are automatically excluded from bridge generation (same as D4UserBridge).
Example:
class ValueNotifierUserRelaxer extends D4UserRelaxer {
@override
String get baseTypeName => 'ValueNotifier';
static Object? relaxFactory(Object value, String innerTypeArg) {
if (value is! ValueNotifier) return null;
return switch (innerTypeArg) {
'MyCustomModel' => $RelaxedValueNotifier<MyCustomModel>(value),
_ => null,
};
}
}
Constructors
Properties
- baseTypeName → String
-
The unparameterized base type name this relaxer targets.
E.g., 'ValueNotifier', 'Animation', 'ReactiveStream'.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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