PIbd-32_Stroev_V_M_PMD/lib/data/mapper/CharacterDataDtoModel.dart
2024-10-22 08:55:54 +04:00

13 lines
450 B
Dart

import 'package:labs/data/dtos/characters_dto.dart';
import 'package:labs/domain/models/Student.dart';
extension CharacterDataDtoToModel on CharacterDataDto{
Student toDomain() => Student(
attributes?.name ?? 'Undefined',
int.parse(attributes?.age ?? '-1'),
attributes?.courses ?? ['Undefined'],
image: attributes?.image ?? 'https://gryazoveckij-r19.gosweb.gosuslugi.ru/netcat_files/460/2008/net_foto_muzh.jpg'
);
}