PMU_Salin_Oleg_PIbd-33/lib/data/mappers/codeforcer_mapper.dart
gg12 darfren 41b475ed64 lab5
2024-10-02 13:05:39 +04:00

13 lines
433 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:pmu_project/data/dtos/codeforcer_dto.dart';
import 'package:pmu_project/domain/models/card.dart';
extension CodeforcerDtoToModel on CodeforcerDto {
CardData toDomain() => CardData(
this?.handle ?? 'BEBRA',
rank: this?.rank ?? 'Не в рейтинге',
maxRank: this?.maxRank ?? 'Не в рейтинге',
rating: this?.rating ?? 0,
imageUrl: this?.titlePhoto,
);
}