-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I have class model BaseResponses
import 'package:object_mapper/object_mapper.dart';
class BaseResponses<T> with Mappable {
String message;
T data;
@override
void mapping(Mapper map) {
map('message', message, (v) => message = v);
map<T>('data', data, (v) => data = v);
}
}
and also register it in mappable factories
Mappable.factories = {
BaseResponses: () => BaseResponses(),
};
I try to convert json to BaseResponses which T is another class model, on this case is Customer.
But when I try to call it like this:
BaseResponses<T> baseResponses = Mapper.fromJson(responseData).toObject<BaseResponses<T>>();
I got an error its throw execution error with message:
BaseResponses<Customer>is not defined in Reflection.factories
james-bay and makcmatveev
Metadata
Metadata
Assignees
Labels
No labels