13 lines
450 B
Dart
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'
|
|
);
|
|
} |