2024-10-28 16:20:50 +04:00
|
|
|
import 'package:mylab/data/dtos/car_dto.dart';
|
|
|
|
import 'package:mylab/domain/models/car.dart';
|
|
|
|
|
|
|
|
const _imagePlaceholder =
|
|
|
|
'https://upload.wikimedia.org/wikipedia/en/archive/b/b1/20210811082420%21Portrait_placeholder.png';
|
|
|
|
|
2024-12-11 13:10:34 +04:00
|
|
|
extension CarDataDtoToModel on CarResultDto {
|
2024-10-28 16:20:50 +04:00
|
|
|
CarData toDomain() => CarData(
|
2024-12-11 13:10:34 +04:00
|
|
|
attributes?.modelid ?? 'UNKNOWN',
|
|
|
|
imageUrl: _imagePlaceholder,
|
|
|
|
descriptionCar: '${attributes?.makename}, ${attributes?.modelname}'
|
2024-10-28 16:20:50 +04:00
|
|
|
);
|
|
|
|
}
|