begin
This commit is contained in:
parent
d2237434ee
commit
386c3087b0
@ -7,7 +7,7 @@ const _imagePlaceholder = 'https://cdn-icons-png.flaticon.com/512/4054/4054617.p
|
|||||||
extension CharacterDataDtoToModel on CharactersDataDto {
|
extension CharacterDataDtoToModel on CharactersDataDto {
|
||||||
CardData toDomain() => CardData(
|
CardData toDomain() => CardData(
|
||||||
attributes?.name ?? 'UNKNOWN',
|
attributes?.name ?? 'UNKNOWN',
|
||||||
imgUrl: attributes?.image ?? _imagePlaceholder,
|
img: attributes?.image ?? _imagePlaceholder,
|
||||||
description: _makeDescription(attributes?.born, attributes?.died),
|
description: _makeDescription(attributes?.born, attributes?.died),
|
||||||
id: id,
|
id: id,
|
||||||
);
|
);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
class CardData {
|
class CardData {
|
||||||
final String text;
|
final String name;
|
||||||
final String description;
|
final String description;
|
||||||
final String? imgUrl;
|
final String? img;
|
||||||
final String? id;
|
final String? id;
|
||||||
|
|
||||||
CardData(
|
CardData(
|
||||||
this.text, {
|
this.name, {
|
||||||
required this.description,
|
required this.description,
|
||||||
this.imgUrl,
|
this.img,
|
||||||
this.id,
|
this.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,13 @@ class DetailsPage extends StatelessWidget {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
data.imgUrl ?? '',
|
data.img ?? '',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 4),
|
padding: const EdgeInsets.only(bottom: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
data.text,
|
data.name,
|
||||||
style: Theme.of(context).textTheme.headlineLarge,
|
style: Theme.of(context).textTheme.headlineLarge,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -28,9 +28,9 @@ class _Card extends StatelessWidget {
|
|||||||
bool isLiked = false,
|
bool isLiked = false,
|
||||||
}) =>
|
}) =>
|
||||||
_Card(
|
_Card(
|
||||||
data.text,
|
data.name,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
imgUrl: data.imgUrl,
|
imgUrl: data.img,
|
||||||
onLike: onLike,
|
onLike: onLike,
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
isLiked: isLiked,
|
isLiked: isLiked,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user