76 return SingleChildScrollView(
79 crossAxisAlignment: CrossAxisAlignment.start,
85 style: Theme.of(context).textTheme.displayMedium,
87 SizedBox(height: 8.r),
90 style: Theme.of(context).textTheme.bodyMedium?.copyWith(
91 color: Theme.of(context).hintColor,
97 decoration: BoxDecoration(
98 color: Theme.of(context).colorScheme.surface,
99 borderRadius: BorderRadius.circular(16),
101 margin: EdgeInsets.symmetric(vertical: 16.sp),
102 padding: EdgeInsets.all(15.sp),
104 crossAxisAlignment: CrossAxisAlignment.start,
108 Icon(HugeIcons.strokeRoundedProgress02, size: 20),
109 SizedBox(width: 7.sp),
112 style: Theme.of(context).textTheme.bodyLarge?.copyWith(
113 fontWeight: FontWeight.bold,
118 SizedBox(height: 12.r),
119 LinearProgressIndicator(
123 valueColor: AlwaysStoppedAnimation<Color>(
126 borderRadius: BorderRadius.circular(4.r),
129 SizedBox(height: 8.r),
131 alignment: Alignment.centerRight,
132 child: Text(
'${(course.progress! * 100).toInt()}%',
133 style: Theme.of(context).textTheme.displaySmall?.copyWith(
145 style: Theme.of(context).textTheme.bodyLarge,
147 SizedBox(height: 16.r),
155 'Read through the PDF material to understand the concepts'),
159 Routes.pdfViewerScreen.route,
161 'pdfPath': course.pdfPath,
162 'courseId': course.id,
163 'onComplete': (double progress) {
164 if (course.progress! < 0.5) {
165 context.read<ElearningV2Cubit>().updateProgress(
175 SizedBox(height: 16.r),
180 .translate(
'Step 2: Test Your Knowledge'),
182 .translate(
'Complete the quiz to test your understanding'),
184 course.progress! <= 0.5 ? 0.0 : (
course.progress! - 0.5) * 2,
185 isDisabled:
course.progress! < 0.5,
187 if (course.progress! >= 0.5) {
191 builder: (context) => QcmScreen(
192 courseId: course.id!,
193 currentProgress: course.progress!,
194 onComplete: (double quizScore) {
196 final newProgress = 0.5 + (quizScore * 0.5);
197 context.read<ElearningV2Cubit>().updateProgress(
214 required String
title,
215 required String description,
217 required VoidCallback
onTap,
218 required Color
color,
219 bool isDisabled =
false,
221 return GestureDetector(
224 decoration: BoxDecoration(
225 color: Theme.of(context).colorScheme.surface,
226 borderRadius: BorderRadius.circular(16.r),
229 ? Theme.of(context).dividerColor
230 :
color.withOpacity(0.3),
240 decoration: BoxDecoration(
242 ? Theme.of(context).disabledColor.withOpacity(0.1)
243 :
color.withOpacity(0.1),
244 shape: BoxShape.circle,
247 HugeIcons.strokeRoundedLegalDocument01,
248 color: isDisabled ? Theme.of(context).disabledColor :
color,
252 SizedBox(width: 12.r),
255 crossAxisAlignment: CrossAxisAlignment.start,
259 style: Theme.of(context).textTheme.titleMedium?.copyWith(
260 fontWeight: FontWeight.bold,
262 ? Theme.of(context).disabledColor
263 : Theme.of(context).textTheme.titleMedium?.color,
266 SizedBox(height: 4.r),
269 style: Theme.of(context).textTheme.bodyMedium?.copyWith(
271 ? Theme.of(context).hintColor.withOpacity(0.3)
272 : ColorPaletteV2.textSecondaryLight,
275 overflow: TextOverflow.ellipsis,
289 hexColor = hexColor.replaceAll(
'#',
'');
290 if (hexColor.length == 6) {
291 hexColor =
'FF$hexColor';
293 return Color(
int.parse(hexColor, radix: 16));
295 return Theme.of(context).colorScheme.primary;
Widget _buildLearningStep({ required String title, required String description, required double progress, required VoidCallback onTap, required Color color, bool isDisabled=false, })