From 43d66bd652a499f54b0a7325a1ce16a10174eed4 Mon Sep 17 00:00:00 2001 From: Naresh Pratista <2141720057@student.polinema.ac.id> Date: Tue, 26 Nov 2024 10:32:57 +0700 Subject: [PATCH] fix: add nullable thumbnail completed topics in model and progress card --- lib/features/home/models/completed_topics_model.dart | 4 ++-- lib/features/home/widgets/progress_card.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/features/home/models/completed_topics_model.dart b/lib/features/home/models/completed_topics_model.dart index b0d2eac..b7df31d 100644 --- a/lib/features/home/models/completed_topics_model.dart +++ b/lib/features/home/models/completed_topics_model.dart @@ -2,7 +2,7 @@ class CompletedTopic { final String idSection; final String nameSection; final String descriptionSection; - final String thumbnail; + final String? thumbnail; final int totalTopics; final int completedTopics; @@ -10,7 +10,7 @@ class CompletedTopic { required this.idSection, required this.nameSection, required this.descriptionSection, - required this.thumbnail, + this.thumbnail, required this.totalTopics, required this.completedTopics, }); diff --git a/lib/features/home/widgets/progress_card.dart b/lib/features/home/widgets/progress_card.dart index 69aa711..d528218 100644 --- a/lib/features/home/widgets/progress_card.dart +++ b/lib/features/home/widgets/progress_card.dart @@ -115,7 +115,7 @@ class ProgressCard extends StatelessWidget { ClipRRect( borderRadius: BorderRadius.circular(8), child: Image.network( - _getFullImageUrl(topic.thumbnail), + _getFullImageUrl(topic.thumbnail ?? ''), width: 90, height: 130, fit: BoxFit.cover,