11 lines
485 B
Dart
11 lines
485 B
Dart
import '../dtos/houses_dto.dart';
|
|
import 'package:pmd/models/card_data.dart';
|
|
|
|
extension HouseDataDtoToModel on HouseDataDto {
|
|
CardData toDomain() => CardData(
|
|
name: attributes?.name ?? "UNKNOWN",
|
|
location: attributes?.location ?? "UNKNOWN", // Безопасный доступ к location
|
|
image: attributes?.image ?? "https://upload.wikimedia.org/wikipedia/commons/a/a2/Person_Image_Placeholder.png",
|
|
description: attributes?.description ?? "UNKNOWN"
|
|
);
|
|
} |