diff --git a/lib/features/lessons_details_view/data/lesson_model.dart b/lib/features/lessons_details_view/data/lesson_model.dart index f11988c..26f2b6b 100644 --- a/lib/features/lessons_details_view/data/lesson_model.dart +++ b/lib/features/lessons_details_view/data/lesson_model.dart @@ -5,7 +5,7 @@ class LessonModel { final int courseId; final String image; final String description; - final String videoUrl; + final String? videoUrl; final int isFree; final String zoomCode; final String zoomPassword; diff --git a/lib/features/lessons_details_view/views/widgets/app_bar_component.dart b/lib/features/lessons_details_view/views/widgets/app_bar_component.dart index 628cfbf..52bacc9 100644 --- a/lib/features/lessons_details_view/views/widgets/app_bar_component.dart +++ b/lib/features/lessons_details_view/views/widgets/app_bar_component.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -15,12 +17,24 @@ class AppBarComponent extends StatelessWidget implements PreferredSizeWidget { child: BlocBuilder( builder: (context, state) { if (state is LessonsSuccess) { + log(state.lesson.videoUrl.toString(), name: 'URL'); return AppBar( automaticallyImplyLeading: false, backgroundColor: AppColors.violet50, flexibleSpace: FlexibleSpaceBar( collapseMode: CollapseMode.pin, - background: VideoPlayerWidget(videoUrl: state.lesson.videoUrl), + background: state.lesson.videoUrl!.isNotEmpty && + state.lesson.videoUrl != null + ? VideoPlayerWidget(videoUrl: state.lesson.videoUrl!) + : Center( + child: Text( + 'Video Not Found', + style: TextStyle( + color: AppColors.error900, + fontSize: 25.sp, + fontWeight: FontWeight.w600, + ), + )), ), ); } else if (state is LessonsInitial) { diff --git a/lib/features/quiz/view/quiz_report_view.dart b/lib/features/quiz/view/quiz_report_view.dart index 2604402..531a749 100644 --- a/lib/features/quiz/view/quiz_report_view.dart +++ b/lib/features/quiz/view/quiz_report_view.dart @@ -123,10 +123,12 @@ class QuizReportView extends StatelessWidget { ], ), floatingActionButton: PrimaryButton( - onTap: () {}, + onTap: () { + NavigationHelper.navigateTo(AppRoute.HOME); + }, height: 45.h, width: 137.w, - text: 'Quiz Report', + text: 'Go To Home', fontWeight: FontWeight.w400, fontSize: 14.sp, borderRadius: 40.r, @@ -136,8 +138,9 @@ class QuizReportView extends StatelessWidget { iconSize: 14.sp, ), ); - } else + } else { return const Center(child: CircularProgressIndicator()); + } }), ); }