Compare commits
	
		
			5 Commits 
		
	
	
		
			master
			...
			faiz_discl
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | 5921f60825 | 1 year ago | 
|  | b821026063 | 1 year ago | 
|  | d77ace678d | 1 year ago | 
|  | cbc6219755 | 1 year ago | 
|  | 8efab84515 | 1 year ago | 
| @ -0,0 +1,47 @@ | ||||
| { | ||||
|   "id": "979813be-eafa-4d3e-d27e-08dae8a08a3b", | ||||
|   "titleEn": "Disclosure Title", | ||||
|   "titleAr": "undefined", | ||||
|   "descEn": "Submit disclosure using mobile app", | ||||
|   "descAr": "undefined", | ||||
|   "questionTime": 10, | ||||
|   "winDeciderTime": 30, | ||||
|   "winnersCount": 1, | ||||
|   "questGapTime": 5, | ||||
|   "startTime": "2022-12-28T10:44:41", | ||||
|   "endTime": null, | ||||
|   "marathoneStatusId": 4, | ||||
|   "scheduleTime": "2022-12-28T10:14:41", | ||||
|   "selectedLanguage": 0, | ||||
|   "projects": { | ||||
|     "id": "b1cd3fa3-bb27-422e-a4c1-08dac09254df", | ||||
|     "nameEn": "Cloud Solutions", | ||||
|     "nameAr": "شركة حلول السحابة للاتصالات وتقنية المعلومات", | ||||
|     "projectCode": "CS" | ||||
|   }, | ||||
|   "sponsors": [ | ||||
|     { | ||||
|       "id": "3272b127-b388-4f09-425b-08dac2eb788e", | ||||
|       "nameEn": "Cloud Solutions", | ||||
|       "nameAr": "حل السحابة", | ||||
|       "image": "SponsorImage/b9aed4a8-42b2-45fc-b6f1-47ee0c7b4138_sponsor.jpeg", | ||||
|       "video": "SponsorVideo/9ab678ab-1b4c-4ea4-aaf2-32ce1353d3fe_sample-10s.mp4", | ||||
|       "logo": "SponsorLogo/eb029f0d-bce1-4a61-b0c0-abaa484912a0_sponsor.jpeg", | ||||
|       "videoDuration": null, | ||||
|       "sponsorPrizes": [ | ||||
|         { | ||||
|           "id": "e657a18c-6fb2-4099-07c8-08dae89efcd3", | ||||
|           "marathonPrizeEn": "SAR 500", | ||||
|           "marathonPrizeAr": "SAR 500" | ||||
|         } | ||||
|       ] | ||||
|     } | ||||
|   ], | ||||
|   "questions": null, | ||||
|   "isEmailSent": false, | ||||
|   "totalQuestions": 8, | ||||
|   "cancelReason": null, | ||||
|   "marathonBufferTime": 30, | ||||
|   "currentTime": "2022-12-28T08:03:24.3671803Z", | ||||
|   "displayCorrectAnswer": true | ||||
| } | ||||
											
												
													File diff suppressed because it is too large
													Load Diff
												
											
										
									
								| @ -0,0 +1,242 @@ | ||||
| class DisclosureDetailsModel { | ||||
|   String? id; | ||||
|   String? titleEn; | ||||
|   String? titleAr; | ||||
|   String? descEn; | ||||
|   String? descAr; | ||||
|   int? winDeciderTime; | ||||
|   int? winnersCount; | ||||
|   int? questGapTime; | ||||
|   String? startTime; | ||||
|   String? endTime; | ||||
|   int? marathoneStatusId; | ||||
|   String? scheduleTime; | ||||
|   int? selectedLanguage; | ||||
|   Projects? projects; | ||||
|   List<Sponsors>? sponsors; | ||||
|   List<Questions>? questions; | ||||
|   int? totalQuestions; | ||||
|   int? marathonBufferTime; | ||||
|   bool? displayCorrectAnswer; | ||||
| 
 | ||||
|   DisclosureDetailsModel({ | ||||
|     id, | ||||
|     titleEn, | ||||
|     titleAr, | ||||
|     descEn, | ||||
|     descAr, | ||||
|     winDeciderTime, | ||||
|     winnersCount, | ||||
|     questGapTime, | ||||
|     startTime, | ||||
|     endTime, | ||||
|     marathoneStatusId, | ||||
|     scheduleTime, | ||||
|     selectedLanguage, | ||||
|     projects, | ||||
|     sponsors, | ||||
|     questions, | ||||
|     totalQuestions, | ||||
|     marathonBufferTime, | ||||
|     displayCorrectAnswer, | ||||
|   }); | ||||
| 
 | ||||
|   DisclosureDetailsModel.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     titleEn = json['titleEn']; | ||||
|     titleAr = json['titleAr']; | ||||
|     descEn = json['descEn']; | ||||
|     descAr = json['descAr']; | ||||
|     winDeciderTime = json['winDeciderTime']; | ||||
|     winnersCount = json['winnersCount']; | ||||
|     questGapTime = json['questGapTime']; | ||||
|     startTime = json['startTime']; | ||||
|     endTime = json['endTime']; | ||||
|     marathoneStatusId = json['marathoneStatusId']; | ||||
|     scheduleTime = json['scheduleTime']; | ||||
|     selectedLanguage = json['selectedLanguage']; | ||||
|     projects = json['projects'] != null ? Projects.fromJson(json['projects']) : null; | ||||
|     if (json['sponsors'] != null) { | ||||
|       sponsors = <Sponsors>[]; | ||||
|       json['sponsors'].forEach((v) { | ||||
|         sponsors!.add(Sponsors.fromJson(v)); | ||||
|       }); | ||||
|     } | ||||
|     if (json['questions'] != null) { | ||||
|       questions = <Questions>[]; | ||||
|       json['questions'].forEach((v) { | ||||
|         questions!.add(Questions.fromJson(v)); | ||||
|       }); | ||||
|     } | ||||
|     totalQuestions = json["totalQuestions"]; | ||||
|     marathonBufferTime = json["marathonBufferTime"]; | ||||
|     displayCorrectAnswer = json["displayCorrectAnswer"]; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = <String, dynamic>{}; | ||||
|     data['id'] = id; | ||||
|     data['titleEn'] = titleEn; | ||||
|     data['titleAr'] = titleAr; | ||||
|     data['descEn'] = descEn; | ||||
|     data['descAr'] = descAr; | ||||
|     data['winDeciderTime'] = winDeciderTime; | ||||
|     data['winnersCount'] = winnersCount; | ||||
|     data['questGapTime'] = questGapTime; | ||||
|     data['startTime'] = startTime; | ||||
|     data['endTime'] = endTime; | ||||
|     data['marathoneStatusId'] = marathoneStatusId; | ||||
|     data['scheduleTime'] = scheduleTime; | ||||
|     data['selectedLanguage'] = selectedLanguage; | ||||
|     if (projects != null) { | ||||
|       data['projects'] = projects!.toJson(); | ||||
|     } | ||||
|     if (sponsors != null) { | ||||
|       data['sponsors'] = sponsors!.map((v) => v.toJson()).toList(); | ||||
|     } | ||||
|     if (questions != null) { | ||||
|       data['questions'] = questions!.map((v) => v.toJson()).toList(); | ||||
|     } | ||||
|     data['totalQuestions'] = totalQuestions; | ||||
|     data['marathonBufferTime'] = marathonBufferTime; | ||||
| 
 | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class Projects { | ||||
|   String? id; | ||||
|   String? nameEn; | ||||
|   String? nameAr; | ||||
|   String? projectCode; | ||||
| 
 | ||||
|   Projects({id, nameEn, nameAr, projectCode}); | ||||
| 
 | ||||
|   Projects.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     nameEn = json['nameEn']; | ||||
|     nameAr = json['nameAr']; | ||||
|     projectCode = json['projectCode']; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = <String, dynamic>{}; | ||||
|     data['id'] = id; | ||||
|     data['nameEn'] = nameEn; | ||||
|     data['nameAr'] = nameAr; | ||||
|     data['projectCode'] = projectCode; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class Sponsors { | ||||
|   String? id; | ||||
|   String? nameEn; | ||||
|   String? nameAr; | ||||
|   String? image; | ||||
|   String? video; | ||||
|   String? logo; | ||||
|   List<SponsorPrizes>? sponsorPrizes; | ||||
| 
 | ||||
|   Sponsors({id, nameEn, nameAr, image, video, logo, sponsorPrizes}); | ||||
| 
 | ||||
|   Sponsors.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     nameEn = json['nameEn']; | ||||
|     nameAr = json['nameAr']; | ||||
|     image = json['image']; | ||||
|     video = json['video']; | ||||
|     logo = json['logo']; | ||||
|     if (json['sponsorPrizes'] != null) { | ||||
|       sponsorPrizes = <SponsorPrizes>[]; | ||||
|       json['sponsorPrizes'].forEach((v) { | ||||
|         sponsorPrizes!.add(SponsorPrizes.fromJson(v)); | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = <String, dynamic>{}; | ||||
|     data['id'] = id; | ||||
|     data['nameEn'] = nameEn; | ||||
|     data['nameAr'] = nameAr; | ||||
|     data['image'] = image; | ||||
|     data['video'] = video; | ||||
|     data['logo'] = logo; | ||||
|     if (sponsorPrizes != null) { | ||||
|       data['sponsorPrizes'] = sponsorPrizes!.map((v) => v.toJson()).toList(); | ||||
|     } | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class SponsorPrizes { | ||||
|   String? id; | ||||
|   String? marathonPrizeEn; | ||||
|   String? marathonPrizeAr; | ||||
| 
 | ||||
|   SponsorPrizes({id, marathonPrizeEn, marathonPrizeAr}); | ||||
| 
 | ||||
|   SponsorPrizes.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     marathonPrizeEn = json['marathonPrizeEn']; | ||||
|     marathonPrizeAr = json['marathonPrizeAr']; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = <String, dynamic>{}; | ||||
|     data['id'] = id; | ||||
|     data['marathonPrizeEn'] = marathonPrizeEn; | ||||
|     data['marathonPrizeAr'] = marathonPrizeAr; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class Questions { | ||||
|   String? id; | ||||
|   String? titleEn; | ||||
|   String? titleAr; | ||||
|   String? marathonId; | ||||
|   int? questionTypeId; | ||||
|   int? questionTime; | ||||
|   int? nextQuestGap; | ||||
|   int? gapType; | ||||
|   String? gapValue; | ||||
|   String? gapImage; | ||||
|   int? questOptionsLimit; | ||||
|   List? questionOptions; | ||||
| 
 | ||||
|   Questions({id, titleEn, titleAr, marathonId, questionTypeId, questionTime, nextQuestGap, gapType, gapValue, gapImage, questOptionsLimit, questionOptions}); | ||||
| 
 | ||||
|   Questions.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     titleEn = json['titleEn']; | ||||
|     titleAr = json['titleAr']; | ||||
|     marathonId = json['marathonId']; | ||||
|     questionTypeId = json['questionTypeId']; | ||||
|     questionTime = json['questionTime']; | ||||
|     nextQuestGap = json['nextQuestGap']; | ||||
|     gapType = json['gapType']; | ||||
|     gapValue = json['gapValue']; | ||||
|     gapImage = json['gapImage']; | ||||
|     questOptionsLimit = json['questOptionsLimit']; | ||||
|     questionOptions = json['questionOptions']; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = <String, dynamic>{}; | ||||
|     data['id'] = id; | ||||
|     data['titleEn'] = titleEn; | ||||
|     data['titleAr'] = titleAr; | ||||
|     data['marathonId'] = marathonId; | ||||
|     data['questionTypeId'] = questionTypeId; | ||||
|     data['questionTime'] = questionTime; | ||||
|     data['nextQuestGap'] = nextQuestGap; | ||||
|     data['gapType'] = gapType; | ||||
|     data['gapValue'] = gapValue; | ||||
|     data['gapImage'] = gapImage; | ||||
|     data['questOptionsLimit'] = questOptionsLimit; | ||||
|     data['questionOptions'] = questionOptions; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| class DisclosureGenericModel { | ||||
|   DisclosureGenericModel({ | ||||
|     this.data, | ||||
|     this.isSuccessful, | ||||
|     this.message, | ||||
|     this.statusCode, | ||||
|     this.errors, | ||||
|   }); | ||||
| 
 | ||||
|   dynamic data; | ||||
|   bool? isSuccessful; | ||||
|   String? message; | ||||
|   int? statusCode; | ||||
|   dynamic errors; | ||||
| 
 | ||||
|   factory DisclosureGenericModel.fromJson(Map<String, dynamic> json) => DisclosureGenericModel( | ||||
|         data: json["data"], | ||||
|         isSuccessful: json["isSuccessful"], | ||||
|         message: json["message"], | ||||
|         statusCode: json["statusCode"], | ||||
|         errors: json["errors"], | ||||
|       ); | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() => { | ||||
|         "data": data, | ||||
|         "isSuccessful": isSuccessful, | ||||
|         "message": message, | ||||
|         "statusCode": statusCode, | ||||
|         "errors": errors, | ||||
|       }; | ||||
| } | ||||
| @ -0,0 +1,108 @@ | ||||
| enum DisclosureQuestionsOptionStatus { correct, wrong, selected, unSelected } | ||||
| 
 | ||||
| enum DisclosureQuestionCardStatus { question, wrongAnswer, correctAnswer, skippedAnswer, completed, findingWinner, winnerFound } | ||||
| 
 | ||||
| class DisclosureQuestionModel { | ||||
|   String? id; | ||||
|   String? titleEn; | ||||
|   String? titleAr; | ||||
|   String? descEn; | ||||
|   String? descAr; | ||||
|   String? marathonId; | ||||
|   int? questionTypeId; | ||||
|   int? questionTime; | ||||
|   int? nextQuestGap; | ||||
|   int? gapType; | ||||
|   String? gapText; | ||||
|   String? gapImage; | ||||
|   int? questOptionsLimit; | ||||
|   int? remainingParticipantCount; | ||||
|   List<QuestionOptions>? questionOptions; | ||||
| 
 | ||||
|   DisclosureQuestionModel({ | ||||
|     String? id, | ||||
|     String? titleEn, | ||||
|     String? titleAr, | ||||
|     String? descEn, | ||||
|     String? descAr, | ||||
|     String? marathonId, | ||||
|     int? questionTypeId, | ||||
|     int? questionTime, | ||||
|     int? nextQuestGap, | ||||
|     int? gapType, | ||||
|     String? gapText, | ||||
|     String? gapImage, | ||||
|     int? questOptionsLimit, | ||||
|     int? remainingParticipantCount, | ||||
|     List<QuestionOptions>? questionOptions, | ||||
|   }); | ||||
| 
 | ||||
|   DisclosureQuestionModel.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     titleEn = json['titleEn']; | ||||
|     titleAr = json['titleAr']; | ||||
|     descEn = json['desEn']; | ||||
|     descAr = json['desAr']; | ||||
|     marathonId = json['marathonId']; | ||||
|     questionTypeId = json['questionTypeId']; | ||||
|     questionTime = json['questionTime']; | ||||
|     nextQuestGap = json['nextQuestGap']; | ||||
|     gapType = json['gapType']; | ||||
|     gapText = json['gapText']; | ||||
|     gapImage = json['gapImage']; | ||||
|     questOptionsLimit = json['questOptionsLimit']; | ||||
|     remainingParticipantCount = json['remainingParticipantCount']; | ||||
|     if (json['questionOptions'] != null) { | ||||
|       questionOptions = <QuestionOptions>[]; | ||||
|       json['questionOptions'].forEach((v) { | ||||
|         questionOptions!.add(QuestionOptions.fromJson(v)); | ||||
|       }); | ||||
|       questionOptions!.sort((QuestionOptions a, QuestionOptions b) => a.sequence!.compareTo(b.sequence!)); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class QuestionOptions { | ||||
|   String? id; | ||||
|   String? titleEn; | ||||
|   String? titleAr; | ||||
|   String? questionId; | ||||
|   int? sequence; | ||||
|   String? image; | ||||
|   bool? isCorrectOption; | ||||
|   DisclosureQuestionsOptionStatus? optionStatus; | ||||
| 
 | ||||
|   QuestionOptions({ | ||||
|     String? id, | ||||
|     String? titleEn, | ||||
|     String? titleAr, | ||||
|     String? questionId, | ||||
|     int? sequence, | ||||
|     String? image, | ||||
|     bool? isCorrectOption, | ||||
|     DisclosureQuestionsOptionStatus? optionStatus, | ||||
|   }); | ||||
| 
 | ||||
|   QuestionOptions.fromJson(Map<String, dynamic> json) { | ||||
|     id = json['id']; | ||||
|     titleEn = json['titleEn']; | ||||
|     titleAr = json['titleAr']; | ||||
|     questionId = json['questionId']; | ||||
|     sequence = json['sequence']; | ||||
|     image = json['image']; | ||||
|     isCorrectOption = json['isCorrectOption']; | ||||
|     optionStatus = DisclosureQuestionsOptionStatus.unSelected; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     Map<String, dynamic> data = <String, dynamic>{}; | ||||
|     data['id'] = id; | ||||
|     data['titleEn'] = titleEn; | ||||
|     data['titleAr'] = titleAr; | ||||
|     data['questionId'] = questionId; | ||||
|     data['sequence'] = sequence; | ||||
|     data['image'] = image; | ||||
|     data['isCorrectOption'] = isCorrectOption; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,45 @@ | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/widgets/disclosure_details_card.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:provider/provider.dart'; | ||||
| 
 | ||||
| class DisclosureIntroScreen extends StatelessWidget { | ||||
|   const DisclosureIntroScreen({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     DisclosureProvider provider = context.watch<DisclosureProvider>(); | ||||
|     return Scaffold( | ||||
|       appBar: AppBarWidget( | ||||
|         context, | ||||
|         title: LocaleKeys.disclosure.tr(), | ||||
|         onHomeTapped: () { | ||||
|           Navigator.pop(context); | ||||
|           context.setLocale(provider.savedLocale); | ||||
|         }, | ||||
|         onBackTapped: () { | ||||
|           Navigator.pop(context); | ||||
|           context.setLocale(provider.savedLocale); | ||||
|         }, | ||||
|       ), | ||||
|       body: Column( | ||||
|         children: <Widget>[ | ||||
|           ListView( | ||||
|             padding: const EdgeInsets.all(21), | ||||
|             children: <Widget>[ | ||||
|               DisclosureDetailsCard(disclosureDetailsCard: provider.disclosureDetailsModel), | ||||
|             ], | ||||
|           ).expanded, | ||||
|           1.divider, | ||||
|           DefaultButton("Start", () => provider.onStartDisclosurePressed(context)).insideContainer, | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,189 @@ | ||||
| import 'dart:async'; | ||||
| import 'dart:developer'; | ||||
| 
 | ||||
| import 'package:appinio_swiper/appinio_swiper.dart'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/api/marathon/demo_marathon_repo.dart'; | ||||
| import 'package:mohem_flutter_app/classes/utils.dart'; | ||||
| import 'package:mohem_flutter_app/config/routes.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_details_model.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_question_model.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/widgets/disclosure_question_card.dart'; | ||||
| 
 | ||||
| class DisclosureProvider extends ChangeNotifier { | ||||
|   //************************************************ VARIABLES ********************************************************** | ||||
| 
 | ||||
|   final AppinioSwiperController swiperController = AppinioSwiperController(); | ||||
|   DisclosureQuestionsOptionStatus currentQuestionSelectionStatus = DisclosureQuestionsOptionStatus.unSelected; | ||||
|   DisclosureDetailsModel disclosureDetailsModel = DisclosureDetailsModel(); | ||||
|   List<DisclosureCardContent> cardContentList = <DisclosureCardContent>[]; | ||||
|   DisclosureQuestionModel currentQuestion = DisclosureQuestionModel(); | ||||
|   List<DisclosureQuestionCardStatus> answerStatusesList = <DisclosureQuestionCardStatus>[]; | ||||
|   DisclosureQuestionCardStatus questionCardStatus = DisclosureQuestionCardStatus.question; | ||||
|   int? selectedOptionIndex; | ||||
|   String? selectedOptionId; | ||||
|   int? totalQualifiers; | ||||
|   Locale savedLocale = const Locale("en", "US"); | ||||
| 
 | ||||
|   bool iAmWinner = false; | ||||
|   bool isGettingQualifiers = false; | ||||
|   bool isPrivilegedWithMarathon = false; | ||||
| 
 | ||||
|   bool _isLoading = false; | ||||
| 
 | ||||
|   bool get isLoading => _isLoading; | ||||
| 
 | ||||
|   set isLoading(bool value) { | ||||
|     _isLoading = value; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   bool _isButtonEnabled = false; | ||||
| 
 | ||||
|   bool get isButtonEnabled => _isButtonEnabled; | ||||
| 
 | ||||
|   set isButtonEnabled(bool value) { | ||||
|     _isButtonEnabled = value; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   int _currentQuestionNumber = 0; | ||||
| 
 | ||||
|   int get currentQuestionNumber => _currentQuestionNumber; | ||||
| 
 | ||||
|   set currentQuestionNumber(int value) { | ||||
|     _currentQuestionNumber = value; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   String currentAdditionalText = ""; | ||||
| 
 | ||||
|   void updateCurrentAdditionalText(String value) { | ||||
|     currentAdditionalText = value; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   void updateCurrentSelectionYesNo(DisclosureQuestionsOptionStatus value) { | ||||
|     currentQuestionSelectionStatus = value; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   //************************************************ FUNCTIONS ********************************************************** | ||||
| 
 | ||||
|   Future<void> callNextQuestionApi() async { | ||||
|     if (currentQuestionNumber < (disclosureDetailsModel.totalQuestions!)) { | ||||
|       if (currentQuestionNumber == 0) { | ||||
|         for (int i = 1; i <= disclosureDetailsModel.totalQuestions!; i++) { | ||||
|           cardContentList.add(const DisclosureCardContent()); | ||||
|         } | ||||
|         currentQuestion = await DisclosureRepo().getDisclosureNextQuestion(currentQuestionNumber: currentQuestionNumber); | ||||
|         updateCardData(); | ||||
|         if (Utils.isLoading) { | ||||
|           Utils.hideLoading(AppRoutes.navigatorKey.currentContext!); | ||||
|         } | ||||
|         Navigator.pushReplacementNamed(AppRoutes.navigatorKey.currentContext!, AppRoutes.disclosureScreen); | ||||
|       } else { | ||||
|         currentQuestion = await DisclosureRepo().getDisclosureNextQuestion(currentQuestionNumber: currentQuestionNumber); | ||||
|         updateCardData(); | ||||
|       } | ||||
|       notifyListeners(); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   Future<void> callPreviousQuestionApi() async { | ||||
|     currentQuestion = await DisclosureRepo().getDisclosureNextQuestion(currentQuestionNumber: currentQuestionNumber - 2); | ||||
|     updateCardData(isForPrevious: true); | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   void updateCardData({bool isForPrevious = false}) { | ||||
|     if (isForPrevious) { | ||||
|       selectedOptionIndex = null; | ||||
|       currentQuestionNumber--; | ||||
| 
 | ||||
|       cardContentList.add(const DisclosureCardContent()); | ||||
|       cardContentList.add(const DisclosureCardContent()); | ||||
|       swiperController.swipeLeft(); | ||||
|       questionCardStatus = DisclosureQuestionCardStatus.question; | ||||
|       notifyListeners(); | ||||
|       return; | ||||
|     } | ||||
|     if (currentQuestionNumber > 0) { | ||||
|       swiperController.swipeRight(); | ||||
|     } | ||||
| 
 | ||||
|     selectedOptionIndex = null; | ||||
|     currentQuestionNumber++; | ||||
|     questionCardStatus = DisclosureQuestionCardStatus.question; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   void populateQuestionStatusesList() { | ||||
|     answerStatusesList.clear(); | ||||
|     if (disclosureDetailsModel.totalQuestions != null) { | ||||
|       for (int i = 0; i < disclosureDetailsModel.totalQuestions!; i++) { | ||||
|         answerStatusesList.add(DisclosureQuestionCardStatus.question); | ||||
|       } | ||||
|       notifyListeners(); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   void updateCurrentQuestionOptionStatus({required DisclosureQuestionsOptionStatus status, required int selectedOptIndex, required int correctOptionIndex}) { | ||||
|     if (selectedOptIndex == 0) { | ||||
|       updateCurrentSelectionYesNo(DisclosureQuestionsOptionStatus.correct); | ||||
|     } else if (selectedOptIndex == 1) { | ||||
|       updateCurrentSelectionYesNo(DisclosureQuestionsOptionStatus.wrong); | ||||
|     } | ||||
|     for (int i = 0; i < currentQuestion.questionOptions!.length; i++) { | ||||
|       currentQuestion.questionOptions![i].optionStatus = DisclosureQuestionsOptionStatus.unSelected; | ||||
|     } | ||||
|     if (status == DisclosureQuestionsOptionStatus.wrong) { | ||||
|       currentQuestion.questionOptions![correctOptionIndex].optionStatus = DisclosureQuestionsOptionStatus.correct; // if person's answer is wrong we have to show him the actual right answer | ||||
|     } | ||||
|     currentQuestion.questionOptions![selectedOptIndex].optionStatus = status; | ||||
|     selectedOptionId = currentQuestion.questionOptions![selectedOptIndex].id; | ||||
|     selectedOptionIndex = selectedOptIndex; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   void updateQuestionCardStatus(DisclosureQuestionCardStatus status) { | ||||
|     questionCardStatus = status; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   void updateAnswerStatusesList(DisclosureQuestionCardStatus status) { | ||||
|     answerStatusesList[currentQuestionNumber - 1] = status; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   void resetValues() async { | ||||
|     _currentQuestionNumber = 0; | ||||
|     iAmWinner = false; | ||||
|     cardContentList.clear(); | ||||
|     isButtonEnabled = false; | ||||
|     currentQuestion = DisclosureQuestionModel(); | ||||
|     if (answerStatusesList.isNotEmpty) { | ||||
|       for (int i = 0; i < answerStatusesList.length; i++) { | ||||
|         answerStatusesList[i] = DisclosureQuestionCardStatus.question; | ||||
|       } | ||||
|     } | ||||
|     currentQuestionSelectionStatus = DisclosureQuestionsOptionStatus.unSelected; | ||||
|     AppRoutes.navigatorKey.currentContext!.setLocale(savedLocale); | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   Future<void> getDisclosureDetails() async { | ||||
|     isLoading = true; | ||||
|     notifyListeners(); | ||||
|     disclosureDetailsModel = await DisclosureRepo().getDisclosureDetails(); | ||||
|     populateQuestionStatusesList(); | ||||
|     isLoading = false; | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   Future<void> onStartDisclosurePressed(BuildContext context) async { | ||||
|     await callNextQuestionApi(); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,115 @@ | ||||
| import 'dart:async'; | ||||
| import 'dart:developer'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/config/routes.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_question_model.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/widgets/disclosure_progress_container.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/widgets/disclosure_question_card.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart'; | ||||
| import 'package:provider/provider.dart'; | ||||
| 
 | ||||
| class DisclosureScreen extends StatelessWidget { | ||||
|   const DisclosureScreen({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     DisclosureProvider provider = context.watch<DisclosureProvider>(); | ||||
|     bool isLastQuestion = provider.currentQuestionNumber == provider.disclosureDetailsModel.totalQuestions!; | ||||
|     bool isButtonDisabled = (provider.currentQuestionSelectionStatus != DisclosureQuestionsOptionStatus.correct && provider.currentQuestionSelectionStatus != DisclosureQuestionsOptionStatus.wrong) || | ||||
|         (provider.currentQuestionSelectionStatus == DisclosureQuestionsOptionStatus.correct && provider.currentAdditionalText.isEmpty) && !isLastQuestion || | ||||
|         (isLastQuestion && provider.currentQuestionSelectionStatus == DisclosureQuestionsOptionStatus.wrong); | ||||
| 
 | ||||
|     return WillPopScope( | ||||
|       child: Scaffold( | ||||
|         appBar: AppBarWidget( | ||||
|           context, | ||||
|           title: LocaleKeys.disclosure.tr(), | ||||
|           onHomeTapped: () { | ||||
|             showDialog( | ||||
|               context: context, | ||||
|               builder: (BuildContext context) => ConfirmDialog( | ||||
|                 message: LocaleKeys.areYouSureYouWantToGoBack.tr(), | ||||
|                 onTap: () { | ||||
|                   provider.resetValues(); | ||||
|                   provider.getDisclosureDetails(); | ||||
|                   Navigator.of(context).popUntil(ModalRoute.withName(AppRoutes.dashboard)); | ||||
|                 }, | ||||
|               ), | ||||
|             ); | ||||
|           }, | ||||
|           onBackTapped: () async { | ||||
|             if (provider.currentQuestionNumber > 1) { | ||||
|               await provider.callPreviousQuestionApi(); | ||||
|               return; | ||||
|             } | ||||
|             showDialog( | ||||
|               context: context, | ||||
|               builder: (BuildContext context) => ConfirmDialog( | ||||
|                 message: LocaleKeys.areYouSureYouWantToGoBack.tr(), | ||||
|                 onTap: () { | ||||
|                   provider.resetValues(); | ||||
|                   Navigator.of(context).popUntil(ModalRoute.withName(AppRoutes.dashboard)); | ||||
|                 }, | ||||
|               ), | ||||
|             ); | ||||
|           }, | ||||
|         ), | ||||
|         body: Column( | ||||
|           children: <Widget>[ | ||||
|             ListView( | ||||
|               shrinkWrap: true, | ||||
|               children: <Widget>[ | ||||
|                 10.height, | ||||
|                 DisclosureProgressContainer(provider: provider).paddingOnly(left: 21, right: 21), | ||||
|                 const DisclosureQuestionCard().paddingOnly(top: 12, left: 21, right: 21), | ||||
|               ], | ||||
|             ).expanded, | ||||
|             DefaultButton( | ||||
|               isLastQuestion ? LocaleKeys.submit.tr() : LocaleKeys.next.tr(), | ||||
|               isButtonDisabled | ||||
|                   ? null | ||||
|                   : () async { | ||||
|                       if (isLastQuestion) { | ||||
|                         provider.resetValues(); | ||||
|                         provider.getDisclosureDetails(); | ||||
|                         Navigator.of(context).popUntil(ModalRoute.withName(AppRoutes.dashboard)); | ||||
|                         return; | ||||
|                       } | ||||
|                       provider.updateCurrentSelectionYesNo(DisclosureQuestionsOptionStatus.unSelected); | ||||
|                       provider.updateAnswerStatusesList(DisclosureQuestionCardStatus.correctAnswer); | ||||
|                       await provider.callNextQuestionApi(); | ||||
|                     }, | ||||
|               textColor: !isButtonDisabled ? MyColors.whiteColor : MyColors.greyACColor, | ||||
|               color: isLastQuestion ? MyColors.greenColor : null, | ||||
|             ).insideContainer, | ||||
|           ], | ||||
|         ), | ||||
|       ), | ||||
|       onWillPop: () async { | ||||
|         if (provider.currentQuestionNumber > 1) { | ||||
|           await provider.callPreviousQuestionApi(); | ||||
|           return Future<bool>.value(false); | ||||
|         } | ||||
|         showDialog( | ||||
|           context: context, | ||||
|           builder: (BuildContext context) => ConfirmDialog( | ||||
|             message: LocaleKeys.areYouSureYouWantToGoBack.tr(), | ||||
|             onTap: () { | ||||
|               provider.resetValues(); | ||||
|               Navigator.of(context).popUntil(ModalRoute.withName(AppRoutes.dashboard)); | ||||
|             }, | ||||
|           ), | ||||
|         ); | ||||
|         return Future<bool>.value(false); | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,176 @@ | ||||
| import 'dart:ui' as ui; | ||||
| 
 | ||||
| import 'package:auto_size_text/auto_size_text.dart'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_countdown_timer/current_remaining_time.dart'; | ||||
| import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/main.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| 
 | ||||
| class DisclosureCountdownTimerForMainScreen extends StatelessWidget { | ||||
|   final int timeToMarathon; | ||||
|   final DisclosureProvider provider; | ||||
| 
 | ||||
|   DisclosureCountdownTimerForMainScreen({ | ||||
|     Key? key, | ||||
|     required this.provider, | ||||
|     required this.timeToMarathon, | ||||
|   }) : super(key: key); | ||||
| 
 | ||||
|   final TextStyle styleTextHome = TextStyle( | ||||
|     color: MyColors.white.withOpacity(0.45), | ||||
|     fontStyle: FontStyle.italic, | ||||
|     fontWeight: FontWeight.w800, | ||||
|     letterSpacing: -0.4, | ||||
|   ); | ||||
| 
 | ||||
|   final TextStyle styleDigitHome = TextStyle( | ||||
|     height: 22 / 27, | ||||
|     color: MyColors.white, | ||||
|     fontSize: isTablet ? 30 : 15, | ||||
|     fontStyle: FontStyle.italic, | ||||
|     letterSpacing: -1.44, | ||||
|     fontWeight: FontWeight.bold, | ||||
|   ); | ||||
| 
 | ||||
|   final TextStyle styleTextMarathon = const TextStyle( | ||||
|     fontSize: 10, | ||||
|     fontStyle: FontStyle.normal, | ||||
|     fontWeight: FontWeight.w600, | ||||
|     color: MyColors.grey57Color, | ||||
|     letterSpacing: -0.4, | ||||
|   ); | ||||
| 
 | ||||
|   final TextStyle styleDigitMarathon = const TextStyle( | ||||
|     height: 23 / 24, | ||||
|     color: MyColors.darkTextColor, | ||||
|     fontSize: 34, | ||||
|     letterSpacing: -1.44, | ||||
|     fontWeight: FontWeight.bold, | ||||
|   ); | ||||
| 
 | ||||
|   Widget buildSeparator() { | ||||
|     return AutoSizeText( | ||||
|       "  :  ", | ||||
|       maxFontSize: 24, | ||||
|       minFontSize: 20, | ||||
|       style: styleDigitHome, | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget getTimeDigit(String text) { | ||||
|     return AutoSizeText( | ||||
|       text, | ||||
|       maxFontSize: 24, | ||||
|       minFontSize: 20, | ||||
|       style: styleDigitHome, | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget getTimeText(String text) { | ||||
|     return AutoSizeText( | ||||
|       text, | ||||
|       minFontSize: 7, | ||||
|       maxFontSize: 8, | ||||
|       style: styleTextHome, | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget buildEmptyWidget() { | ||||
|     return Directionality( | ||||
|       textDirection: ui.TextDirection.ltr, | ||||
|       child: Row( | ||||
|         mainAxisSize: MainAxisSize.min, | ||||
|         mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: <Widget>[ | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               getTimeDigit("00"), | ||||
|               getTimeText(LocaleKeys.days.tr()), | ||||
|             ], | ||||
|           ), | ||||
|           buildSeparator(), | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               getTimeDigit("00"), | ||||
|               getTimeText(LocaleKeys.hours.tr()), | ||||
|             ], | ||||
|           ), | ||||
|           buildSeparator(), | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               getTimeDigit("00"), | ||||
|               getTimeText(LocaleKeys.minutes.tr()), | ||||
|             ], | ||||
|           ), | ||||
|           buildSeparator(), | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               getTimeDigit("00"), | ||||
|               getTimeText(LocaleKeys.seconds.tr()), | ||||
|             ], | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget buildCountdownTimer(CurrentRemainingTime? time) { | ||||
|     if (time == null) { | ||||
|       return buildEmptyWidget(); | ||||
|     } | ||||
| 
 | ||||
|     return Directionality( | ||||
|       textDirection: ui.TextDirection.ltr, | ||||
|       child: Row( | ||||
|         mainAxisSize: MainAxisSize.min, | ||||
|         mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: <Widget>[ | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               time.days == null ? getTimeDigit("00") : getTimeDigit(time.days! < 10 ? "0${time.days.toString()}" : time.days.toString()), | ||||
|               getTimeText(LocaleKeys.days.tr()), | ||||
|             ], | ||||
|           ), | ||||
|           buildSeparator(), | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               time.hours == null ? getTimeDigit("00") : getTimeDigit(time.hours! < 10 ? "0${time.hours.toString()}" : time.hours.toString()), | ||||
|               getTimeText(LocaleKeys.hours.tr()), | ||||
|             ], | ||||
|           ), | ||||
|           buildSeparator(), | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               time.min == null ? getTimeDigit("00") : getTimeDigit(time.min! < 10 ? "0${time.min.toString()}" : time.min.toString()), | ||||
|               getTimeText(LocaleKeys.minutes.tr()), | ||||
|             ], | ||||
|           ), | ||||
|           buildSeparator(), | ||||
|           Column( | ||||
|             children: <Widget>[ | ||||
|               time.sec == null ? getTimeDigit("00") : getTimeDigit(time.sec! < 10 ? "0${time.sec.toString()}" : time.sec.toString()), | ||||
|               getTimeText(LocaleKeys.seconds.tr()), | ||||
|             ], | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return CountdownTimer( | ||||
|       endTime: timeToMarathon, | ||||
|       onEnd: null, | ||||
|       widgetBuilder: (BuildContext context, CurrentRemainingTime? time) { | ||||
|         return buildCountdownTimer(time); | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,36 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/decorations_helper.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| 
 | ||||
| class DisclosureCustomStatusWidget extends StatelessWidget { | ||||
|   final Widget asset; | ||||
|   final Widget title; | ||||
|   final Widget subTitle; | ||||
| 
 | ||||
|   const DisclosureCustomStatusWidget({ | ||||
|     Key? key, | ||||
|     required this.asset, | ||||
|     required this.title, | ||||
|     required this.subTitle, | ||||
|   }) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: 440, | ||||
|       decoration: MyDecorations.shadowDecoration, | ||||
|       padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20), | ||||
|       child: Column( | ||||
|         mainAxisAlignment: MainAxisAlignment.center, | ||||
|         children: <Widget>[ | ||||
|           asset, | ||||
|           50.height, | ||||
|           title, | ||||
|           10.height, | ||||
|           subTitle, | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,556 @@ | ||||
| // import 'dart:developer'; | ||||
| // import 'dart:math' as math; | ||||
| // | ||||
| // import 'package:easy_localization/easy_localization.dart'; | ||||
| // import 'package:flutter/foundation.dart'; | ||||
| // import 'package:flutter/material.dart'; | ||||
| // import 'package:flutter_svg/flutter_svg.dart'; | ||||
| // import 'package:mohem_flutter_app/app_state/app_state.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/decorations_helper.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/utils.dart'; | ||||
| // import 'package:mohem_flutter_app/config/routes.dart'; | ||||
| // import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| // import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| // import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| // import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| // import 'package:mohem_flutter_app/main.dart'; | ||||
| // import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| // import 'package:mohem_flutter_app/ui/disclosure/widgets/countdown_timer_main_screen.dart'; | ||||
| // import 'package:provider/provider.dart'; | ||||
| // | ||||
| // // It is used to pass a dummy time to test Marathon | ||||
| // int dummyTime = DateTime.now().millisecondsSinceEpoch + 8690; | ||||
| // | ||||
| // class DisclosureBanner extends StatelessWidget { | ||||
| //   const DisclosureBanner({Key? key}) : super(key: key); | ||||
| // | ||||
| //   Widget getUnPrivilegedMarathon(BuildContext context) { | ||||
| //     return Container( | ||||
| //       decoration: MyDecorations.shadowDecoration, | ||||
| //       height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, | ||||
| //       clipBehavior: Clip.antiAlias, | ||||
| //       child: Stack( | ||||
| //         children: <Widget>[ | ||||
| //           Transform( | ||||
| //             alignment: Alignment.center, | ||||
| //             transform: Matrix4.rotationY( | ||||
| //               AppState().isArabic(context) ? math.pi : 0, | ||||
| //             ), | ||||
| //             child: SvgPicture.asset( | ||||
| //               "assets/images/marathon_banner_bg.svg", | ||||
| //               fit: BoxFit.fill, | ||||
| //               width: double.infinity, | ||||
| //             ), | ||||
| //           ), | ||||
| //           AppState().isArabic(context) | ||||
| //               ? Positioned( | ||||
| //                   right: -15, | ||||
| //                   top: -10, | ||||
| //                   child: Transform.rotate( | ||||
| //                     angle: 10, | ||||
| //                     child: Container( | ||||
| //                       width: isTablet ? 70 : 65, | ||||
| //                       height: isTablet ? 40 : 32, | ||||
| //                       color: MyColors.darkDigitColor, | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ) | ||||
| //               : Positioned( | ||||
| //                   left: -20, | ||||
| //                   top: -10, | ||||
| //                   child: Transform.rotate( | ||||
| //                     angle: 15, | ||||
| //                     child: Container( | ||||
| //                       width: isTablet ? 70 : 65, | ||||
| //                       height: isTablet ? 40 : 32, | ||||
| //                       color: MyColors.darkDigitColor, | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ), | ||||
| //           SizedBox( | ||||
| //             width: double.infinity, | ||||
| //             height: double.infinity, | ||||
| //             child: Row( | ||||
| //               children: <Widget>[ | ||||
| //                 const Expanded( | ||||
| //                   flex: 3, | ||||
| //                   child: SizedBox( | ||||
| //                     width: double.infinity, | ||||
| //                     height: double.infinity, | ||||
| //                   ), | ||||
| //                 ), | ||||
| //                 Expanded( | ||||
| //                   flex: AppState().isArabic(context) ? 4 : 5, | ||||
| //                   child: SizedBox( | ||||
| //                     width: double.infinity, | ||||
| //                     height: double.infinity, | ||||
| //                     child: Row( | ||||
| //                       mainAxisAlignment: MainAxisAlignment.start, | ||||
| //                       children: <Widget>[ | ||||
| //                         Column( | ||||
| //                           mainAxisAlignment: MainAxisAlignment.center, | ||||
| //                           crossAxisAlignment: CrossAxisAlignment.start, | ||||
| //                           mainAxisSize: MainAxisSize.min, | ||||
| //                           children: <Widget>[ | ||||
| //                             AppState().isArabic(context) ? 0.height : 5.height, | ||||
| //                             Text( | ||||
| //                               LocaleKeys.getReadyForContest.tr(), | ||||
| //                               style: TextStyle( | ||||
| //                                 fontSize: isTablet ? 20 : 11, | ||||
| //                                 fontStyle: FontStyle.italic, | ||||
| //                                 fontWeight: FontWeight.w600, | ||||
| //                                 color: MyColors.white.withOpacity(0.83), | ||||
| //                                 letterSpacing: -0.4, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                             Text( | ||||
| //                               LocaleKeys.brainMarathon.tr(), | ||||
| //                               style: TextStyle( | ||||
| //                                 fontStyle: FontStyle.italic, | ||||
| //                                 fontSize: isTablet ? 30 : 19, | ||||
| //                                 fontWeight: FontWeight.bold, | ||||
| //                                 color: MyColors.white.withOpacity(0.83), | ||||
| //                                 height: 32 / 22, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ], | ||||
| //                         ).paddingOnly( | ||||
| //                           left: AppState().isArabic(context) ? 12 : 3, | ||||
| //                           right: AppState().isArabic(context) ? 3 : 12, | ||||
| //                         ) | ||||
| //                       ], | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ), | ||||
| //               ], | ||||
| //             ), | ||||
| //           ), | ||||
| //           AppState().isArabic(context) | ||||
| //               ? Align( | ||||
| //                   alignment: Alignment.topRight, | ||||
| //                   child: SizedBox( | ||||
| //                     height: isTablet ? 30 : 20, | ||||
| //                     width: isTablet ? 45 : 35, | ||||
| //                     child: Transform.rotate( | ||||
| //                       angle: math.pi / 4.5, | ||||
| //                       child: Text( | ||||
| //                         LocaleKeys.brainMarathon.tr(), | ||||
| //                         textAlign: TextAlign.center, | ||||
| //                         maxLines: 2, | ||||
| //                         style: TextStyle( | ||||
| //                           color: MyColors.white, | ||||
| //                           fontWeight: FontWeight.bold, | ||||
| //                           fontSize: isTablet ? 8 : 6, | ||||
| //                           height: 1.2, | ||||
| //                         ), | ||||
| //                       ), | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ).paddingOnly(top: 5) | ||||
| //               : Align( | ||||
| //                   alignment: Alignment.topLeft, | ||||
| //                   child: SizedBox( | ||||
| //                     height: isTablet ? 30 : 20, | ||||
| //                     width: isTablet ? 45 : 35, | ||||
| //                     child: Transform.rotate( | ||||
| //                       angle: -math.pi / 4.5, | ||||
| //                       child: Text( | ||||
| //                         LocaleKeys.brainMarathon.tr(), | ||||
| //                         textAlign: TextAlign.center, | ||||
| //                         maxLines: 2, | ||||
| //                         style: TextStyle( | ||||
| //                           color: MyColors.kWhiteColor, | ||||
| //                           fontWeight: FontWeight.bold, | ||||
| //                           fontSize: isTablet ? 8 : 6, | ||||
| //                           height: 1.2, | ||||
| //                         ), | ||||
| //                       ), | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ).paddingOnly(top: 5), | ||||
| //           Container( | ||||
| //             height: double.infinity, | ||||
| //             width: double.infinity, | ||||
| //             color: Colors.black.withOpacity(0.6), | ||||
| //             child: const Icon( | ||||
| //               Icons.lock_rounded, | ||||
| //               color: MyColors.lightGreyIconColor, | ||||
| //             ), | ||||
| //           ), | ||||
| //         ], | ||||
| //       ), | ||||
| //     ); | ||||
| //   } | ||||
| // | ||||
| //   Widget getNoUpcomingMarathonWidget(BuildContext context) { | ||||
| //     return Container( | ||||
| //       decoration: MyDecorations.shadowDecoration, | ||||
| //       height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, | ||||
| //       clipBehavior: Clip.antiAlias, | ||||
| //       child: Stack( | ||||
| //         children: <Widget>[ | ||||
| //           Transform( | ||||
| //             alignment: Alignment.center, | ||||
| //             transform: Matrix4.rotationY( | ||||
| //               AppState().isArabic(context) ? math.pi : 0, | ||||
| //             ), | ||||
| //             child: SvgPicture.asset( | ||||
| //               "assets/images/marathon_banner_bg.svg", | ||||
| //               fit: BoxFit.fill, | ||||
| //               width: double.infinity, | ||||
| //             ), | ||||
| //           ), | ||||
| //           AppState().isArabic(context) | ||||
| //               ? Positioned( | ||||
| //                   right: -15, | ||||
| //                   top: -10, | ||||
| //                   child: Transform.rotate( | ||||
| //                     angle: 10, | ||||
| //                     child: Container( | ||||
| //                       width: isTablet ? 70 : 65, | ||||
| //                       height: isTablet ? 40 : 32, | ||||
| //                       color: MyColors.darkDigitColor, | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ) | ||||
| //               : Positioned( | ||||
| //                   left: -20, | ||||
| //                   top: -10, | ||||
| //                   child: Transform.rotate( | ||||
| //                     angle: 15, | ||||
| //                     child: Container( | ||||
| //                       width: isTablet ? 70 : 65, | ||||
| //                       height: isTablet ? 40 : 32, | ||||
| //                       color: MyColors.darkDigitColor, | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ), | ||||
| //           SizedBox( | ||||
| //             width: double.infinity, | ||||
| //             height: double.infinity, | ||||
| //             child: Row( | ||||
| //               children: <Widget>[ | ||||
| //                 const Expanded( | ||||
| //                   flex: 3, | ||||
| //                   child: SizedBox( | ||||
| //                     width: double.infinity, | ||||
| //                     height: double.infinity, | ||||
| //                   ), | ||||
| //                 ), | ||||
| //                 Expanded( | ||||
| //                   flex: AppState().isArabic(context) ? 4 : 5, | ||||
| //                   child: SizedBox( | ||||
| //                     width: double.infinity, | ||||
| //                     height: double.infinity, | ||||
| //                     child: Row( | ||||
| //                       mainAxisAlignment: MainAxisAlignment.start, | ||||
| //                       children: <Widget>[ | ||||
| //                         Column( | ||||
| //                           mainAxisAlignment: MainAxisAlignment.center, | ||||
| //                           crossAxisAlignment: CrossAxisAlignment.start, | ||||
| //                           mainAxisSize: MainAxisSize.min, | ||||
| //                           children: <Widget>[ | ||||
| //                             AppState().isArabic(context) ? 0.height : 5.height, | ||||
| //                             Text( | ||||
| //                               LocaleKeys.noUpcoming.tr(), | ||||
| //                               style: TextStyle( | ||||
| //                                 fontSize: isTablet ? 20 : 11, | ||||
| //                                 fontStyle: FontStyle.italic, | ||||
| //                                 fontWeight: FontWeight.w600, | ||||
| //                                 color: MyColors.white.withOpacity(0.83), | ||||
| //                                 letterSpacing: -0.4, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                             Text( | ||||
| //                               LocaleKeys.brainMarathon.tr(), | ||||
| //                               style: TextStyle( | ||||
| //                                 fontStyle: FontStyle.italic, | ||||
| //                                 fontSize: isTablet ? 30 : 19, | ||||
| //                                 fontWeight: FontWeight.bold, | ||||
| //                                 color: MyColors.white.withOpacity(0.83), | ||||
| //                                 height: 32 / 22, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                             Text( | ||||
| //                               LocaleKeys.youCanPlayDemo.tr(), | ||||
| //                               style: TextStyle( | ||||
| //                                 fontSize: isTablet ? 20 : 11, | ||||
| //                                 fontStyle: FontStyle.italic, | ||||
| //                                 fontWeight: FontWeight.w600, | ||||
| //                                 color: MyColors.white.withOpacity(0.83), | ||||
| //                                 letterSpacing: -0.4, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ], | ||||
| //                         ).paddingOnly( | ||||
| //                           left: AppState().isArabic(context) ? 12 : 3, | ||||
| //                           right: AppState().isArabic(context) ? 3 : 12, | ||||
| //                         ) | ||||
| //                       ], | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ), | ||||
| //               ], | ||||
| //             ), | ||||
| //           ), | ||||
| //           AppState().isArabic(context) | ||||
| //               ? Align( | ||||
| //                   alignment: Alignment.topRight, | ||||
| //                   child: SizedBox( | ||||
| //                     height: isTablet ? 30 : 20, | ||||
| //                     width: isTablet ? 45 : 35, | ||||
| //                     child: Transform.rotate( | ||||
| //                       angle: math.pi / 4.5, | ||||
| //                       child: Text( | ||||
| //                         LocaleKeys.brainMarathon.tr(), | ||||
| //                         textAlign: TextAlign.center, | ||||
| //                         maxLines: 2, | ||||
| //                         style: TextStyle( | ||||
| //                           color: MyColors.white, | ||||
| //                           fontWeight: FontWeight.bold, | ||||
| //                           fontSize: isTablet ? 8 : 6, | ||||
| //                           height: 1.2, | ||||
| //                         ), | ||||
| //                       ), | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ).paddingOnly(top: 5) | ||||
| //               : Align( | ||||
| //                   alignment: Alignment.topLeft, | ||||
| //                   child: SizedBox( | ||||
| //                     height: isTablet ? 30 : 20, | ||||
| //                     width: isTablet ? 45 : 35, | ||||
| //                     child: Transform.rotate( | ||||
| //                       angle: -math.pi / 4.5, | ||||
| //                       child: Text( | ||||
| //                         LocaleKeys.brainMarathon.tr(), | ||||
| //                         textAlign: TextAlign.center, | ||||
| //                         maxLines: 2, | ||||
| //                         style: TextStyle( | ||||
| //                           color: MyColors.kWhiteColor, | ||||
| //                           fontWeight: FontWeight.bold, | ||||
| //                           fontSize: isTablet ? 8 : 6, | ||||
| //                           height: 1.2, | ||||
| //                         ), | ||||
| //                       ), | ||||
| //                     ), | ||||
| //                   ), | ||||
| //                 ).paddingOnly(top: 5), | ||||
| //         ], | ||||
| //       ), | ||||
| //     ).onPress(() { | ||||
| //       Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); | ||||
| //     }); | ||||
| //   } | ||||
| // | ||||
| //   @override | ||||
| //   Widget build(BuildContext context) { | ||||
| //     DisclosureProvider provider = context.read<DisclosureProvider>(); | ||||
| //     // if(provider.isUserWaiting) { | ||||
| //     //   provider.isUserWaiting = false; | ||||
| //     //   provider.getMarathonDetailsFromApi(); | ||||
| //     // } | ||||
| //     return !provider.isPrivilegedWithMarathon | ||||
| //         ? getUnPrivilegedMarathon(context) | ||||
| //         : provider.isUpComingMarathon | ||||
| //             ? Container( | ||||
| //                 decoration: MyDecorations.shadowDecoration, | ||||
| //                 height: isTablet ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.11, | ||||
| //                 clipBehavior: Clip.antiAlias, | ||||
| //                 child: Stack( | ||||
| //                   children: <Widget>[ | ||||
| //                     Transform( | ||||
| //                       alignment: Alignment.center, | ||||
| //                       transform: Matrix4.rotationY( | ||||
| //                         AppState().isArabic(context) ? math.pi : 0, | ||||
| //                       ), | ||||
| //                       child: SvgPicture.asset( | ||||
| //                         "assets/images/marathon_banner_bg.svg", | ||||
| //                         fit: BoxFit.fill, | ||||
| //                         width: double.infinity, | ||||
| //                       ), | ||||
| //                     ), | ||||
| //                     AppState().isArabic(context) | ||||
| //                         ? Positioned( | ||||
| //                             right: -15, | ||||
| //                             top: -10, | ||||
| //                             child: Transform.rotate( | ||||
| //                               angle: 10, | ||||
| //                               child: Container( | ||||
| //                                 width: isTablet ? 70 : 65, | ||||
| //                                 height: isTablet ? 40 : 32, | ||||
| //                                 color: MyColors.darkDigitColor, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ) | ||||
| //                         : Positioned( | ||||
| //                             left: -20, | ||||
| //                             top: -10, | ||||
| //                             child: Transform.rotate( | ||||
| //                               angle: 15, | ||||
| //                               child: Container( | ||||
| //                                 width: isTablet ? 70 : 65, | ||||
| //                                 height: isTablet ? 40 : 32, | ||||
| //                                 color: MyColors.darkDigitColor, | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ), | ||||
| //                     SizedBox( | ||||
| //                       width: double.infinity, | ||||
| //                       height: double.infinity, | ||||
| //                       child: Row( | ||||
| //                         children: <Widget>[ | ||||
| //                           const Expanded( | ||||
| //                             flex: 3, | ||||
| //                             child: SizedBox( | ||||
| //                               width: double.infinity, | ||||
| //                               height: double.infinity, | ||||
| //                             ), | ||||
| //                           ), | ||||
| //                           Expanded( | ||||
| //                             flex: AppState().isArabic(context) ? 4 : 5, | ||||
| //                             child: SizedBox( | ||||
| //                               width: double.infinity, | ||||
| //                               height: double.infinity, | ||||
| //                               child: Row( | ||||
| //                                 mainAxisAlignment: MainAxisAlignment.start, | ||||
| //                                 children: <Widget>[ | ||||
| //                                   Column( | ||||
| //                                     mainAxisAlignment: MainAxisAlignment.center, | ||||
| //                                     crossAxisAlignment: CrossAxisAlignment.start, | ||||
| //                                     mainAxisSize: MainAxisSize.min, | ||||
| //                                     children: <Widget>[ | ||||
| //                                       AppState().isArabic(context) ? 0.height : 5.height, | ||||
| //                                       Text( | ||||
| //                                         LocaleKeys.getReadyForContest.tr(), | ||||
| //                                         style: TextStyle( | ||||
| //                                           fontSize: isTablet ? 20 : 11, | ||||
| //                                           fontStyle: FontStyle.italic, | ||||
| //                                           fontWeight: FontWeight.w600, | ||||
| //                                           color: MyColors.white.withOpacity(0.83), | ||||
| //                                           letterSpacing: -0.4, | ||||
| //                                         ), | ||||
| //                                       ), | ||||
| //                                       Flexible( | ||||
| //                                         child: Text( | ||||
| //                                           displayLocalizedContent( | ||||
| //                                             isPhoneLangArabic: AppState().isArabic(context), | ||||
| //                                             selectedLanguage: provider.marathonDetailModel.selectedLanguage ?? 0, | ||||
| //                                             englishContent: provider.marathonDetailModel.titleEn ?? "", | ||||
| //                                             arabicContent: provider.marathonDetailModel.titleAr ?? "", | ||||
| //                                           ), | ||||
| //                                           overflow: TextOverflow.ellipsis, | ||||
| //                                           style: TextStyle( | ||||
| //                                             fontStyle: FontStyle.italic, | ||||
| //                                             fontSize: isTablet ? 30 : 19, | ||||
| //                                             fontWeight: FontWeight.bold, | ||||
| //                                             color: MyColors.white.withOpacity(0.83), | ||||
| //                                             height: 32 / 22, | ||||
| //                                           ), | ||||
| //                                         ), | ||||
| //                                       ), | ||||
| //                                       isTablet ? 10.height : 3.height, | ||||
| //                                       DisclosureCountdownTimerForMainScreen( | ||||
| //                                         timeToMarathon: DateTime.parse(provider.marathonDetailModel.startTime!).millisecondsSinceEpoch, | ||||
| //                                         provider: provider, | ||||
| //                                       ), | ||||
| //                                     ], | ||||
| //                                   ).paddingOnly( | ||||
| //                                     left: AppState().isArabic(context) ? 12 : 3, | ||||
| //                                     right: AppState().isArabic(context) ? 3 : 12, | ||||
| //                                   ) | ||||
| //                                 ], | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ), | ||||
| //                         ], | ||||
| //                       ), | ||||
| //                     ), | ||||
| //                     AppState().isArabic(context) | ||||
| //                         ? Align( | ||||
| //                             alignment: Alignment.topRight, | ||||
| //                             child: SizedBox( | ||||
| //                               height: isTablet ? 30 : 20, | ||||
| //                               width: isTablet ? 45 : 35, | ||||
| //                               child: Transform.rotate( | ||||
| //                                 angle: math.pi / 4.5, | ||||
| //                                 child: Text( | ||||
| //                                   LocaleKeys.brainMarathon.tr(), | ||||
| //                                   textAlign: TextAlign.center, | ||||
| //                                   maxLines: 2, | ||||
| //                                   style: TextStyle( | ||||
| //                                     color: MyColors.white, | ||||
| //                                     fontWeight: FontWeight.bold, | ||||
| //                                     fontSize: isTablet ? 8 : 6, | ||||
| //                                     height: 1.2, | ||||
| //                                   ), | ||||
| //                                 ), | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ).paddingOnly(top: 5) | ||||
| //                         : Align( | ||||
| //                             alignment: Alignment.topLeft, | ||||
| //                             child: SizedBox( | ||||
| //                               height: isTablet ? 30 : 20, | ||||
| //                               width: isTablet ? 45 : 35, | ||||
| //                               child: Transform.rotate( | ||||
| //                                 angle: -math.pi / 4.5, | ||||
| //                                 child: Text( | ||||
| //                                   LocaleKeys.brainMarathon.tr(), | ||||
| //                                   textAlign: TextAlign.center, | ||||
| //                                   maxLines: 2, | ||||
| //                                   style: TextStyle( | ||||
| //                                     color: MyColors.kWhiteColor, | ||||
| //                                     fontWeight: FontWeight.bold, | ||||
| //                                     fontSize: isTablet ? 8 : 6, | ||||
| //                                     height: 1.2, | ||||
| //                                   ), | ||||
| //                                 ), | ||||
| //                               ), | ||||
| //                             ), | ||||
| //                           ).paddingOnly(top: 5), | ||||
| //                     !AppState().isArabic(context) | ||||
| //                         ? Positioned( | ||||
| //                             right: 0, | ||||
| //                             bottom: 0, | ||||
| //                             child: RotatedBox( | ||||
| //                               quarterTurns: 4, | ||||
| //                               child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), | ||||
| //                             ).paddingAll(isTablet ? 20 : 15), | ||||
| //                           ) | ||||
| //                         : Positioned( | ||||
| //                             bottom: 0, | ||||
| //                             left: 0, | ||||
| //                             child: RotatedBox( | ||||
| //                               quarterTurns: 2, | ||||
| //                               child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.whiteColor), | ||||
| //                             ).paddingAll(isTablet ? 20 : 15), | ||||
| //                           ), | ||||
| //                   ], | ||||
| //                 ).onPress(() async { | ||||
| //                   int remainingTimeInMinutes = DateTime.parse(provider.marathonDetailModel.startTime!).difference(DateTime.now()).inMinutes; | ||||
| //                   if (remainingTimeInMinutes > 5 && provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) { | ||||
| //                     Utils.showLoading(context); | ||||
| //                     // try { | ||||
| //                     //   await provider.initializeVideoPlayer().then((_) { | ||||
| //                     //     Utils.hideLoading(context); | ||||
| //                     //     provider.startTimerForSponsorVideo(); | ||||
| //                     //     Navigator.pushNamed(context, AppRoutes.marathonSponsorVideoScreen); | ||||
| //                     //   }); | ||||
| //                     // } catch (e) { | ||||
| //                     //   if (kDebugMode) { | ||||
| //                     //     log("Error in VideoPlayer: ${e.toString()}"); | ||||
| //                     //   } | ||||
| //                     //   Utils.hideLoading(context); | ||||
| //                     //   Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); | ||||
| //                     // } | ||||
| //                   } else { | ||||
| //                     Navigator.pushNamed(context, AppRoutes.marathonIntroScreen); | ||||
| //                   } | ||||
| //                   provider.updateLanguageAsPerMarathon(context, provider.isUpComingMarathon ? provider.marathonDetailModel : provider.demoMarathonDetailModel); | ||||
| //                 }), | ||||
| //               ) | ||||
| //             : getNoUpcomingMarathonWidget(context); | ||||
| //   } | ||||
| // } | ||||
| @ -0,0 +1,76 @@ | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/app_state/app_state.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/classes/consts.dart'; | ||||
| import 'package:mohem_flutter_app/classes/decorations_helper.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_details_model.dart'; | ||||
| 
 | ||||
| class DisclosureDetailsCard extends StatelessWidget { | ||||
|   final DisclosureDetailsModel disclosureDetailsCard; | ||||
| 
 | ||||
|   const DisclosureDetailsCard({Key? key, required this.disclosureDetailsCard}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       decoration: MyDecorations.shadowDecoration, | ||||
|       padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14), | ||||
|       child: Column( | ||||
|         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|         children: <Widget>[ | ||||
|           displayLocalizedContent( | ||||
|             isPhoneLangArabic: AppState().isArabic(context), | ||||
|             selectedLanguage: disclosureDetailsCard.selectedLanguage ?? 0, | ||||
|             englishContent: disclosureDetailsCard.titleEn ?? "", | ||||
|             arabicContent: disclosureDetailsCard.titleAr ?? "", | ||||
|           ).toText20(color: MyColors.textMixColor, isBold: true), | ||||
|           Row( | ||||
|             children: <Widget>[ | ||||
|               Flexible( | ||||
|                 child: displayLocalizedContent( | ||||
|                   isPhoneLangArabic: AppState().isArabic(context), | ||||
|                   selectedLanguage: disclosureDetailsCard.selectedLanguage ?? 0, | ||||
|                   englishContent: disclosureDetailsCard.descEn ?? "", | ||||
|                   arabicContent: disclosureDetailsCard.descAr ?? "", | ||||
|                 ).toText14(color: MyColors.grey77Color), | ||||
|               ) | ||||
|             ], | ||||
|           ), | ||||
|           if (disclosureDetailsCard.sponsors != null && disclosureDetailsCard.sponsors!.isNotEmpty) ...<Widget>[ | ||||
|             Row( | ||||
|               children: <Widget>[ | ||||
|                 "${LocaleKeys.sponsoredBy.tr()} ".toText16(color: MyColors.grey77Color), | ||||
|                 displayLocalizedContent( | ||||
|                   isPhoneLangArabic: AppState().isArabic(context), | ||||
|                   selectedLanguage: disclosureDetailsCard.selectedLanguage ?? 0, | ||||
|                   englishContent: disclosureDetailsCard.sponsors?.first.nameEn ?? "", | ||||
|                   arabicContent: disclosureDetailsCard.sponsors?.first.nameAr ?? "", | ||||
|                 ).toText16(color: MyColors.darkTextColor, isBold: true), | ||||
|               ], | ||||
|             ), | ||||
|             10.height, | ||||
|             Row( | ||||
|               mainAxisAlignment: MainAxisAlignment.center, | ||||
|               children: <Widget>[ | ||||
|                 Image.network( | ||||
|                   ApiConsts.marathonBaseUrlServices + disclosureDetailsCard.sponsors!.first.logo!, | ||||
|                   height: 50, | ||||
|                   width: 150, | ||||
|                   fit: BoxFit.contain, | ||||
|                   errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { | ||||
|                     return Image.asset("assets/images/logos/main_mohemm_logo.png", height: 50, width: 150); | ||||
|                   }, | ||||
|                 ) | ||||
|               ], | ||||
|             ), | ||||
|           ] | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,37 @@ | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| 
 | ||||
| class DisclosureHeader extends StatelessWidget { | ||||
|   const DisclosureHeader({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return SafeArea( | ||||
|       child: Container( | ||||
|         color: MyColors.kWhiteColor, | ||||
|         width: double.infinity, | ||||
|         height: 65, | ||||
|         padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 15), | ||||
|         child: Row( | ||||
|           crossAxisAlignment: CrossAxisAlignment.end, | ||||
|           mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|           children: [ | ||||
|             LocaleKeys.brainMarathon.tr().toText24(isBold: true), | ||||
|             IconButton( | ||||
|               padding: EdgeInsets.zero, | ||||
|               icon: const Icon(Icons.close, size: 28), | ||||
|               color: MyColors.black, | ||||
|               constraints: const BoxConstraints(), | ||||
|               onPressed: () { | ||||
|                 Navigator.pop(context); | ||||
|               }, | ||||
|             ) | ||||
|           ], | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,117 @@ | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/classes/decorations_helper.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_question_model.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| 
 | ||||
| class DisclosureProgressContainer extends StatelessWidget { | ||||
|   final DisclosureProvider provider; | ||||
| 
 | ||||
|   const DisclosureProgressContainer({Key? key, required this.provider}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       decoration: MyDecorations.shadowDecoration, | ||||
|       padding: const EdgeInsets.fromLTRB(13, 5, 13, 18), | ||||
|       child: Column( | ||||
|         mainAxisSize: MainAxisSize.min, | ||||
|         children: <Widget>[ | ||||
|           5.height, | ||||
|           Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: <Widget>[ | ||||
|               Container( | ||||
|                 decoration: BoxDecoration(color: MyColors.greenColor, borderRadius: BorderRadius.circular(5)), | ||||
|                 padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 8), | ||||
|                 child: "${provider.currentQuestionNumber.toString()} / ${provider.disclosureDetailsModel.totalQuestions.toString()}  ${LocaleKeys.disclosure.tr()}".toText12(color: MyColors.white), | ||||
|               ), | ||||
|             ], | ||||
|           ), | ||||
|           12.height, | ||||
|           stepper( | ||||
|             provider.currentQuestionNumber, | ||||
|             provider.answerStatusesList, | ||||
|             provider.disclosureDetailsModel.totalQuestions!, | ||||
|           ), | ||||
|           8.height, | ||||
|           Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: <Widget>[ | ||||
|               "${provider.currentQuestionNumber == 1 ? 0 : (((provider.currentQuestionNumber - 1) / (provider.disclosureDetailsModel.totalQuestions!)) * 100).toInt()}% ${LocaleKeys.completed.tr()}".toText14(), | ||||
|             ], | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Color getStepColor(DisclosureQuestionCardStatus status) { | ||||
|     switch (status) { | ||||
|       case DisclosureQuestionCardStatus.question: | ||||
|         return MyColors.yellowColorII; | ||||
|       case DisclosureQuestionCardStatus.wrongAnswer: | ||||
|         return MyColors.lightGreyDeColor; | ||||
|       case DisclosureQuestionCardStatus.correctAnswer: | ||||
|         return MyColors.greenColor; | ||||
|       case DisclosureQuestionCardStatus.skippedAnswer: | ||||
|         return MyColors.lightGreyDeColor; | ||||
|       case DisclosureQuestionCardStatus.completed: | ||||
|         return MyColors.lightGreyDeColor; | ||||
|       case DisclosureQuestionCardStatus.findingWinner: | ||||
|         return MyColors.lightGreyDeColor; | ||||
|       case DisclosureQuestionCardStatus.winnerFound: | ||||
|         return MyColors.lightGreyDeColor; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   Widget stepper(int value, List<DisclosureQuestionCardStatus> statusesList, int totalQuestions) { | ||||
|     return SizedBox( | ||||
|       width: double.infinity, | ||||
|       child: Row( | ||||
|         mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|         children: <Widget>[ | ||||
|           for (int i = 0; i < totalQuestions; i++) | ||||
|             if (value <= i) roundContainer(MyColors.lightGreyDeColor, i != 0) else roundContainer(getStepColor(statusesList[i]), i != 0) | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget roundContainer(Color color, bool isNeedLeftBorder) { | ||||
|     if (isNeedLeftBorder) { | ||||
|       return Row( | ||||
|         children: <Widget>[ | ||||
|           Expanded( | ||||
|             child: AnimatedContainer( | ||||
|               duration: const Duration(milliseconds: 800), // Set animation duration | ||||
|               height: 6, // Change thickness if needed | ||||
|               color: color, | ||||
|             ), | ||||
|           ), | ||||
|           Container( | ||||
|             margin: EdgeInsets.zero, | ||||
|             padding: EdgeInsets.zero, | ||||
|             width: 10, | ||||
|             height: 10, | ||||
|             decoration: BoxDecoration(shape: BoxShape.circle, color: color, border: Border.all(color: color, width: 2)), | ||||
|           ), | ||||
|         ], | ||||
|       ).expanded; | ||||
|     } | ||||
| 
 | ||||
|     return Container( | ||||
|       margin: EdgeInsets.zero, | ||||
|       padding: EdgeInsets.zero, | ||||
|       width: 10, | ||||
|       height: 10, | ||||
|       decoration: BoxDecoration(shape: BoxShape.circle, color: color, border: Border.all(color: color, width: 2)), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,216 @@ | ||||
| import 'dart:developer'; | ||||
| 
 | ||||
| import 'package:appinio_swiper/appinio_swiper.dart'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:lottie/lottie.dart'; | ||||
| import 'package:mohem_flutter_app/app_state/app_state.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/classes/decorations_helper.dart'; | ||||
| import 'package:mohem_flutter_app/classes/lottie_consts.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_question_model.dart'; | ||||
| import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/dynamic_forms/dynamic_textfield_widget.dart'; | ||||
| import 'package:provider/provider.dart'; | ||||
| 
 | ||||
| class DisclosureQuestionCard extends StatelessWidget { | ||||
|   const DisclosureQuestionCard({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     DisclosureProvider provider = context.read<DisclosureProvider>(); | ||||
|     return CupertinoPageScaffold( | ||||
|       child: provider.cardContentList.isEmpty | ||||
|           ? Lottie.asset(MyLottieConsts.hourGlassLottie, height: 250).paddingOnly(top: 50) | ||||
|           : Consumer<DisclosureProvider>( | ||||
|               builder: (BuildContext context, DisclosureProvider provider, Widget? child) { | ||||
|                 return Container( | ||||
|                   constraints: BoxConstraints(minHeight: MediaQuery.of(context).size.height * .43), | ||||
|                   height: (provider.currentQuestionSelectionStatus == DisclosureQuestionsOptionStatus.correct && provider.currentQuestionNumber != provider.disclosureDetailsModel.totalQuestions!) | ||||
|                       ? MediaQuery.of(context).size.height * .6 | ||||
|                       : MediaQuery.of(context).size.height * .43, | ||||
|                   width: double.infinity, | ||||
|                   child: AppinioSwiper( | ||||
|                     duration: const Duration(milliseconds: 400), | ||||
|                     padding: EdgeInsets.zero, | ||||
|                     isDisabled: true, | ||||
|                     controller: provider.swiperController, | ||||
|                     unswipe: (int index, AppinioSwiperDirection direction) {}, | ||||
|                     onSwipe: (int index, AppinioSwiperDirection direction) {}, | ||||
|                     cards: provider.cardContentList, | ||||
|                   ), | ||||
|                 ); | ||||
|               }, | ||||
|             ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class DisclosureCardContent extends StatelessWidget { | ||||
|   const DisclosureCardContent({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     DisclosureProvider provider = context.watch<DisclosureProvider>(); | ||||
|     return Container( | ||||
|       decoration: BoxDecoration( | ||||
|         borderRadius: BorderRadius.circular(10), | ||||
|         color: CupertinoColors.white, | ||||
|         boxShadow: <BoxShadow>[ | ||||
|           BoxShadow( | ||||
|             color: CupertinoColors.systemGrey.withOpacity(0.2), | ||||
|             spreadRadius: 3, | ||||
|             blurRadius: 7, | ||||
|             offset: const Offset(0, 3), | ||||
|           ) | ||||
|         ], | ||||
|       ), | ||||
|       alignment: Alignment.center, | ||||
|       child: Column( | ||||
|         children: <Widget>[ | ||||
|           Flexible( | ||||
|             child: Container( | ||||
|               width: double.infinity, | ||||
|               decoration: const BoxDecoration( | ||||
|                 borderRadius: BorderRadius.only( | ||||
|                   topLeft: Radius.circular(10), | ||||
|                   topRight: Radius.circular(10), | ||||
|                 ), | ||||
|               ), | ||||
|               constraints: BoxConstraints(minHeight: MediaQuery.of(context).size.height * .23), | ||||
|               child: Padding( | ||||
|                 padding: const EdgeInsets.only(left: 15, right: 15, top: 15), | ||||
|                 child: SingleChildScrollView( | ||||
|                   child: Text( | ||||
|                     displayLocalizedContent( | ||||
|                       isPhoneLangArabic: AppState().isArabic(context), | ||||
|                       selectedLanguage: (provider.disclosureDetailsModel.selectedLanguage) ?? 0, | ||||
|                       englishContent: provider.currentQuestion.titleEn ?? "", | ||||
|                       arabicContent: provider.currentQuestion.titleAr ?? "", | ||||
|                     ), | ||||
|                     style: const TextStyle( | ||||
|                       color: MyColors.darkTextColor, | ||||
|                       fontSize: 15, | ||||
|                       height: 21 / 14, | ||||
|                       fontWeight: FontWeight.w500, | ||||
|                     ), | ||||
|                   ), | ||||
|                 ), | ||||
|               ), | ||||
|             ), | ||||
|           ), | ||||
|           24.height, | ||||
|           const DisclosureAnswerContent(), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class DisclosureAnswerContent extends StatelessWidget { | ||||
|   const DisclosureAnswerContent({Key? key}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     DisclosureProvider provider = context.watch<DisclosureProvider>(); | ||||
|     return Container( | ||||
|       padding: const EdgeInsets.only(bottom: 20, left: 8, right: 8), | ||||
|       decoration: const BoxDecoration( | ||||
|         color: MyColors.kWhiteColor, | ||||
|         borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), | ||||
|       ), | ||||
|       child: provider.currentQuestion.questionOptions != null | ||||
|           ? Column( | ||||
|               children: [ | ||||
|                 Row( | ||||
|                   children: List<Widget>.generate( | ||||
|                     provider.currentQuestion.questionOptions!.length, | ||||
|                     (int index) => Expanded( | ||||
|                       child: DisclosureAnswerTileForText( | ||||
|                         index: index, | ||||
|                         onAnswerTapped: () => provider.updateCurrentQuestionOptionStatus(status: DisclosureQuestionsOptionStatus.selected, selectedOptIndex: index, correctOptionIndex: -1), // | ||||
|                       ).paddingAll(8), | ||||
|                     ), | ||||
|                   ), | ||||
|                 ), | ||||
|                 if (provider.currentQuestionSelectionStatus == DisclosureQuestionsOptionStatus.correct && provider.currentQuestionNumber != provider.disclosureDetailsModel.totalQuestions!) ...[ | ||||
|                   15.height, | ||||
|                   Text( | ||||
|                     displayLocalizedContent( | ||||
|                       isPhoneLangArabic: AppState().isArabic(context), | ||||
|                       selectedLanguage: (provider.disclosureDetailsModel.selectedLanguage) ?? 0, | ||||
|                       englishContent: provider.currentQuestion.descEn ?? "", | ||||
|                       arabicContent: provider.currentQuestion.descAr ?? "", | ||||
|                     ), | ||||
|                     style: const TextStyle( | ||||
|                       color: MyColors.darkTextColor, | ||||
|                       fontSize: 14, | ||||
|                       height: 21 / 14, | ||||
|                       fontWeight: FontWeight.w500, | ||||
|                     ), | ||||
|                   ).paddingOnly(left: 8, right: 8), | ||||
|                   8.height, | ||||
|                   DynamicTextFieldWidget( | ||||
|                     LocaleKeys.pleaseWriteHere.tr(), | ||||
|                     provider.currentAdditionalText, | ||||
|                     lines: 3, | ||||
|                     onChange: (value) { | ||||
|                       provider.updateCurrentAdditionalText(value); | ||||
|                     }, | ||||
|                   ).paddingOnly(left: 8, right: 8), | ||||
|                 ], | ||||
|               ], | ||||
|             ) | ||||
|           : const SizedBox(), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class DisclosureAnswerTileForText extends StatelessWidget { | ||||
|   final int index; | ||||
|   final Function() onAnswerTapped; | ||||
| 
 | ||||
|   const DisclosureAnswerTileForText({Key? key, required this.index, required this.onAnswerTapped}) : super(key: key); | ||||
| 
 | ||||
|   Color getAnswerTextColor(DisclosureQuestionsOptionStatus status) { | ||||
|     switch (status) { | ||||
|       case DisclosureQuestionsOptionStatus.correct: | ||||
|         return MyColors.white; | ||||
|       case DisclosureQuestionsOptionStatus.wrong: | ||||
|         return MyColors.white; | ||||
|       case DisclosureQuestionsOptionStatus.selected: | ||||
|         return MyColors.white; | ||||
|       case DisclosureQuestionsOptionStatus.unSelected: | ||||
|         return MyColors.darkTextColor; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     DisclosureProvider provider = context.watch<DisclosureProvider>(); | ||||
|     return InkWell( | ||||
|       onTap: () => onAnswerTapped(), | ||||
|       child: Container( | ||||
|         alignment: Alignment.centerLeft, | ||||
|         decoration: MyDecorations.getAnswersContainerColorForDisclosure( | ||||
|           provider.currentQuestion.questionOptions![index].optionStatus!, | ||||
|           isLastQuestion: provider.currentQuestionNumber == provider.disclosureDetailsModel.totalQuestions!, | ||||
|           isAgreeSelected: provider.selectedOptionIndex == 0, | ||||
|         ), | ||||
|         child: Center( | ||||
|           child: displayLocalizedContent( | ||||
|             isPhoneLangArabic: AppState().isArabic(context), | ||||
|             selectedLanguage: (provider.disclosureDetailsModel.selectedLanguage) ?? 0, | ||||
|             englishContent: provider.currentQuestion.questionOptions![index].titleEn ?? "", | ||||
|             arabicContent: provider.currentQuestion.questionOptions![index].titleAr ?? "", | ||||
|           ).toText16(color: getAnswerTextColor(provider.currentQuestion.questionOptions![index].optionStatus!)).paddingOnly(top: 13, bottom: 13), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,51 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/models/disclosure/disclosure_question_model.dart'; | ||||
| 
 | ||||
| class DisclosureQuestionCardBuilder extends StatelessWidget { | ||||
|   final WidgetBuilder onQuestion; | ||||
|   final WidgetBuilder onCompleted; | ||||
|   final WidgetBuilder onWrongAnswer; | ||||
|   final WidgetBuilder onCorrectAnswer; | ||||
|   final WidgetBuilder onWinner; | ||||
|   final WidgetBuilder onSkippedAnswer; | ||||
|   final WidgetBuilder onFindingWinner; | ||||
|   final DisclosureQuestionCardStatus questionCardStatus; | ||||
| 
 | ||||
|   const DisclosureQuestionCardBuilder({ | ||||
|     Key? key, | ||||
|     required this.onQuestion, | ||||
|     required this.onCompleted, | ||||
|     required this.onCorrectAnswer, | ||||
|     required this.onWinner, | ||||
|     required this.onSkippedAnswer, | ||||
|     required this.onWrongAnswer, | ||||
|     required this.onFindingWinner, | ||||
|     required this.questionCardStatus, | ||||
|   }) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     switch (questionCardStatus) { | ||||
|       case DisclosureQuestionCardStatus.question: | ||||
|         return onQuestion(context); | ||||
| 
 | ||||
|       case DisclosureQuestionCardStatus.wrongAnswer: | ||||
|         return onWrongAnswer(context); | ||||
| 
 | ||||
|       case DisclosureQuestionCardStatus.correctAnswer: | ||||
|         return onCorrectAnswer(context); | ||||
| 
 | ||||
|       case DisclosureQuestionCardStatus.completed: | ||||
|         return onCompleted(context); | ||||
| 
 | ||||
|       case DisclosureQuestionCardStatus.winnerFound: | ||||
|         return onWinner(context); | ||||
| 
 | ||||
|       case DisclosureQuestionCardStatus.findingWinner: | ||||
|         return onFindingWinner(context); | ||||
| 
 | ||||
|       case DisclosureQuestionCardStatus.skippedAnswer: | ||||
|         return onSkippedAnswer(context); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,55 @@ | ||||
| // import 'package:easy_localization/easy_localization.dart'; | ||||
| // import 'package:flutter/material.dart'; | ||||
| // import 'package:lottie/lottie.dart'; | ||||
| // import 'package:mohem_flutter_app/app_state/app_state.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/date_uitl.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/decorations_helper.dart'; | ||||
| // import 'package:mohem_flutter_app/classes/lottie_consts.dart'; | ||||
| // import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| // import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; | ||||
| // import 'package:mohem_flutter_app/ui/disclosure/disclosure_provider.dart'; | ||||
| // import 'package:mohem_flutter_app/ui/disclosure/widgets/countdown_timer_detail_screen.dart'; | ||||
| // | ||||
| // | ||||
| // class DisclosureTimerCard extends StatelessWidget { | ||||
| //   final int timeToMarathon; | ||||
| //   final DisclosureProvider provider; | ||||
| // | ||||
| //   const DisclosureTimerCard({ | ||||
| //     Key? key, | ||||
| //     required this.provider, | ||||
| //     required this.timeToMarathon, | ||||
| //   }) : super(key: key); | ||||
| // | ||||
| //   @override | ||||
| //   Widget build(BuildContext context) { | ||||
| //     return Container( | ||||
| //       width: double.infinity, | ||||
| //       decoration: MyDecorations.shadowDecoration, | ||||
| //       padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 14), | ||||
| //       child: Column( | ||||
| //         children: <Widget>[ | ||||
| //           Row( | ||||
| //             children: <Widget>[ | ||||
| //               "${LocaleKeys.gameDate.tr()} ".toText16(color: MyColors.grey77Color), | ||||
| //               DateUtil.getMonthDayYearDateFormatted(DateTime.parse(provider.marathonDetailModel.startTime!)).toText16(color: MyColors.darkTextColor, isBold: true), | ||||
| //             ], | ||||
| //           ), | ||||
| //           Row( | ||||
| //             children: <Widget>[ | ||||
| //               "${LocaleKeys.gameTime.tr()} ".toText16(color: MyColors.grey77Color), | ||||
| //               DateUtil.formatDateToTimeLang(DateTime.parse(provider.marathonDetailModel.startTime!), AppState().isArabic(context)).toText16(color: MyColors.darkTextColor, isBold: true), | ||||
| //             ], | ||||
| //           ), | ||||
| //           Lottie.asset(MyLottieConsts.hourGlassLottie, height: 200), | ||||
| //           DisclosureCountdownTimerForDetailScreen( | ||||
| //             // timeToMarathon: dummyTime, | ||||
| //             timeToMarathon: timeToMarathon, | ||||
| //             provider: provider, | ||||
| //           ), | ||||
| //         ], | ||||
| //       ), | ||||
| //     ); | ||||
| //   } | ||||
| // } | ||||
					Loading…
					
					
				
		Reference in New Issue