toEntity<R extends BaseEntity> method
Implementation
@override
R? toEntity<R extends BaseEntity>() {
dynamic data = body;
if (body.runtimeType == String) data = json.decode(body);
if (body is List) {
List<T> entities =
List<T>.from(data.map((model) => getInstance<R>(data)));
return entities as R;
}
return getInstance<R>(data);
}