18 lines
557 B
Dart
18 lines
557 B
Dart
import 'package:kursach/data/dtos/artists_dto.dart';
|
|
import 'package:kursach/domain/models/card_data.dart';
|
|
import 'package:kursach/domain/models/home_data.dart';
|
|
|
|
extension ArtistDataDtoToModel on ArtistDataDto {
|
|
CardData toDomain() => CardData(
|
|
id: id,
|
|
name: name ?? "UNKNOWN",
|
|
image: "http://10.0.2.2:8080${image}",
|
|
year_streams: year_streams ?? 0);
|
|
}
|
|
|
|
extension ArtistsDtoToModel on ArtistsDto {
|
|
HomeData toDomain() => HomeData(
|
|
data: data?.map((e) => e.toDomain()).toList(),
|
|
nextPage: meta?.pagination?.next);
|
|
}
|