18 lines
543 B
Dart
Raw Permalink Normal View History

2024-12-11 17:49:42 +04:00
import 'package:flutter/material.dart';
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 =
2024-12-11 17:49:42 +04:00
'https://avatars.mds.yandex.net/i?id=d8136fe8562de785a003fa49a2a07a3d_l-4507854-images-thumbs&n=13';
2024-10-28 16:20:50 +04:00
2024-12-11 17:49:42 +04:00
extension CarAttributesResultDtoToModel on CarAttributesResultDto {
2024-10-28 16:20:50 +04:00
CarData toDomain() => CarData(
2024-12-11 17:49:42 +04:00
modelName ?? 'unknown',
descriptionCar: 'ID: $modelID \n'
'Marka: $makeName \n'
'Model: $modelName',
imageUrl: _imagePlaceholder
2024-10-28 16:20:50 +04:00
);
2024-12-11 17:49:42 +04:00
}