Skip to content

Commit

Permalink
Handel Video Error
Browse files Browse the repository at this point in the history
Handel Video Error
  • Loading branch information
Mahmoud-Abdelaty committed Mar 18, 2024
1 parent c24bdf4 commit b318917
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/features/lessons_details_view/data/lesson_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -15,12 +17,24 @@ class AppBarComponent extends StatelessWidget implements PreferredSizeWidget {
child: BlocBuilder<LessonsCubit, LessonsState>(
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) {
Expand Down
9 changes: 6 additions & 3 deletions lib/features/quiz/view/quiz_report_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -136,8 +138,9 @@ class QuizReportView extends StatelessWidget {
iconSize: 14.sp,
),
);
} else
} else {
return const Center(child: CircularProgressIndicator());
}
}),
);
}
Expand Down

0 comments on commit b318917

Please sign in to comment.