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 {
|
||||
CardData toDomain() => CardData(
|
||||
attributes?.name ?? 'UNKNOWN',
|
||||
imgUrl: attributes?.image ?? _imagePlaceholder,
|
||||
img: attributes?.image ?? _imagePlaceholder,
|
||||
description: _makeDescription(attributes?.born, attributes?.died),
|
||||
id: id,
|
||||
);
|
||||
|
@ -1,13 +1,13 @@
|
||||
class CardData {
|
||||
final String text;
|
||||
final String name;
|
||||
final String description;
|
||||
final String? imgUrl;
|
||||
final String? img;
|
||||
final String? id;
|
||||
|
||||
CardData(
|
||||
this.text, {
|
||||
this.name, {
|
||||
required this.description,
|
||||
this.imgUrl,
|
||||
this.img,
|
||||
this.id,
|
||||
});
|
||||
}
|
||||
|
@ -16,13 +16,13 @@ class DetailsPage extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Image.network(
|
||||
data.imgUrl ?? '',
|
||||
data.img ?? '',
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
child: Text(
|
||||
data.text,
|
||||
data.name,
|
||||
style: Theme.of(context).textTheme.headlineLarge,
|
||||
),
|
||||
),
|
||||
|
@ -28,9 +28,9 @@ class _Card extends StatelessWidget {
|
||||
bool isLiked = false,
|
||||
}) =>
|
||||
_Card(
|
||||
data.text,
|
||||
data.name,
|
||||
description: data.description,
|
||||
imgUrl: data.imgUrl,
|
||||
imgUrl: data.img,
|
||||
onLike: onLike,
|
||||
onTap: onTap,
|
||||
isLiked: isLiked,
|
||||
|
Loading…
x
Reference in New Issue
Block a user