decoder method
The mapping method to decode value
to an instance of this mappers type.
Implementation
@override
T decoder(Object? value, DecodingContext context) {
if (hook != null) {
value = hook!.beforeDecode(value);
if (value is T) {
return hook!.afterDecode(value) as T;
}
}
var result = decode(value, context);
if (hook != null) {
result = hook!.afterDecode(result) as T;
}
return result;
}