diff --git a/lib/app/app.dart b/lib/app/app.dart index fca7101..6cd9164 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -52,6 +52,7 @@ import 'package:yimaru_app/services/in_app_update_service.dart'; import 'package:yimaru_app/ui/views/learn_program/learn_program_view.dart'; import 'package:yimaru_app/ui/views/learn_course/learn_course_view.dart'; import 'package:yimaru_app/ui/views/assessment/assessment_view.dart'; +import 'package:yimaru_app/services/vimeo_service.dart'; // @stacked-import @StackedApp( @@ -112,6 +113,7 @@ import 'package:yimaru_app/ui/views/assessment/assessment_view.dart'; LazySingleton(classType: AudioPlayerService), LazySingleton(classType: VoiceRecorderService), LazySingleton(classType: InAppUpdateService), + LazySingleton(classType: VimeoService), // @stacked-service ], bottomsheets: [ diff --git a/lib/app/app.locator.dart b/lib/app/app.locator.dart index 2b0bbc7..1f65354 100644 --- a/lib/app/app.locator.dart +++ b/lib/app/app.locator.dart @@ -26,6 +26,7 @@ import '../services/permission_handler_service.dart'; import '../services/secure_storage_service.dart'; import '../services/smart_auth_service.dart'; import '../services/status_checker_service.dart'; +import '../services/vimeo_service.dart'; import '../services/voice_recorder_service.dart'; final locator = StackedLocator.instance; @@ -55,4 +56,5 @@ Future setupLocator( locator.registerLazySingleton(() => AudioPlayerService()); locator.registerLazySingleton(() => VoiceRecorderService()); locator.registerLazySingleton(() => InAppUpdateService()); + locator.registerLazySingleton(() => VimeoService()); } diff --git a/lib/services/vimeo_service.dart b/lib/services/vimeo_service.dart new file mode 100644 index 0000000..e45a0a7 --- /dev/null +++ b/lib/services/vimeo_service.dart @@ -0,0 +1,85 @@ +import 'dart:convert'; + +import 'package:http/http.dart' as http; + +class VimeoService { + Future getVideoUrl(String vimeoUrl) async { + final videoId = _extractVideoId(vimeoUrl); + + if (videoId == null) { + throw Exception('Invalid Vimeo URL'); + } + + final html = await _fetchHtml(videoId); + + final config = _extractConfig(html); + + if (config == null) { + throw Exception('Failed to extract Vimeo config'); + } + + return _extractHlsUrl(config); + } + + Future _fetchHtml(String videoId) async { + final response = await http.get( + Uri.parse('https://player.vimeo.com/video/$videoId'), + headers: { + 'Origin': 'https://vimeo.com', + 'Referer': 'https://vimeo.com/', + 'Accept': 'text/html,application/xhtml+xml', + 'User-Agent': + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', + }, + ); + + return response.body; + } + + static Map? _extractConfig(String html) { + final regex = RegExp( + r'window\.playerConfig\s*=\s*({.*?})\s*', + dotAll: true, + ); + + final match = regex.firstMatch(html); + if (match == null) return null; + + final jsonString = match.group(1); + if (jsonString == null) return null; + + return jsonDecode(jsonString); + } + + String? _extractHlsUrl(Map config) { + try { + final files = config['request']?['files']; + final hls = files?['hls']; + + if (hls == null) return null; + + final cdns = hls['cdns'] as Map; + + // Prefer fastly_skyfire or fallback to first CDN + final cdn = cdns['fastly_skyfire'] ?? cdns.values.first; + + return cdn['url']; + } catch (_) { + return null; + } + } + + String? _extractVideoId(String url) { + try { + final uri = Uri.parse(url); + + if (uri.pathSegments.isNotEmpty) { + return uri.pathSegments.last; + } + + return null; + } catch (_) { + return null; + } + } +} diff --git a/lib/ui/common/helper_functions.dart b/lib/ui/common/helper_functions.dart index b132ff2..b0d8aa9 100644 --- a/lib/ui/common/helper_functions.dart +++ b/lib/ui/common/helper_functions.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:math'; import 'dart:ui'; diff --git a/lib/ui/common/ui_helpers.dart b/lib/ui/common/ui_helpers.dart index f6ffad4..0318ae6 100644 --- a/lib/ui/common/ui_helpers.dart +++ b/lib/ui/common/ui_helpers.dart @@ -312,9 +312,8 @@ TextStyle style14MG400 = const TextStyle( TextStyle style14DG500 = const TextStyle(color: kcDarkGrey, fontWeight: FontWeight.w500); -TextStyle style18MG500 = -const TextStyle(fontSize: 18,color: kcMediumGrey, fontWeight: FontWeight.w500); - +TextStyle style18MG500 = const TextStyle( + fontSize: 18, color: kcMediumGrey, fontWeight: FontWeight.w500); TextStyle style14DG400 = const TextStyle( color: kcDarkGrey, diff --git a/lib/ui/views/assessment/assessment_viewmodel.dart b/lib/ui/views/assessment/assessment_viewmodel.dart index 785581f..32c8e36 100644 --- a/lib/ui/views/assessment/assessment_viewmodel.dart +++ b/lib/ui/views/assessment/assessment_viewmodel.dart @@ -69,17 +69,17 @@ class AssessmentViewModel extends BaseViewModel { Map get userData => _userData; // Assessment - Future setFirstAssessment()async{ + Future setFirstAssessment() async { _proficiencyLevel = null; _selectedAnswers.clear(); _currentQuestionIndex = 0; _pageController.jumpToPage(_currentQuestionIndex); - _currentAssessment = assessments[currentAssessmentIndex]; - await getAssessmentQuestions( - _currentAssessment?.id ?? 0); + _currentAssessment = assessments[currentAssessmentIndex]; + await getAssessmentQuestions(_currentAssessment?.id ?? 0); next(); } + Map evaluateAssessment() { bool levelPassed = canPassLevel(); if (levelPassed) { @@ -165,9 +165,8 @@ class AssessmentViewModel extends BaseViewModel { _selectedAnswers.clear(); _currentQuestionIndex = 0; _proficiencyLevel = response['level']; - _currentAssessment = assessments[currentAssessmentIndex]; - await getAssessmentQuestions( - _currentAssessment?.id ?? 0); + _currentAssessment = assessments[currentAssessmentIndex]; + await getAssessmentQuestions(_currentAssessment?.id ?? 0); _pageController.jumpToPage(_currentQuestionIndex); } else { _proficiencyLevel = response['level']; @@ -274,9 +273,8 @@ class AssessmentViewModel extends BaseViewModel { } // Assessments - Future getAssessments() async => - await runBusyFuture(_getAssessments(), - busyObject: StateObjects.assessments); + Future getAssessments() async => await runBusyFuture(_getAssessments(), + busyObject: StateObjects.assessments); Future _getAssessments() async { if (await _statusChecker.checkConnection()) { diff --git a/lib/ui/views/assessment/screens/assessment_questions_screen.dart b/lib/ui/views/assessment/screens/assessment_questions_screen.dart index 09ef464..c89c26c 100644 --- a/lib/ui/views/assessment/screens/assessment_questions_screen.dart +++ b/lib/ui/views/assessment/screens/assessment_questions_screen.dart @@ -139,7 +139,8 @@ class AssessmentQuestionsScreen extends ViewModelWidget { onTap: viewModel.selectedAnswers.containsKey(question.toString()) ? () => viewModel.nextQuestion() : null, - text: viewModel.currentQuestionIndex == viewModel.assessmentQuestions.length - 1 + text: viewModel.currentQuestionIndex == + viewModel.assessmentQuestions.length - 1 ? 'Finish Level' : 'Continue', ); diff --git a/lib/ui/views/assessment/screens/assessment_result_screen.dart b/lib/ui/views/assessment/screens/assessment_result_screen.dart index 26ce96b..638e6ff 100644 --- a/lib/ui/views/assessment/screens/assessment_result_screen.dart +++ b/lib/ui/views/assessment/screens/assessment_result_screen.dart @@ -86,9 +86,7 @@ class AssessmentResultScreen extends ViewModelWidget { ); Widget _buildIconWrapper(AssessmentViewModel viewModel) => - viewModel.proficiencyLevel != null - ? _buildIcon(viewModel) - : Container(); + viewModel.proficiencyLevel != null ? _buildIcon(viewModel) : Container(); Widget _buildIcon(AssessmentViewModel viewModel) => SvgPicture.asset( 'assets/icons/${viewModel.proficiencyLevel?.substring(0, 1).toLowerCase()}_${viewModel.proficiencyLevel?.substring(1).toLowerCase()}.svg'); diff --git a/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart b/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart index 261a808..e28e4ab 100644 --- a/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart +++ b/lib/ui/views/learn_lesson_detail/learn_lesson_detail_view.dart @@ -1,11 +1,14 @@ +import 'package:chewie/chewie.dart'; import 'package:flutter/material.dart'; import 'package:stacked/stacked.dart'; import 'package:vimeo_video_player/vimeo_video_player.dart'; import 'package:yimaru_app/models/learn_lesson.dart'; import '../../common/app_colors.dart'; +import '../../common/enmus.dart'; import '../../common/ui_helpers.dart'; import '../../widgets/custom_elevated_button.dart'; +import '../../widgets/empty_video_player.dart'; import '../../widgets/small_app_bar.dart'; import 'learn_lesson_detail_viewmodel.dart'; @@ -20,6 +23,12 @@ class LearnLessonDetailView extends StackedView { await viewModel.navigateToLearnPractice(lesson.id ?? 0); } + @override + void onViewModelReady(LearnLessonDetailViewModel viewModel) async { + await viewModel.initializePlayer(lesson.videoUrl ?? ''); + super.onViewModelReady(viewModel); + } + @override void onDispose(LearnLessonDetailViewModel viewModel) { viewModel.close(); @@ -120,19 +129,23 @@ class LearnLessonDetailView extends StackedView { height: 200, color: kcBlack, width: double.maxFinite, - child: _buildVideoPlayer(viewModel), + child: _buildVideoPlayerState(viewModel), ); + Widget _buildVideoPlayerState(LearnLessonDetailViewModel viewModel) => + viewModel.chewieController != null && + viewModel.videoPlayerController != null && + !viewModel.busy(StateObjects.loadLessonVideo) + ? _buildVideoPlayer(viewModel) + : _buildEmptyVideoPlayer(); + Widget _buildVideoPlayer(LearnLessonDetailViewModel viewModel) => - _buildVimeoPlayer(viewModel); + _buildChewiePlayer(viewModel); - Widget _buildVimeoPlayer(LearnLessonDetailViewModel viewModel) => - VimeoVideoPlayer( - isAutoPlay: true, - onInAppWebViewCreated: (controller) => - viewModel.initializePlayer(controller), - videoId: lesson.videoUrl?.split('/').last ?? '', - ); + Widget _buildChewiePlayer(LearnLessonDetailViewModel viewModel) => + Chewie(controller: viewModel.chewieController!); + + Widget _buildEmptyVideoPlayer() => const EmptyVideoPlayer(); Widget _buildDescriptionWrapper() => Padding( padding: const EdgeInsets.symmetric(horizontal: 15), diff --git a/lib/ui/views/learn_lesson_detail/learn_lesson_detail_viewmodel.dart b/lib/ui/views/learn_lesson_detail/learn_lesson_detail_viewmodel.dart index 697ca6f..defc758 100644 --- a/lib/ui/views/learn_lesson_detail/learn_lesson_detail_viewmodel.dart +++ b/lib/ui/views/learn_lesson_detail/learn_lesson_detail_viewmodel.dart @@ -1,45 +1,67 @@ +import 'package:chewie/chewie.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; +import 'package:video_player/video_player.dart'; import 'package:yimaru_app/ui/common/enmus.dart'; import '../../../app/app.locator.dart'; import '../../../app/app.router.dart'; import '../../../services/status_checker_service.dart'; +import '../../../services/vimeo_service.dart'; +import '../../common/app_constants.dart'; +import '../../common/helper_functions.dart'; +import '../../common/ui_helpers.dart'; class LearnLessonDetailViewModel extends BaseViewModel { // Dependency injection - final _statusChecker = locator(); + final _vimeoService = locator(); final _navigationService = locator(); // Video player config - InAppWebViewController? _webViewController; + ChewieController? _chewieController; - InAppWebViewController? get webViewController => _webViewController; + ChewieController? get chewieController => _chewieController; + + VideoPlayerController? _videoPlayerController; + + VideoPlayerController? get videoPlayerController => _videoPlayerController; // Video player void close() { - webViewController?.dispose(); + _videoPlayerController?.dispose(); + _chewieController?.dispose(); } Future pause() async { - await webViewController?.pause(); + await _chewieController?.pause(); } - void initializePlayer(InAppWebViewController controller) { - _webViewController = controller; - rebuildUi(); - } + Future initializePlayer(String url) async => + await runBusyFuture(_initializePlayer(url), + busyObject: StateObjects.loadLessonVideo); - void onLoadVideoStart() { - setBusyForObject(StateObjects.loadLessonVideo, true); - rebuildUi(); - } + Future _initializePlayer(String url) async { + final playableUrl = await _vimeoService.getVideoUrl(url); - void onLoadVideoComplete() { - setBusyForObject(StateObjects.loadLessonVideo, false); - rebuildUi(); + if (playableUrl == null) { + throw Exception("Unable to load video"); + } + + _videoPlayerController = + VideoPlayerController.networkUrl(Uri.parse(playableUrl)); + + await _videoPlayerController?.initialize(); + + _chewieController = ChewieController( + videoPlayerController: _videoPlayerController!, + autoPlay: true, + looping: true, + aspectRatio: 16 / 9, + ); + + notifyListeners(); } // Navigation diff --git a/lib/ui/views/learn_practice/learn_practice_view.dart b/lib/ui/views/learn_practice/learn_practice_view.dart index c9ebcd2..bba573d 100644 --- a/lib/ui/views/learn_practice/learn_practice_view.dart +++ b/lib/ui/views/learn_practice/learn_practice_view.dart @@ -61,10 +61,10 @@ class LearnPracticeView extends StackedView { canPop: false, onPopInvokedWithResult: (didPop, data) { if (!didPop) { - Future.microtask(()async =>await _showSheet(context: context, viewModel: viewModel)); + Future.microtask(() async => + await _showSheet(context: context, viewModel: viewModel)); } }, - child: _buildScaffoldWrapper(viewModel)); Widget _buildSheet(LearnPracticeViewModel viewModel) => diff --git a/lib/ui/views/learn_practice/learn_practice_viewmodel.dart b/lib/ui/views/learn_practice/learn_practice_viewmodel.dart index 6b90c40..efe96fe 100644 --- a/lib/ui/views/learn_practice/learn_practice_viewmodel.dart +++ b/lib/ui/views/learn_practice/learn_practice_viewmodel.dart @@ -64,7 +64,6 @@ class LearnPracticeViewModel extends ReactiveViewModel { return _position.inMilliseconds / _duration.inMilliseconds; } - // Voice recorder WaveformRecorderController get _waveController => _voiceRecorderService.waveController; @@ -129,12 +128,12 @@ class LearnPracticeViewModel extends ReactiveViewModel { // Play practice audio void _listenToAudio() { - _audioPlayerService.durationStream.listen((dur) { - if (dur.inMilliseconds > 0) { - _duration = dur; - rebuildUi(); - } - }); + _audioPlayerService.durationStream.listen((dur) { + if (dur.inMilliseconds > 0) { + _duration = dur; + rebuildUi(); + } + }); _audioPlayerService.positionStream.listen((pos) { _position = pos; diff --git a/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart b/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart index ef15c2c..12fb51d 100644 --- a/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart +++ b/lib/ui/views/learn_practice/screens/interact_learn_practice_screen.dart @@ -28,8 +28,8 @@ class InteractLearnPracticeScreen await viewModel.stopRecording(); viewModel.pop(); viewModel.pop(); - } + void _reply(LearnPracticeViewModel viewModel) => viewModel.replayVoicePrompt(question); @@ -164,10 +164,10 @@ class InteractLearnPracticeScreen ? Container() : viewModel.player.state == PlayerState.playing ? _buildSpinner() - : VoiceRecordingState.recording == viewModel.recordingState && - viewModel.waveController.isRecording - ? _buildSpeakingSpinnerColumn(viewModel) - : Container(); + : VoiceRecordingState.recording == viewModel.recordingState && + viewModel.waveController.isRecording + ? _buildSpeakingSpinnerColumn(viewModel) + : Container(); Widget _buildSpeakingSpinnerColumn(LearnPracticeViewModel viewModel) => Column( @@ -359,8 +359,7 @@ class InteractLearnPracticeScreen onClose: viewModel.pop, onContinue: viewModel.pop, user: viewModel.user?.firstName ?? '', - onCancel: ()async => await _cancel(viewModel), - + onCancel: () async => await _cancel(viewModel), ); Widget _buildProgressIndicatorState(LearnPracticeViewModel viewModel) => diff --git a/lib/ui/views/learn_practice/screens/learn_loading_screen.dart b/lib/ui/views/learn_practice/screens/learn_loading_screen.dart index 55e1d03..ffc67b3 100644 --- a/lib/ui/views/learn_practice/screens/learn_loading_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_loading_screen.dart @@ -56,9 +56,11 @@ class LearnLoadingScreen extends StatelessWidget { Widget _buildPageIndicator() => const PageLoadingIndicator(); - Widget _buildRefreshButtonWrapper() => Align( - alignment: Alignment.center, - child:_buildRefreshButton()); + Widget _buildRefreshButtonWrapper() => + Align(alignment: Alignment.center, child: _buildRefreshButton()); - Widget _buildRefreshButton()=> NoDataIndicator(title:'No practice available!' ,onTap: onTap,); + Widget _buildRefreshButton() => NoDataIndicator( + title: 'No practice available!', + onTap: onTap, + ); } diff --git a/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart index e2fc0fa..8810991 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_intro_screen.dart @@ -16,7 +16,6 @@ class LearnPracticeIntroScreen extends ViewModelWidget { await viewModel.stopRecording(); viewModel.pop(); viewModel.pop(); - } Future _showSheet( @@ -82,8 +81,7 @@ class LearnPracticeIntroScreen extends ViewModelWidget { onClose: viewModel.pop, onContinue: viewModel.pop, user: viewModel.user?.firstName ?? '', - onCancel: ()async => await _cancel(viewModel), - + onCancel: () async => await _cancel(viewModel), ); Widget _buildBodyColumnWrapper(LearnPracticeViewModel viewModel) => Expanded( diff --git a/lib/ui/views/learn_practice/screens/learn_practice_questions_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_questions_screen.dart index 46362e2..4831a61 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_questions_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_questions_screen.dart @@ -40,7 +40,8 @@ class LearnPracticeQuestionsScreen required LearnQuestion question, }) => [ - if(index ==1) _buildStartLearnPracticeScreen(index: index, question: question), + if (index == 1) + _buildStartLearnPracticeScreen(index: index, question: question), _buildInteractLearnPracticeScreen(index: index, question: question) ]; diff --git a/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart b/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart index 6b6ed57..7758781 100644 --- a/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart +++ b/lib/ui/views/learn_practice/screens/learn_practice_result_screen.dart @@ -23,7 +23,6 @@ class LearnPracticeResultScreen await viewModel.stopRecording(); viewModel.pop(); viewModel.pop(); - } Future _showSheet( @@ -96,7 +95,7 @@ class LearnPracticeResultScreen onClose: viewModel.pop, onContinue: viewModel.pop, user: viewModel.user?.firstName ?? '', - onCancel: ()async => await _cancel(viewModel), + onCancel: () async => await _cancel(viewModel), ); Widget _buildBodyWrapper(LearnPracticeViewModel viewMode) => Expanded( diff --git a/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart b/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart index e827efa..8cd80f4 100644 --- a/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart +++ b/lib/ui/views/learn_practice/screens/start_learn_practice_screen.dart @@ -20,7 +20,6 @@ class StartLearnPracticeScreen extends ViewModelWidget { await viewModel.stopRecording(); viewModel.pop(); viewModel.pop(); - } void _start(LearnPracticeViewModel viewModel) { @@ -107,7 +106,7 @@ class StartLearnPracticeScreen extends ViewModelWidget { onClose: viewModel.pop, onContinue: viewModel.pop, user: viewModel.user?.firstName ?? '', - onCancel: ()async => await _cancel(viewModel), + onCancel: () async => await _cancel(viewModel), ); Widget _buildStartButtonWrapper(LearnPracticeViewModel viewModel) => Expanded( diff --git a/lib/ui/views/profile/profile_view.dart b/lib/ui/views/profile/profile_view.dart index cf28032..12c8e31 100644 --- a/lib/ui/views/profile/profile_view.dart +++ b/lib/ui/views/profile/profile_view.dart @@ -155,7 +155,7 @@ class ProfileView extends StackedView { children: _buildSettingsChildren(viewModel)); List _buildSettingsChildren(ProfileViewModel viewModel) => [ - // _buildDownloadsCard(viewModel), + // _buildDownloadsCard(viewModel), _buildProgressCard(viewModel), _buildAccountCard(viewModel), _buildSupportCard(viewModel) diff --git a/lib/ui/views/startup/startup_viewmodel.dart b/lib/ui/views/startup/startup_viewmodel.dart index 52c37f1..4ebe791 100644 --- a/lib/ui/views/startup/startup_viewmodel.dart +++ b/lib/ui/views/startup/startup_viewmodel.dart @@ -47,7 +47,8 @@ class StartupViewModel extends ReactiveViewModel { } // Navigation - Future replaceWithFailure() async => await _navigationService.replaceWithFailureView( + Future replaceWithFailure() async => + await _navigationService.replaceWithFailureView( label: 'Check you internet connection', onTap: () async => await _getProfileStatus()); diff --git a/lib/ui/widgets/learn_practice_results_wrapper.dart b/lib/ui/widgets/learn_practice_results_wrapper.dart index 4d00ecd..804f06e 100644 --- a/lib/ui/widgets/learn_practice_results_wrapper.dart +++ b/lib/ui/widgets/learn_practice_results_wrapper.dart @@ -46,5 +46,6 @@ class LearnPracticeResultsWrapper itemBuilder: (context, index) => _buildResult(viewModel.answers[index]), ); - Widget _buildResult(Map answer) => LearnPracticeResultCard(answer: answer); + Widget _buildResult(Map answer) => + LearnPracticeResultCard(answer: answer); } diff --git a/lib/ui/widgets/no_data_indicator.dart b/lib/ui/widgets/no_data_indicator.dart index 8db2b6d..42051bb 100644 --- a/lib/ui/widgets/no_data_indicator.dart +++ b/lib/ui/widgets/no_data_indicator.dart @@ -19,10 +19,9 @@ class NoDataIndicator extends StatelessWidget { ); List _buildColumnChildren() => [ - _buildIconWrapper(), + _buildIconWrapper(), verticalSpaceMedium, _buildTitle(), - ]; Widget _buildTitle() => Text( @@ -31,15 +30,13 @@ class NoDataIndicator extends StatelessWidget { ); Widget _buildIconWrapper() => GestureDetector( - onTap: onTap, - child: _buildIcon(), - ); + onTap: onTap, + child: _buildIcon(), + ); Widget _buildIcon() => const Icon( Icons.replay, size: 75, color: kcPrimaryColor, ); - - } diff --git a/test/helpers/test_helpers.dart b/test/helpers/test_helpers.dart index 7b16b45..3e7bfad 100644 --- a/test/helpers/test_helpers.dart +++ b/test/helpers/test_helpers.dart @@ -17,6 +17,7 @@ import 'package:yimaru_app/services/course_service.dart'; import 'package:yimaru_app/services/audio_player_service.dart'; import 'package:yimaru_app/services/voice_recorder_service.dart'; import 'package:yimaru_app/services/in_app_update_service.dart'; +import 'package:yimaru_app/services/vimeo_service.dart'; // @stacked-import import 'test_helpers.mocks.dart'; @@ -44,6 +45,8 @@ import 'test_helpers.mocks.dart'; MockSpec(onMissingStub: OnMissingStub.returnDefault), MockSpec(onMissingStub: OnMissingStub.returnDefault), MockSpec(onMissingStub: OnMissingStub.returnDefault), + MockSpec(onMissingStub: OnMissingStub.returnDefault), + MockSpec(onMissingStub: OnMissingStub.returnDefault), // @stacked-mock-spec ], ) @@ -66,6 +69,8 @@ void registerServices() { getAndRegisterAudioPlayerService(); getAndRegisterVoiceRecorderService(); getAndRegisterInAppUpdateService(); + getAndRegisterVimeoService(); + getAndRegisterVimeoService(); // @stacked-mock-register } @@ -227,6 +232,13 @@ MockInAppUpdateService getAndRegisterInAppUpdateService() { locator.registerSingleton(service); return service; } + +MockVimeoService getAndRegisterVimeoService() { + _removeRegistrationIfExists(); + final service = MockVimeoService(); + locator.registerSingleton(service); + return service; +} // @stacked-mock-create void _removeRegistrationIfExists() { diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart deleted file mode 100644 index bac2620..0000000 --- a/test/helpers/test_helpers.mocks.dart +++ /dev/null @@ -1,2133 +0,0 @@ -// Mocks generated by Mockito 5.4.6 from annotations -// in yimaru_app/test/helpers/test_helpers.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i9; -import 'dart:ui' as _i10; - -import 'package:audioplayers/audioplayers.dart' as _i4; -import 'package:dio/dio.dart' as _i2; -import 'package:firebase_messaging/firebase_messaging.dart' as _i40; -import 'package:flutter/material.dart' as _i8; -import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i7; -import 'package:permission_handler/permission_handler.dart' as _i35; -import 'package:stacked_services/stacked_services.dart' as _i6; -import 'package:waveform_recorder/waveform_recorder.dart' as _i5; -import 'package:yimaru_app/models/assessment.dart' as _i14; -import 'package:yimaru_app/models/assessment_question.dart' as _i15; -import 'package:yimaru_app/models/category.dart' as _i22; -import 'package:yimaru_app/models/course.dart' as _i27; -import 'package:yimaru_app/models/course_detail.dart' as _i43; -import 'package:yimaru_app/models/course_lesson.dart' as _i25; -import 'package:yimaru_app/models/course_progress.dart' as _i24; -import 'package:yimaru_app/models/learn_course.dart' as _i17; -import 'package:yimaru_app/models/learn_lesson.dart' as _i20; -import 'package:yimaru_app/models/learn_module.dart' as _i19; -import 'package:yimaru_app/models/learn_practice.dart' as _i18; -import 'package:yimaru_app/models/learn_program.dart' as _i16; -import 'package:yimaru_app/models/learn_question.dart' as _i21; -import 'package:yimaru_app/models/lesson.dart' as _i31; -import 'package:yimaru_app/models/level.dart' as _i28; -import 'package:yimaru_app/models/module.dart' as _i29; -import 'package:yimaru_app/models/practice.dart' as _i26; -import 'package:yimaru_app/models/subcategory.dart' as _i23; -import 'package:yimaru_app/models/submodule.dart' as _i30; -import 'package:yimaru_app/models/user.dart' as _i12; -import 'package:yimaru_app/services/api_service.dart' as _i13; -import 'package:yimaru_app/services/audio_player_service.dart' as _i44; -import 'package:yimaru_app/services/authentication_service.dart' as _i11; -import 'package:yimaru_app/services/course_service.dart' as _i42; -import 'package:yimaru_app/services/dio_service.dart' as _i32; -import 'package:yimaru_app/services/google_auth_service.dart' as _i37; -import 'package:yimaru_app/services/image_downloader_service.dart' as _i38; -import 'package:yimaru_app/services/image_picker_service.dart' as _i36; -import 'package:yimaru_app/services/in_app_update_service.dart' as _i47; -import 'package:yimaru_app/services/notification_service.dart' as _i39; -import 'package:yimaru_app/services/permission_handler_service.dart' as _i34; -import 'package:yimaru_app/services/secure_storage_service.dart' as _i3; -import 'package:yimaru_app/services/smart_auth_service.dart' as _i41; -import 'package:yimaru_app/services/status_checker_service.dart' as _i33; -import 'package:yimaru_app/services/voice_recorder_service.dart' as _i45; -import 'package:yimaru_app/ui/common/enmus.dart' as _i46; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: must_be_immutable -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class -// ignore_for_file: invalid_use_of_internal_member - -class _FakeDio_0 extends _i1.SmartFake implements _i2.Dio { - _FakeDio_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeSecureStorageService_1 extends _i1.SmartFake - implements _i3.SecureStorageService { - _FakeSecureStorageService_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeAudioPlayer_2 extends _i1.SmartFake implements _i4.AudioPlayer { - _FakeAudioPlayer_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeWaveformRecorderController_3 extends _i1.SmartFake - implements _i5.WaveformRecorderController { - _FakeWaveformRecorderController_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -/// A class which mocks [NavigationService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockNavigationService extends _i1.Mock implements _i6.NavigationService { - @override - String get previousRoute => (super.noSuchMethod( - Invocation.getter(#previousRoute), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#previousRoute), - ), - returnValueForMissingStub: _i7.dummyValue( - this, - Invocation.getter(#previousRoute), - ), - ) as String); - - @override - String get currentRoute => (super.noSuchMethod( - Invocation.getter(#currentRoute), - returnValue: _i7.dummyValue( - this, - Invocation.getter(#currentRoute), - ), - returnValueForMissingStub: _i7.dummyValue( - this, - Invocation.getter(#currentRoute), - ), - ) as String); - - @override - _i8.GlobalKey<_i8.NavigatorState>? nestedNavigationKey(int? index) => - (super.noSuchMethod( - Invocation.method( - #nestedNavigationKey, - [index], - ), - returnValueForMissingStub: null, - ) as _i8.GlobalKey<_i8.NavigatorState>?); - - @override - void config({ - bool? enableLog, - bool? defaultPopGesture, - bool? defaultOpaqueRoute, - Duration? defaultDurationTransition, - bool? defaultGlobalState, - _i6.Transition? defaultTransitionStyle, - String? defaultTransition, - }) => - super.noSuchMethod( - Invocation.method( - #config, - [], - { - #enableLog: enableLog, - #defaultPopGesture: defaultPopGesture, - #defaultOpaqueRoute: defaultOpaqueRoute, - #defaultDurationTransition: defaultDurationTransition, - #defaultGlobalState: defaultGlobalState, - #defaultTransitionStyle: defaultTransitionStyle, - #defaultTransition: defaultTransition, - }, - ), - returnValueForMissingStub: null, - ); - - @override - _i9.Future? navigateWithTransition( - _i8.Widget? page, { - bool? opaque, - String? transition = '', - Duration? duration, - bool? popGesture, - int? id, - _i8.Curve? curve, - bool? fullscreenDialog = false, - bool? preventDuplicates = true, - _i6.Transition? transitionClass, - _i6.Transition? transitionStyle, - String? routeName, - }) => - (super.noSuchMethod( - Invocation.method( - #navigateWithTransition, - [page], - { - #opaque: opaque, - #transition: transition, - #duration: duration, - #popGesture: popGesture, - #id: id, - #curve: curve, - #fullscreenDialog: fullscreenDialog, - #preventDuplicates: preventDuplicates, - #transitionClass: transitionClass, - #transitionStyle: transitionStyle, - #routeName: routeName, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? replaceWithTransition( - _i8.Widget? page, { - bool? opaque, - String? transition = '', - Duration? duration, - bool? popGesture, - int? id, - _i8.Curve? curve, - bool? fullscreenDialog = false, - bool? preventDuplicates = true, - _i6.Transition? transitionClass, - _i6.Transition? transitionStyle, - String? routeName, - }) => - (super.noSuchMethod( - Invocation.method( - #replaceWithTransition, - [page], - { - #opaque: opaque, - #transition: transition, - #duration: duration, - #popGesture: popGesture, - #id: id, - #curve: curve, - #fullscreenDialog: fullscreenDialog, - #preventDuplicates: preventDuplicates, - #transitionClass: transitionClass, - #transitionStyle: transitionStyle, - #routeName: routeName, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - bool back({ - dynamic result, - int? id, - }) => - (super.noSuchMethod( - Invocation.method( - #back, - [], - { - #result: result, - #id: id, - }, - ), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - void popUntil( - _i8.RoutePredicate? predicate, { - int? id, - }) => - super.noSuchMethod( - Invocation.method( - #popUntil, - [predicate], - {#id: id}, - ), - returnValueForMissingStub: null, - ); - - @override - void popRepeated(int? popTimes) => super.noSuchMethod( - Invocation.method( - #popRepeated, - [popTimes], - ), - returnValueForMissingStub: null, - ); - - @override - _i9.Future? navigateTo( - String? routeName, { - dynamic arguments, - int? id, - bool? preventDuplicates = true, - Map? parameters, - _i8.RouteTransitionsBuilder? transition, - }) => - (super.noSuchMethod( - Invocation.method( - #navigateTo, - [routeName], - { - #arguments: arguments, - #id: id, - #preventDuplicates: preventDuplicates, - #parameters: parameters, - #transition: transition, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? navigateToView( - _i8.Widget? view, { - dynamic arguments, - int? id, - bool? opaque, - _i8.Curve? curve, - Duration? duration, - bool? fullscreenDialog = false, - bool? popGesture, - bool? preventDuplicates = true, - _i6.Transition? transition, - _i6.Transition? transitionStyle, - }) => - (super.noSuchMethod( - Invocation.method( - #navigateToView, - [view], - { - #arguments: arguments, - #id: id, - #opaque: opaque, - #curve: curve, - #duration: duration, - #fullscreenDialog: fullscreenDialog, - #popGesture: popGesture, - #preventDuplicates: preventDuplicates, - #transition: transition, - #transitionStyle: transitionStyle, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? replaceWith( - String? routeName, { - dynamic arguments, - int? id, - bool? preventDuplicates = true, - Map? parameters, - _i8.RouteTransitionsBuilder? transition, - }) => - (super.noSuchMethod( - Invocation.method( - #replaceWith, - [routeName], - { - #arguments: arguments, - #id: id, - #preventDuplicates: preventDuplicates, - #parameters: parameters, - #transition: transition, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? clearStackAndShow( - String? routeName, { - dynamic arguments, - int? id, - Map? parameters, - }) => - (super.noSuchMethod( - Invocation.method( - #clearStackAndShow, - [routeName], - { - #arguments: arguments, - #id: id, - #parameters: parameters, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? clearStackAndShowView( - _i8.Widget? view, { - dynamic arguments, - int? id, - }) => - (super.noSuchMethod( - Invocation.method( - #clearStackAndShowView, - [view], - { - #arguments: arguments, - #id: id, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? clearTillFirstAndShow( - String? routeName, { - dynamic arguments, - int? id, - bool? preventDuplicates = true, - Map? parameters, - }) => - (super.noSuchMethod( - Invocation.method( - #clearTillFirstAndShow, - [routeName], - { - #arguments: arguments, - #id: id, - #preventDuplicates: preventDuplicates, - #parameters: parameters, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? clearTillFirstAndShowView( - _i8.Widget? view, { - dynamic arguments, - int? id, - }) => - (super.noSuchMethod( - Invocation.method( - #clearTillFirstAndShowView, - [view], - { - #arguments: arguments, - #id: id, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); - - @override - _i9.Future? pushNamedAndRemoveUntil( - String? routeName, { - _i8.RoutePredicate? predicate, - dynamic arguments, - int? id, - }) => - (super.noSuchMethod( - Invocation.method( - #pushNamedAndRemoveUntil, - [routeName], - { - #predicate: predicate, - #arguments: arguments, - #id: id, - }, - ), - returnValueForMissingStub: null, - ) as _i9.Future?); -} - -/// A class which mocks [BottomSheetService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockBottomSheetService extends _i1.Mock - implements _i6.BottomSheetService { - @override - void setCustomSheetBuilders(Map? builders) => - super.noSuchMethod( - Invocation.method( - #setCustomSheetBuilders, - [builders], - ), - returnValueForMissingStub: null, - ); - - @override - _i9.Future<_i6.SheetResponse?> showBottomSheet({ - required String? title, - String? description, - String? confirmButtonTitle = 'Ok', - String? cancelButtonTitle, - bool? enableDrag = true, - bool? barrierDismissible = true, - bool? isScrollControlled = false, - Duration? exitBottomSheetDuration, - Duration? enterBottomSheetDuration, - bool? ignoreSafeArea, - bool? useRootNavigator = false, - double? elevation = 1.0, - }) => - (super.noSuchMethod( - Invocation.method( - #showBottomSheet, - [], - { - #title: title, - #description: description, - #confirmButtonTitle: confirmButtonTitle, - #cancelButtonTitle: cancelButtonTitle, - #enableDrag: enableDrag, - #barrierDismissible: barrierDismissible, - #isScrollControlled: isScrollControlled, - #exitBottomSheetDuration: exitBottomSheetDuration, - #enterBottomSheetDuration: enterBottomSheetDuration, - #ignoreSafeArea: ignoreSafeArea, - #useRootNavigator: useRootNavigator, - #elevation: elevation, - }, - ), - returnValue: _i9.Future<_i6.SheetResponse?>.value(), - returnValueForMissingStub: - _i9.Future<_i6.SheetResponse?>.value(), - ) as _i9.Future<_i6.SheetResponse?>); - - @override - _i9.Future<_i6.SheetResponse?> showCustomSheet({ - dynamic variant, - String? title, - String? description, - bool? hasImage = false, - String? imageUrl, - bool? showIconInMainButton = false, - String? mainButtonTitle, - bool? showIconInSecondaryButton = false, - String? secondaryButtonTitle, - bool? showIconInAdditionalButton = false, - String? additionalButtonTitle, - bool? takesInput = false, - _i10.Color? barrierColor = const _i10.Color(2315255808), - double? elevation = 1.0, - bool? barrierDismissible = true, - bool? isScrollControlled = false, - String? barrierLabel = '', - dynamic customData, - R? data, - bool? enableDrag = true, - Duration? exitBottomSheetDuration, - Duration? enterBottomSheetDuration, - bool? ignoreSafeArea, - bool? useRootNavigator = false, - }) => - (super.noSuchMethod( - Invocation.method( - #showCustomSheet, - [], - { - #variant: variant, - #title: title, - #description: description, - #hasImage: hasImage, - #imageUrl: imageUrl, - #showIconInMainButton: showIconInMainButton, - #mainButtonTitle: mainButtonTitle, - #showIconInSecondaryButton: showIconInSecondaryButton, - #secondaryButtonTitle: secondaryButtonTitle, - #showIconInAdditionalButton: showIconInAdditionalButton, - #additionalButtonTitle: additionalButtonTitle, - #takesInput: takesInput, - #barrierColor: barrierColor, - #elevation: elevation, - #barrierDismissible: barrierDismissible, - #isScrollControlled: isScrollControlled, - #barrierLabel: barrierLabel, - #customData: customData, - #data: data, - #enableDrag: enableDrag, - #exitBottomSheetDuration: exitBottomSheetDuration, - #enterBottomSheetDuration: enterBottomSheetDuration, - #ignoreSafeArea: ignoreSafeArea, - #useRootNavigator: useRootNavigator, - }, - ), - returnValue: _i9.Future<_i6.SheetResponse?>.value(), - returnValueForMissingStub: _i9.Future<_i6.SheetResponse?>.value(), - ) as _i9.Future<_i6.SheetResponse?>); - - @override - void completeSheet(_i6.SheetResponse? response) => - super.noSuchMethod( - Invocation.method( - #completeSheet, - [response], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [DialogService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockDialogService extends _i1.Mock implements _i6.DialogService { - @override - void registerCustomDialogBuilders( - Map? builders) => - super.noSuchMethod( - Invocation.method( - #registerCustomDialogBuilders, - [builders], - ), - returnValueForMissingStub: null, - ); - - @override - void registerCustomDialogBuilder({ - required dynamic variant, - required _i8.Widget Function( - _i8.BuildContext, - _i6.DialogRequest, - dynamic Function(_i6.DialogResponse), - )? builder, - }) => - super.noSuchMethod( - Invocation.method( - #registerCustomDialogBuilder, - [], - { - #variant: variant, - #builder: builder, - }, - ), - returnValueForMissingStub: null, - ); - - @override - _i9.Future<_i6.DialogResponse?> showDialog({ - String? title, - String? description, - String? cancelTitle, - _i10.Color? cancelTitleColor, - String? buttonTitle = 'Ok', - _i10.Color? buttonTitleColor, - bool? barrierDismissible = false, - _i8.RouteSettings? routeSettings, - _i8.GlobalKey<_i8.NavigatorState>? navigatorKey, - _i6.DialogPlatform? dialogPlatform, - }) => - (super.noSuchMethod( - Invocation.method( - #showDialog, - [], - { - #title: title, - #description: description, - #cancelTitle: cancelTitle, - #cancelTitleColor: cancelTitleColor, - #buttonTitle: buttonTitle, - #buttonTitleColor: buttonTitleColor, - #barrierDismissible: barrierDismissible, - #routeSettings: routeSettings, - #navigatorKey: navigatorKey, - #dialogPlatform: dialogPlatform, - }, - ), - returnValue: _i9.Future<_i6.DialogResponse?>.value(), - returnValueForMissingStub: - _i9.Future<_i6.DialogResponse?>.value(), - ) as _i9.Future<_i6.DialogResponse?>); - - @override - _i9.Future<_i6.DialogResponse?> showCustomDialog({ - dynamic variant, - String? title, - String? description, - bool? hasImage = false, - String? imageUrl, - bool? showIconInMainButton = false, - String? mainButtonTitle, - bool? showIconInSecondaryButton = false, - String? secondaryButtonTitle, - bool? showIconInAdditionalButton = false, - String? additionalButtonTitle, - bool? takesInput = false, - _i10.Color? barrierColor = const _i10.Color(2315255808), - bool? barrierDismissible = false, - String? barrierLabel = '', - bool? useSafeArea = true, - _i8.RouteSettings? routeSettings, - _i8.GlobalKey<_i8.NavigatorState>? navigatorKey, - _i8.RouteTransitionsBuilder? transitionBuilder, - dynamic customData, - R? data, - }) => - (super.noSuchMethod( - Invocation.method( - #showCustomDialog, - [], - { - #variant: variant, - #title: title, - #description: description, - #hasImage: hasImage, - #imageUrl: imageUrl, - #showIconInMainButton: showIconInMainButton, - #mainButtonTitle: mainButtonTitle, - #showIconInSecondaryButton: showIconInSecondaryButton, - #secondaryButtonTitle: secondaryButtonTitle, - #showIconInAdditionalButton: showIconInAdditionalButton, - #additionalButtonTitle: additionalButtonTitle, - #takesInput: takesInput, - #barrierColor: barrierColor, - #barrierDismissible: barrierDismissible, - #barrierLabel: barrierLabel, - #useSafeArea: useSafeArea, - #routeSettings: routeSettings, - #navigatorKey: navigatorKey, - #transitionBuilder: transitionBuilder, - #customData: customData, - #data: data, - }, - ), - returnValue: _i9.Future<_i6.DialogResponse?>.value(), - returnValueForMissingStub: _i9.Future<_i6.DialogResponse?>.value(), - ) as _i9.Future<_i6.DialogResponse?>); - - @override - _i9.Future<_i6.DialogResponse?> showConfirmationDialog({ - String? title, - String? description, - String? cancelTitle = 'Cancel', - _i10.Color? cancelTitleColor, - String? confirmationTitle = 'Ok', - _i10.Color? confirmationTitleColor, - bool? barrierDismissible = false, - _i8.RouteSettings? routeSettings, - _i6.DialogPlatform? dialogPlatform, - }) => - (super.noSuchMethod( - Invocation.method( - #showConfirmationDialog, - [], - { - #title: title, - #description: description, - #cancelTitle: cancelTitle, - #cancelTitleColor: cancelTitleColor, - #confirmationTitle: confirmationTitle, - #confirmationTitleColor: confirmationTitleColor, - #barrierDismissible: barrierDismissible, - #routeSettings: routeSettings, - #dialogPlatform: dialogPlatform, - }, - ), - returnValue: _i9.Future<_i6.DialogResponse?>.value(), - returnValueForMissingStub: - _i9.Future<_i6.DialogResponse?>.value(), - ) as _i9.Future<_i6.DialogResponse?>); - - @override - void completeDialog(_i6.DialogResponse? response) => - super.noSuchMethod( - Invocation.method( - #completeDialog, - [response], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [AuthenticationService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockAuthenticationService extends _i1.Mock - implements _i11.AuthenticationService { - @override - int get listenersCount => (super.noSuchMethod( - Invocation.getter(#listenersCount), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - _i9.Future userLoggedIn() => (super.noSuchMethod( - Invocation.method( - #userLoggedIn, - [], - ), - returnValue: _i9.Future.value(false), - returnValueForMissingStub: _i9.Future.value(false), - ) as _i9.Future); - - @override - _i9.Future getAccessToken() => (super.noSuchMethod( - Invocation.method( - #getAccessToken, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getRefreshToken() => (super.noSuchMethod( - Invocation.method( - #getRefreshToken, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getUserId() => (super.noSuchMethod( - Invocation.method( - #getUserId, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future saveTokens({ - required String? access, - required String? refresh, - }) => - (super.noSuchMethod( - Invocation.method( - #saveTokens, - [], - { - #access: access, - #refresh: refresh, - }, - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future saveUserCredential(Map? data) => - (super.noSuchMethod( - Invocation.method( - #saveUserCredential, - [data], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future saveProfileStatus(bool? value) => (super.noSuchMethod( - Invocation.method( - #saveProfileStatus, - [value], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future saveProfilePicture(String? image) => (super.noSuchMethod( - Invocation.method( - #saveProfilePicture, - [image], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future saveUserData(_i12.User? data) => (super.noSuchMethod( - Invocation.method( - #saveUserData, - [data], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future updateUserData(Map? data) => - (super.noSuchMethod( - Invocation.method( - #updateUserData, - [data], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future isFirstTimeInstall() => (super.noSuchMethod( - Invocation.method( - #isFirstTimeInstall, - [], - ), - returnValue: _i9.Future.value(false), - returnValueForMissingStub: _i9.Future.value(false), - ) as _i9.Future); - - @override - _i9.Future setFirstTimeInstall(bool? value) => (super.noSuchMethod( - Invocation.method( - #setFirstTimeInstall, - [value], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future<_i12.User?> getUser() => (super.noSuchMethod( - Invocation.method( - #getUser, - [], - ), - returnValue: _i9.Future<_i12.User?>.value(), - returnValueForMissingStub: _i9.Future<_i12.User?>.value(), - ) as _i9.Future<_i12.User?>); - - @override - _i9.Future logout() => (super.noSuchMethod( - Invocation.method( - #logout, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - void listenToReactiveValues(List? reactiveValues) => - super.noSuchMethod( - Invocation.method( - #listenToReactiveValues, - [reactiveValues], - ), - returnValueForMissingStub: null, - ); - - @override - void addListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void removeListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [ApiService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockApiService extends _i1.Mock implements _i13.ApiService { - @override - _i9.Future> registerWithEmail( - Map? data) => - (super.noSuchMethod( - Invocation.method( - #registerWithEmail, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> login(Map? data) => - (super.noSuchMethod( - Invocation.method( - #login, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> googleAuth(Map? data) => - (super.noSuchMethod( - Invocation.method( - #googleAuth, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> verifyOtp(Map? data) => - (super.noSuchMethod( - Invocation.method( - #verifyOtp, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> resendOtp(Map? data) => - (super.noSuchMethod( - Invocation.method( - #resendOtp, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> requestResetCode( - Map? data) => - (super.noSuchMethod( - Invocation.method( - #requestResetCode, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> resetPassword(Map? data) => - (super.noSuchMethod( - Invocation.method( - #resetPassword, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> getProfileStatus(_i12.User? user) => - (super.noSuchMethod( - Invocation.method( - #getProfileStatus, - [user], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> getProfileData(int? userId) => - (super.noSuchMethod( - Invocation.method( - #getProfileData, - [userId], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> completeProfile( - Map? data) => - (super.noSuchMethod( - Invocation.method( - #completeProfile, - [data], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> updateProfileImage({ - required int? userId, - required Map? data, - }) => - (super.noSuchMethod( - Invocation.method( - #updateProfileImage, - [], - { - #userId: userId, - #data: data, - }, - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> getAssessments() => (super.noSuchMethod( - Invocation.method( - #getAssessments, - [], - ), - returnValue: - _i9.Future>.value(<_i14.Assessment>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i14.Assessment>[]), - ) as _i9.Future>); - - @override - _i9.Future> getAssessmentQuestions(int? id) => - (super.noSuchMethod( - Invocation.method( - #getAssessmentQuestions, - [id], - ), - returnValue: _i9.Future>.value( - <_i15.AssessmentQuestion>[]), - returnValueForMissingStub: - _i9.Future>.value( - <_i15.AssessmentQuestion>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnPrograms() => (super.noSuchMethod( - Invocation.method( - #getLearnPrograms, - [], - ), - returnValue: - _i9.Future>.value(<_i16.LearnProgram>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i16.LearnProgram>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnCourse(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnCourse, - [id], - ), - returnValue: - _i9.Future>.value(<_i17.LearnCourse>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i17.LearnCourse>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnCoursePractices(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnCoursePractices, - [id], - ), - returnValue: - _i9.Future>.value(<_i18.LearnPractice>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i18.LearnPractice>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnModules(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnModules, - [id], - ), - returnValue: - _i9.Future>.value(<_i19.LearnModule>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i19.LearnModule>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnModulePractices(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnModulePractices, - [id], - ), - returnValue: - _i9.Future>.value(<_i18.LearnPractice>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i18.LearnPractice>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnLessons(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnLessons, - [id], - ), - returnValue: - _i9.Future>.value(<_i20.LearnLesson>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i20.LearnLesson>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnLessonPractices(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnLessonPractices, - [id], - ), - returnValue: - _i9.Future>.value(<_i18.LearnPractice>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i18.LearnPractice>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLearnQuestions(int? id) => - (super.noSuchMethod( - Invocation.method( - #getLearnQuestions, - [id], - ), - returnValue: - _i9.Future>.value(<_i21.LearnQuestion>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i21.LearnQuestion>[]), - ) as _i9.Future>); - - @override - _i9.Future> getCategories() => (super.noSuchMethod( - Invocation.method( - #getCategories, - [], - ), - returnValue: _i9.Future>.value(<_i22.Category>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i22.Category>[]), - ) as _i9.Future>); - - @override - _i9.Future> getSubcategories(int? id) => - (super.noSuchMethod( - Invocation.method( - #getSubcategories, - [id], - ), - returnValue: - _i9.Future>.value(<_i23.Subcategory>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i23.Subcategory>[]), - ) as _i9.Future>); - - @override - _i9.Future> getCourseProgress(int? id) => - (super.noSuchMethod( - Invocation.method( - #getCourseProgress, - [id], - ), - returnValue: _i9.Future>.value( - <_i24.CourseProgress>[]), - returnValueForMissingStub: _i9.Future>.value( - <_i24.CourseProgress>[]), - ) as _i9.Future>); - - @override - _i9.Future> getCourseLessons(int? id) => - (super.noSuchMethod( - Invocation.method( - #getCourseLessons, - [id], - ), - returnValue: - _i9.Future>.value(<_i25.CourseLesson>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i25.CourseLesson>[]), - ) as _i9.Future>); - - @override - _i9.Future> completeLesson(int? id) => - (super.noSuchMethod( - Invocation.method( - #completeLesson, - [id], - ), - returnValue: - _i9.Future>.value({}), - returnValueForMissingStub: - _i9.Future>.value({}), - ) as _i9.Future>); - - @override - _i9.Future> getCoursePractices(int? id) => - (super.noSuchMethod( - Invocation.method( - #getCoursePractices, - [id], - ), - returnValue: _i9.Future>.value(<_i26.Practice>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i26.Practice>[]), - ) as _i9.Future>); - - @override - _i9.Future> getCoursePracticeQuestions( - int? id) => - (super.noSuchMethod( - Invocation.method( - #getCoursePracticeQuestions, - [id], - ), - returnValue: _i9.Future>.value( - <_i15.AssessmentQuestion>[]), - returnValueForMissingStub: - _i9.Future>.value( - <_i15.AssessmentQuestion>[]), - ) as _i9.Future>); - - @override - _i9.Future<_i15.AssessmentQuestion?> getCoursePracticeQuestion(int? id) => - (super.noSuchMethod( - Invocation.method( - #getCoursePracticeQuestion, - [id], - ), - returnValue: _i9.Future<_i15.AssessmentQuestion?>.value(), - returnValueForMissingStub: _i9.Future<_i15.AssessmentQuestion?>.value(), - ) as _i9.Future<_i15.AssessmentQuestion?>); - - @override - _i9.Future> getLearnSubcategories() => - (super.noSuchMethod( - Invocation.method( - #getLearnSubcategories, - [], - ), - returnValue: - _i9.Future>.value(<_i23.Subcategory>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i23.Subcategory>[]), - ) as _i9.Future>); - - @override - _i9.Future> getCourses(int? id) => (super.noSuchMethod( - Invocation.method( - #getCourses, - [id], - ), - returnValue: _i9.Future>.value(<_i27.Course>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i27.Course>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLevels(int? id) => (super.noSuchMethod( - Invocation.method( - #getLevels, - [id], - ), - returnValue: _i9.Future>.value(<_i28.Level>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i28.Level>[]), - ) as _i9.Future>); - - @override - _i9.Future> getModules(int? id) => (super.noSuchMethod( - Invocation.method( - #getModules, - [id], - ), - returnValue: _i9.Future>.value(<_i29.Module>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i29.Module>[]), - ) as _i9.Future>); - - @override - _i9.Future> getSubmodules(int? id) => - (super.noSuchMethod( - Invocation.method( - #getSubmodules, - [id], - ), - returnValue: _i9.Future>.value(<_i30.Submodule>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i30.Submodule>[]), - ) as _i9.Future>); - - @override - _i9.Future> getLessons(int? id) => (super.noSuchMethod( - Invocation.method( - #getLessons, - [id], - ), - returnValue: _i9.Future>.value(<_i31.Lesson>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i31.Lesson>[]), - ) as _i9.Future>); - - @override - _i9.Future> getPractices(int? id) => (super.noSuchMethod( - Invocation.method( - #getPractices, - [id], - ), - returnValue: _i9.Future>.value(<_i26.Practice>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i26.Practice>[]), - ) as _i9.Future>); - - @override - _i9.Future> getQuestions(int? id) => - (super.noSuchMethod( - Invocation.method( - #getQuestions, - [id], - ), - returnValue: _i9.Future>.value( - <_i15.AssessmentQuestion>[]), - returnValueForMissingStub: - _i9.Future>.value( - <_i15.AssessmentQuestion>[]), - ) as _i9.Future>); -} - -/// A class which mocks [SecureStorageService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockSecureStorageService extends _i1.Mock - implements _i3.SecureStorageService { - @override - _i9.Future clear() => (super.noSuchMethod( - Invocation.method( - #clear, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getBool(String? key) => (super.noSuchMethod( - Invocation.method( - #getBool, - [key], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getString(String? key) => (super.noSuchMethod( - Invocation.method( - #getString, - [key], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getInt(String? key) => (super.noSuchMethod( - Invocation.method( - #getInt, - [key], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future setString( - String? key, - String? value, - ) => - (super.noSuchMethod( - Invocation.method( - #setString, - [ - key, - value, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future setInt( - String? key, - int? value, - ) => - (super.noSuchMethod( - Invocation.method( - #setInt, - [ - key, - value, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future setBool( - String? key, - bool? value, - ) => - (super.noSuchMethod( - Invocation.method( - #setBool, - [ - key, - value, - ], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); -} - -/// A class which mocks [DioService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockDioService extends _i1.Mock implements _i32.DioService { - @override - _i2.Dio get dio => (super.noSuchMethod( - Invocation.getter(#dio), - returnValue: _FakeDio_0( - this, - Invocation.getter(#dio), - ), - returnValueForMissingStub: _FakeDio_0( - this, - Invocation.getter(#dio), - ), - ) as _i2.Dio); -} - -/// A class which mocks [StatusCheckerService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockStatusCheckerService extends _i1.Mock - implements _i33.StatusCheckerService { - @override - _i3.SecureStorageService get storage => (super.noSuchMethod( - Invocation.getter(#storage), - returnValue: _FakeSecureStorageService_1( - this, - Invocation.getter(#storage), - ), - returnValueForMissingStub: _FakeSecureStorageService_1( - this, - Invocation.getter(#storage), - ), - ) as _i3.SecureStorageService); - - @override - bool get previousConnection => (super.noSuchMethod( - Invocation.getter(#previousConnection), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - _i9.Future checkConnection() => (super.noSuchMethod( - Invocation.method( - #checkConnection, - [], - ), - returnValue: _i9.Future.value(false), - returnValueForMissingStub: _i9.Future.value(false), - ) as _i9.Future); -} - -/// A class which mocks [PermissionHandlerService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockPermissionHandlerService extends _i1.Mock - implements _i34.PermissionHandlerService { - @override - _i9.Future<_i35.PermissionStatus> requestPermission( - _i35.Permission? requestedPermission) => - (super.noSuchMethod( - Invocation.method( - #requestPermission, - [requestedPermission], - ), - returnValue: _i9.Future<_i35.PermissionStatus>.value( - _i35.PermissionStatus.denied), - returnValueForMissingStub: _i9.Future<_i35.PermissionStatus>.value( - _i35.PermissionStatus.denied), - ) as _i9.Future<_i35.PermissionStatus>); - - @override - _i9.Future<_i35.PermissionStatus> request(_i35.Permission? permission) => - (super.noSuchMethod( - Invocation.method( - #request, - [permission], - ), - returnValue: _i9.Future<_i35.PermissionStatus>.value( - _i35.PermissionStatus.denied), - returnValueForMissingStub: _i9.Future<_i35.PermissionStatus>.value( - _i35.PermissionStatus.denied), - ) as _i9.Future<_i35.PermissionStatus>); -} - -/// A class which mocks [ImagePickerService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockImagePickerService extends _i1.Mock - implements _i36.ImagePickerService { - @override - _i9.Future gallery() => (super.noSuchMethod( - Invocation.method( - #gallery, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future camera() => (super.noSuchMethod( - Invocation.method( - #camera, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); -} - -/// A class which mocks [GoogleAuthService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockGoogleAuthService extends _i1.Mock implements _i37.GoogleAuthService { - @override - int get listenersCount => (super.noSuchMethod( - Invocation.getter(#listenersCount), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - _i9.Future logout() => (super.noSuchMethod( - Invocation.method( - #logout, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future googleAuth() => (super.noSuchMethod( - Invocation.method( - #googleAuth, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - void listenToReactiveValues(List? reactiveValues) => - super.noSuchMethod( - Invocation.method( - #listenToReactiveValues, - [reactiveValues], - ), - returnValueForMissingStub: null, - ); - - @override - void addListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void removeListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [ImageDownloaderService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockImageDownloaderService extends _i1.Mock - implements _i38.ImageDownloaderService { - @override - _i9.Future downloader(String? networkImage) => (super.noSuchMethod( - Invocation.method( - #downloader, - [networkImage], - ), - returnValue: _i9.Future.value(_i7.dummyValue( - this, - Invocation.method( - #downloader, - [networkImage], - ), - )), - returnValueForMissingStub: - _i9.Future.value(_i7.dummyValue( - this, - Invocation.method( - #downloader, - [networkImage], - ), - )), - ) as _i9.Future); -} - -/// A class which mocks [NotificationService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockNotificationService extends _i1.Mock - implements _i39.NotificationService { - @override - _i9.Future initialize() => (super.noSuchMethod( - Invocation.method( - #initialize, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future setupFlutterNotifications() => (super.noSuchMethod( - Invocation.method( - #setupFlutterNotifications, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future showNotification(_i40.RemoteMessage? message) => - (super.noSuchMethod( - Invocation.method( - #showNotification, - [message], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future subscribeToTopic(String? topic) => (super.noSuchMethod( - Invocation.method( - #subscribeToTopic, - [topic], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future updateFCMToken() => (super.noSuchMethod( - Invocation.method( - #updateFCMToken, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); -} - -/// A class which mocks [SmartAuthService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockSmartAuthService extends _i1.Mock implements _i41.SmartAuthService { - @override - bool get listenForMultipleSms => (super.noSuchMethod( - Invocation.getter(#listenForMultipleSms), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - _i9.Future dispose() => (super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getSmsCode() => (super.noSuchMethod( - Invocation.method( - #getSmsCode, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); -} - -/// A class which mocks [CourseService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockCourseService extends _i1.Mock implements _i42.CourseService { - @override - _i9.Future> getCoursesDetail(int? id) => - (super.noSuchMethod( - Invocation.method( - #getCoursesDetail, - [id], - ), - returnValue: - _i9.Future>.value(<_i43.CourseDetail>[]), - returnValueForMissingStub: - _i9.Future>.value(<_i43.CourseDetail>[]), - ) as _i9.Future>); -} - -/// A class which mocks [AudioPlayerService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockAudioPlayerService extends _i1.Mock - implements _i44.AudioPlayerService { - @override - _i4.AudioPlayer get player => (super.noSuchMethod( - Invocation.getter(#player), - returnValue: _FakeAudioPlayer_2( - this, - Invocation.getter(#player), - ), - returnValueForMissingStub: _FakeAudioPlayer_2( - this, - Invocation.getter(#player), - ), - ) as _i4.AudioPlayer); - - @override - _i9.Stream get positionStream => (super.noSuchMethod( - Invocation.getter(#positionStream), - returnValue: _i9.Stream.empty(), - returnValueForMissingStub: _i9.Stream.empty(), - ) as _i9.Stream); - - @override - _i9.Stream get durationStream => (super.noSuchMethod( - Invocation.getter(#durationStream), - returnValue: _i9.Stream.empty(), - returnValueForMissingStub: _i9.Stream.empty(), - ) as _i9.Stream); - - @override - _i9.Stream<_i4.PlayerState> get stateStream => (super.noSuchMethod( - Invocation.getter(#stateStream), - returnValue: _i9.Stream<_i4.PlayerState>.empty(), - returnValueForMissingStub: _i9.Stream<_i4.PlayerState>.empty(), - ) as _i9.Stream<_i4.PlayerState>); - - @override - int get listenersCount => (super.noSuchMethod( - Invocation.getter(#listenersCount), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - _i9.Future playUrl(String? url) => (super.noSuchMethod( - Invocation.method( - #playUrl, - [url], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future playLocal(String? url) => (super.noSuchMethod( - Invocation.method( - #playLocal, - [url], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future pause() => (super.noSuchMethod( - Invocation.method( - #pause, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future seek(Duration? position) => (super.noSuchMethod( - Invocation.method( - #seek, - [position], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - void listenToReactiveValues(List? reactiveValues) => - super.noSuchMethod( - Invocation.method( - #listenToReactiveValues, - [reactiveValues], - ), - returnValueForMissingStub: null, - ); - - @override - void addListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void removeListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [VoiceRecorderService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockVoiceRecorderService extends _i1.Mock - implements _i45.VoiceRecorderService { - @override - _i46.VoiceRecordingState get recordingState => (super.noSuchMethod( - Invocation.getter(#recordingState), - returnValue: _i46.VoiceRecordingState.pending, - returnValueForMissingStub: _i46.VoiceRecordingState.pending, - ) as _i46.VoiceRecordingState); - - @override - _i5.WaveformRecorderController get waveController => (super.noSuchMethod( - Invocation.getter(#waveController), - returnValue: _FakeWaveformRecorderController_3( - this, - Invocation.getter(#waveController), - ), - returnValueForMissingStub: _FakeWaveformRecorderController_3( - this, - Invocation.getter(#waveController), - ), - ) as _i5.WaveformRecorderController); - - @override - bool get isRecording => (super.noSuchMethod( - Invocation.getter(#isRecording), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - - @override - int get listenersCount => (super.noSuchMethod( - Invocation.getter(#listenersCount), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - - @override - _i9.Future startRecording() => (super.noSuchMethod( - Invocation.method( - #startRecording, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future stopRecording() => (super.noSuchMethod( - Invocation.method( - #stopRecording, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - _i9.Future getRecordedAudio() => (super.noSuchMethod( - Invocation.method( - #getRecordedAudio, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); - - @override - void listenToReactiveValues(List? reactiveValues) => - super.noSuchMethod( - Invocation.method( - #listenToReactiveValues, - [reactiveValues], - ), - returnValueForMissingStub: null, - ); - - @override - void addListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void removeListener(void Function()? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [InAppUpdateService]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockInAppUpdateService extends _i1.Mock - implements _i47.InAppUpdateService { - @override - _i9.Future getBatteryLevel() => (super.noSuchMethod( - Invocation.method( - #getBatteryLevel, - [], - ), - returnValue: _i9.Future.value(0), - returnValueForMissingStub: _i9.Future.value(0), - ) as _i9.Future); - - @override - _i9.Future getAvailableStorage() => (super.noSuchMethod( - Invocation.method( - #getAvailableStorage, - [], - ), - returnValue: _i9.Future.value(0), - returnValueForMissingStub: _i9.Future.value(0), - ) as _i9.Future); - - @override - _i9.Future checkForUpdate() => (super.noSuchMethod( - Invocation.method( - #checkForUpdate, - [], - ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); -} diff --git a/test/services/vimeo_service_test.dart b/test/services/vimeo_service_test.dart new file mode 100644 index 0000000..14926c5 --- /dev/null +++ b/test/services/vimeo_service_test.dart @@ -0,0 +1,11 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:yimaru_app/app/app.locator.dart'; + +import '../helpers/test_helpers.dart'; + +void main() { + group('VimeoServiceTest -', () { + setUp(() => registerServices()); + tearDown(() => locator.reset()); + }); +}