Merge branch 'release/0.1.29'
-fix(learn): Fix progress tracking issue without payment implementation
This commit is contained in:
commit
5581d00b15
|
|
@ -183,13 +183,10 @@
|
||||||
"welcome_abroad": "እንኳን ደህና መጣህ",
|
"welcome_abroad": "እንኳን ደህና መጣህ",
|
||||||
"ready_to_explore": "የግል ትምህርቶችህን ለማሰስ ዝግጁ ነህ።",
|
"ready_to_explore": "የግል ትምህርቶችህን ለማሰስ ዝግጁ ነህ።",
|
||||||
"finish": "አጠናቅቅ",
|
"finish": "አጠናቅቅ",
|
||||||
|
"finish_all_practice_lesson": "ይህን ልምምድ ለመውሰድ የቀድሞውን የትምህርት ልምምድ ያጠናቅቁ",
|
||||||
"finish_all_practice": "ልምምዱን ለመውሰድ በትምህርቶቹ ውስጥ ያሉትን ሁሉንም ልምምዶች ያጠናቅቁ።"
|
"finish_all_practice_module": "የሞጁሉን ልምምድ ለመውሰድ የትምህርት ልምምዶችን ያጠናቅቁ",
|
||||||
|
"finish_all_practice_course": "የኮርሱን ልምምድ ለመውሰድ የሞጁል ልምምዶችን ያጠናቅቁ",
|
||||||
|
"finish_all_practice_previouse_module": "ይህን ልምምድ ለመውሰድ የቀድሞውን የሞጁል ልምምድ ያጠናቅቁ",
|
||||||
|
"finish_all_practice_previouse_course": "ይህን ለመውሰድ የቀድሞውን የኮርስ ልምምድ ያጠናቅቁ"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,5 +183,10 @@
|
||||||
"welcome_abroad": "Welcome aboard",
|
"welcome_abroad": "Welcome aboard",
|
||||||
"ready_to_explore": "You’re ready to explore your personalized lessons.",
|
"ready_to_explore": "You’re ready to explore your personalized lessons.",
|
||||||
"finish": "Finish",
|
"finish": "Finish",
|
||||||
"finish_all_practice": "Finish all the practices in the lessons to take this practice"
|
"finish_all_practice_lesson": "Finish the previous lesson practice to take this practice",
|
||||||
|
"finish_all_practice_module": "Finish the lesson practices to take the Module Practice",
|
||||||
|
"finish_all_practice_course": "Finish the Module practices to take the Course practice",
|
||||||
|
"finish_all_practice_previouse_module": "Finish the previous Module practice to take this practice",
|
||||||
|
"finish_all_practice_previouse_course": "Finish the previous course practice to take this"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ enum ProgressStatuses { pending, started, completed }
|
||||||
// Duolingo types
|
// Duolingo types
|
||||||
enum DuolingoAssessments { speaking, reading, writing, listening }
|
enum DuolingoAssessments { speaking, reading, writing, listening }
|
||||||
|
|
||||||
|
|
||||||
|
// Practice reason
|
||||||
|
enum PracticeReason { course, module, lesson, previousModule, previousCourse }
|
||||||
|
|
||||||
|
|
||||||
// State object
|
// State object
|
||||||
enum StateObjects {
|
enum StateObjects {
|
||||||
none,
|
none,
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ class CodegenLoader extends AssetLoader {
|
||||||
"confirm_password": "የይለፍ ቃል ያረጋግጡ",
|
"confirm_password": "የይለፍ ቃል ያረጋግጡ",
|
||||||
"eight_character_minimum": "ቢያንስ 8 ፊደላት",
|
"eight_character_minimum": "ቢያንስ 8 ፊደላት",
|
||||||
"password_match": "የይለፍ ቃሉ ተመሳስሏል",
|
"password_match": "የይለፍ ቃሉ ተመሳስሏል",
|
||||||
"sign_up_agreement":
|
"sign_up_agreement": "‘ይመዝገቡ’ የሚለውን ሲጫኑ በ‘አገልግሎት ውሎች’ እና ‘በግላዊነት ፖሊሲ’ ይስማማሉ።",
|
||||||
"‘ይመዝገቡ’ የሚለውን ሲጫኑ በ‘አገልግሎት ውሎች’ እና ‘በግላዊነት ፖሊሲ’ ይስማማሉ።",
|
|
||||||
"terms_of_services": "የአገልግሎት ውሎች",
|
"terms_of_services": "የአገልግሎት ውሎች",
|
||||||
"and": "እና",
|
"and": "እና",
|
||||||
"privacy_policy": "የግላዊነት ፖሊሲ",
|
"privacy_policy": "የግላዊነት ፖሊሲ",
|
||||||
|
|
@ -138,8 +137,7 @@ class CodegenLoader extends AssetLoader {
|
||||||
"call_our_support": "ከ3 ጠዋት እስከ 12 ማታ ድረስ የድጋፍ ቡድናችንን ይደውሉ",
|
"call_our_support": "ከ3 ጠዋት እስከ 12 ማታ ድረስ የድጋፍ ቡድናችንን ይደውሉ",
|
||||||
"tap_to_call": "ለመደወል ይንኩ",
|
"tap_to_call": "ለመደወል ይንኩ",
|
||||||
"join_telegram": "በቴሌግራም የይማሩ አካዳሚን ይቀላቀሉ",
|
"join_telegram": "በቴሌግራም የይማሩ አካዳሚን ይቀላቀሉ",
|
||||||
"connect_with_support_team":
|
"connect_with_support_team": "ለፈጣን እርዳታ እና የማህበረሰብ ዝማኔዎች፣ በቴሌግራም ከድጋፍ ቡድናችን ጋር ወዲያውኑ ይገናኙ።",
|
||||||
"ለፈጣን እርዳታ እና የማህበረሰብ ዝማኔዎች፣ በቴሌግራም ከድጋፍ ቡድናችን ጋር ወዲያውኑ ይገናኙ።",
|
|
||||||
"open_in_telegram": "በቴሌግራም ይክፈቱ",
|
"open_in_telegram": "በቴሌግራም ይክፈቱ",
|
||||||
"search_for": "ፈልጉት",
|
"search_for": "ፈልጉት",
|
||||||
"current_level": "የአሁኑ ደረጃ",
|
"current_level": "የአሁኑ ደረጃ",
|
||||||
|
|
@ -189,8 +187,7 @@ class CodegenLoader extends AssetLoader {
|
||||||
"evey_one_has_strugle": "ሁሉም ሰው ችግሮች አሉት፣ የአንተን እንጀምር እንፍታ",
|
"evey_one_has_strugle": "ሁሉም ሰው ችግሮች አሉት፣ የአንተን እንጀምር እንፍታ",
|
||||||
"write_your_challenge": "ችግርህን ጻፍ…",
|
"write_your_challenge": "ችግርህን ጻፍ…",
|
||||||
"topic_interest": "በጣም የሚስቡህ ርዕሶች የትኞቹ ናቸው?",
|
"topic_interest": "በጣም የሚስቡህ ርዕሶች የትኞቹ ናቸው?",
|
||||||
"favourite_topic":
|
"favourite_topic": "የምትወዳቸው ርዕሶች አስደሳች እና ከሕይወትህ ጋር የተዛመዱ ትምህርቶችን ለመፍጠር ይረዱናል።",
|
||||||
"የምትወዳቸው ርዕሶች አስደሳች እና ከሕይወትህ ጋር የተዛመዱ ትምህርቶችን ለመፍጠር ይረዱናል።",
|
|
||||||
"your_interest": "ፍላጎትህን ጻፍ…",
|
"your_interest": "ፍላጎትህን ጻፍ…",
|
||||||
"want_quick_assessment": "የእንግሊዝኛ ደረጃህን ለማወቅ ፈጣን ግምገማ ትፈልጋለህ?",
|
"want_quick_assessment": "የእንግሊዝኛ ደረጃህን ለማወቅ ፈጣን ግምገማ ትፈልጋለህ?",
|
||||||
"answer_quick_questions": "የእንግሊዝኛ ችሎታህን ለመረዳት ጥቂት ፈጣን ጥያቄዎችን መልስ።",
|
"answer_quick_questions": "የእንግሊዝኛ ችሎታህን ለመረዳት ጥቂት ፈጣን ጥያቄዎችን መልስ።",
|
||||||
|
|
@ -202,7 +199,11 @@ class CodegenLoader extends AssetLoader {
|
||||||
"welcome_abroad": "እንኳን ደህና መጣህ",
|
"welcome_abroad": "እንኳን ደህና መጣህ",
|
||||||
"ready_to_explore": "የግል ትምህርቶችህን ለማሰስ ዝግጁ ነህ።",
|
"ready_to_explore": "የግል ትምህርቶችህን ለማሰስ ዝግጁ ነህ።",
|
||||||
"finish": "አጠናቅቅ",
|
"finish": "አጠናቅቅ",
|
||||||
"finish_all_practice": "ልምምዱን ለመውሰድ በትምህርቶቹ ውስጥ ያሉትን ሁሉንም ልምምዶች ያጠናቅቁ።"
|
"finish_all_practice_lesson": "ይህን ልምምድ ለመውሰድ የቀድሞውን የትምህርት ልምምድ ያጠናቅቁ",
|
||||||
|
"finish_all_practice_module": "የሞጁሉን ልምምድ ለመውሰድ የትምህርት ልምምዶችን ያጠናቅቁ",
|
||||||
|
"finish_all_practice_course": "የኮርሱን ልምምድ ለመውሰድ የሞጁል ልምምዶችን ያጠናቅቁ",
|
||||||
|
"finish_all_practice_previouse_module": "ይህን ልምምድ ለመውሰድ የቀድሞውን የሞጁል ልምምድ ያጠናቅቁ",
|
||||||
|
"finish_all_practice_previouse_course": "ይህን ለመውሰድ የቀድሞውን የኮርስ ልምምድ ያጠናቅቁ"
|
||||||
};
|
};
|
||||||
static const Map<String,dynamic> _en = {
|
static const Map<String,dynamic> _en = {
|
||||||
"loading": "Loading",
|
"loading": "Loading",
|
||||||
|
|
@ -222,15 +223,13 @@ class CodegenLoader extends AssetLoader {
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"register_with_google": "Register with Google",
|
"register_with_google": "Register with Google",
|
||||||
"register_with_phone": "Register with phone number",
|
"register_with_phone": "Register with phone number",
|
||||||
"enter_phone_number":
|
"enter_phone_number": "Enter your phone number. We will send you a confirmation code there.",
|
||||||
"Enter your phone number. We will send you a confirmation code there.",
|
|
||||||
"login_with_email": "Login with email",
|
"login_with_email": "Login with email",
|
||||||
"create_password": "Create password",
|
"create_password": "Create password",
|
||||||
"confirm_password": "Confirm password",
|
"confirm_password": "Confirm password",
|
||||||
"eight_character_minimum": "8 characters minimum",
|
"eight_character_minimum": "8 characters minimum",
|
||||||
"password_match": "password match",
|
"password_match": "password match",
|
||||||
"sign_up_agreement":
|
"sign_up_agreement": "By clicking ‘Sign Up’, you agree to our ‘Terms of Service’ and ‘Privacy Policy’",
|
||||||
"By clicking ‘Sign Up’, you agree to our ‘Terms of Service’ and ‘Privacy Policy’",
|
|
||||||
"terms_of_services": "Terms of Service",
|
"terms_of_services": "Terms of Service",
|
||||||
"and": "and",
|
"and": "and",
|
||||||
"privacy_policy": "Privacy Policy",
|
"privacy_policy": "Privacy Policy",
|
||||||
|
|
@ -241,8 +240,7 @@ class CodegenLoader extends AssetLoader {
|
||||||
"code_sent_to_email": "Code sent to your email",
|
"code_sent_to_email": "Code sent to your email",
|
||||||
"resend_code_in": "Resend code in",
|
"resend_code_in": "Resend code in",
|
||||||
"reset_password": "Reset Password",
|
"reset_password": "Reset Password",
|
||||||
"enter_email_reset_code":
|
"enter_email_reset_code": "Enter your email. We will send you a reset code.",
|
||||||
"Enter your email. We will send you a reset code.",
|
|
||||||
"please_wait": "Please wait",
|
"please_wait": "Please wait",
|
||||||
"reset_code_sent": "Reset code sent successfully",
|
"reset_code_sent": "Reset code sent successfully",
|
||||||
"reset_code": "Reset code",
|
"reset_code": "Reset code",
|
||||||
|
|
@ -283,8 +281,7 @@ class CodegenLoader extends AssetLoader {
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"you_are_speaking": "You're speaking",
|
"you_are_speaking": "You're speaking",
|
||||||
"practice_completed": "Practice completed!",
|
"practice_completed": "Practice completed!",
|
||||||
"great_improvement":
|
"great_improvement": "You sound more confident this time, great improvement",
|
||||||
"You sound more confident this time, great improvement",
|
|
||||||
"practice_again": "Practice again",
|
"practice_again": "Practice again",
|
||||||
"conversation_review": "Conversation review",
|
"conversation_review": "Conversation review",
|
||||||
"result": "Result",
|
"result": "Result",
|
||||||
|
|
@ -331,8 +328,7 @@ class CodegenLoader extends AssetLoader {
|
||||||
"call_our_support": "Call our support team between 9 AM - 6 PM",
|
"call_our_support": "Call our support team between 9 AM - 6 PM",
|
||||||
"tap_to_call": "Tap to call",
|
"tap_to_call": "Tap to call",
|
||||||
"join_telegram": "Join Yimaru Academy on Telegram",
|
"join_telegram": "Join Yimaru Academy on Telegram",
|
||||||
"connect_with_support_team":
|
"connect_with_support_team": "Connect with our support team instantly on Telegram for quick assistance and community updates",
|
||||||
"Connect with our support team instantly on Telegram for quick assistance and community updates",
|
|
||||||
"open_in_telegram": "Open in Telegram",
|
"open_in_telegram": "Open in Telegram",
|
||||||
"search_for": "Search for",
|
"search_for": "Search for",
|
||||||
"current_level": "Current Level",
|
"current_level": "Current Level",
|
||||||
|
|
@ -340,22 +336,18 @@ class CodegenLoader extends AssetLoader {
|
||||||
"no_practice_available": "No practice available!",
|
"no_practice_available": "No practice available!",
|
||||||
"begin_module_practice": "Begin Module Practice",
|
"begin_module_practice": "Begin Module Practice",
|
||||||
"lets_practice_lesson": "Let’s Practice",
|
"lets_practice_lesson": "Let’s Practice",
|
||||||
"lets_quickly_review":
|
"lets_quickly_review": "Let’s quickly review what you’ve learned in this module!",
|
||||||
"Let’s quickly review what you’ve learned in this module!",
|
|
||||||
"lets_practice_module": "Let's practice what you just learnt!",
|
"lets_practice_module": "Let's practice what you just learnt!",
|
||||||
"ask_you_few_actions":
|
"ask_you_few_actions": "I’ll ask you a few questions, and you can respond naturally.",
|
||||||
"I’ll ask you a few questions, and you can respond naturally.",
|
|
||||||
"begin_level_practice": "Begin Level Practice",
|
"begin_level_practice": "Begin Level Practice",
|
||||||
"lets_practice_course": "Let’s Practice Course",
|
"lets_practice_course": "Let’s Practice Course",
|
||||||
"lets_quick_review":
|
"lets_quick_review": "Let’s quickly review what you’ve learned in this level!",
|
||||||
"Let’s quickly review what you’ve learned in this level!",
|
|
||||||
"speaking": "is speaking...",
|
"speaking": "is speaking...",
|
||||||
"you_have_finished_practice": "You have finished your practice",
|
"you_have_finished_practice": "You have finished your practice",
|
||||||
"view_results": "View My Results",
|
"view_results": "View My Results",
|
||||||
"sample_answer": "Sample Answer",
|
"sample_answer": "Sample Answer",
|
||||||
"your_answer": "Your Answer",
|
"your_answer": "Your Answer",
|
||||||
"sound_confident":
|
"sound_confident": "You sound more confident this time - great improvement!",
|
||||||
"You sound more confident this time - great improvement!",
|
|
||||||
"you_have_completed": "Yay, you’ve completed",
|
"you_have_completed": "Yay, you’ve completed",
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
|
|
@ -366,20 +358,15 @@ class CodegenLoader extends AssetLoader {
|
||||||
"phone_must_start_with": "Phone number must start with 251",
|
"phone_must_start_with": "Phone number must start with 251",
|
||||||
"phone_must_be": "Phone number must be 12 digits",
|
"phone_must_be": "Phone number must be 12 digits",
|
||||||
"what_should_we_call_you": "What should we call you?",
|
"what_should_we_call_you": "What should we call you?",
|
||||||
"name_for_personalization":
|
"name_for_personalization": "We’ll use your name to personalize your learning journey.",
|
||||||
"We’ll use your name to personalize your learning journey.",
|
|
||||||
"choose_your_gender": "Choose your gender?",
|
"choose_your_gender": "Choose your gender?",
|
||||||
"gender_for_personalization":
|
"gender_for_personalization": "We’ll personalize your learning experience based on your gender.",
|
||||||
"We’ll personalize your learning experience based on your gender.",
|
|
||||||
"age_range": "Which age range are you in?",
|
"age_range": "Which age range are you in?",
|
||||||
"age_for_personalization":
|
"age_for_personalization": "We’ll personalize your learning experience based on your age.",
|
||||||
"We’ll personalize your learning experience based on your age.",
|
|
||||||
"educational_background": "What’s your current educational level?",
|
"educational_background": "What’s your current educational level?",
|
||||||
"education_for_personalization":
|
"education_for_personalization": "This helps us tailor your lessons to your experience.",
|
||||||
"This helps us tailor your lessons to your experience.",
|
|
||||||
"your_occupation": "What’s your occupation?",
|
"your_occupation": "What’s your occupation?",
|
||||||
"occupation_for_personalization":
|
"occupation_for_personalization": "We’ll personalize your learning experience based on your occupation.",
|
||||||
"We’ll personalize your learning experience based on your occupation.",
|
|
||||||
"location": "Where are you from?",
|
"location": "Where are you from?",
|
||||||
"select_country_region": "Select your country and region from the dropdown",
|
"select_country_region": "Select your country and region from the dropdown",
|
||||||
"select_country": "Select country",
|
"select_country": "Select country",
|
||||||
|
|
@ -391,13 +378,10 @@ class CodegenLoader extends AssetLoader {
|
||||||
"evey_one_has_strugle": "Everyone has struggles, let’s start fixing yours",
|
"evey_one_has_strugle": "Everyone has struggles, let’s start fixing yours",
|
||||||
"write_your_challenge": "Write your challenge…",
|
"write_your_challenge": "Write your challenge…",
|
||||||
"topic_interest": "Which topics interest you most?",
|
"topic_interest": "Which topics interest you most?",
|
||||||
"favourite_topic":
|
"favourite_topic": "Your favorite topics help us create fun, relatable lessons.",
|
||||||
"Your favorite topics help us create fun, relatable lessons.",
|
|
||||||
"your_interest": "Write your interest…",
|
"your_interest": "Write your interest…",
|
||||||
"want_quick_assessment":
|
"want_quick_assessment": "Want a quick assessment to know your English level?",
|
||||||
"Want a quick assessment to know your English level?",
|
"answer_quick_questions": "Answer a few quick questions to help us understand your English proficiency.",
|
||||||
"answer_quick_questions":
|
|
||||||
"Answer a few quick questions to help us understand your English proficiency.",
|
|
||||||
"skip": "Skip",
|
"skip": "Skip",
|
||||||
"finish_level": "Finish Level",
|
"finish_level": "Finish Level",
|
||||||
"likely_speaker": "You’re likely speaker of",
|
"likely_speaker": "You’re likely speaker of",
|
||||||
|
|
@ -406,11 +390,11 @@ class CodegenLoader extends AssetLoader {
|
||||||
"welcome_abroad": "Welcome aboard",
|
"welcome_abroad": "Welcome aboard",
|
||||||
"ready_to_explore": "You’re ready to explore your personalized lessons.",
|
"ready_to_explore": "You’re ready to explore your personalized lessons.",
|
||||||
"finish": "Finish",
|
"finish": "Finish",
|
||||||
"finish_all_practice":
|
"finish_all_practice_lesson": "Finish the previous lesson practice to take this practice",
|
||||||
"Finish all the practices in the lessons to take this practice"
|
"finish_all_practice_module": "Finish the lesson practices to take the Module Practice",
|
||||||
};
|
"finish_all_practice_course": "Finish the Module practices to take the Course practice",
|
||||||
static const Map<String, Map<String, dynamic>> mapLocales = {
|
"finish_all_practice_previouse_module": "Finish the previous Module practice to take this practice",
|
||||||
"am": _am,
|
"finish_all_practice_previouse_course": "Finish the previous course practice to take this"
|
||||||
"en": _en
|
|
||||||
};
|
};
|
||||||
|
static const Map<String, Map<String,dynamic>> mapLocales = {"am": _am, "en": _en};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,8 +161,7 @@ abstract class LocaleKeys {
|
||||||
static const educational_background = 'educational_background';
|
static const educational_background = 'educational_background';
|
||||||
static const education_for_personalization = 'education_for_personalization';
|
static const education_for_personalization = 'education_for_personalization';
|
||||||
static const your_occupation = 'your_occupation';
|
static const your_occupation = 'your_occupation';
|
||||||
static const occupation_for_personalization =
|
static const occupation_for_personalization = 'occupation_for_personalization';
|
||||||
'occupation_for_personalization';
|
|
||||||
static const location = 'location';
|
static const location = 'location';
|
||||||
static const select_country_region = 'select_country_region';
|
static const select_country_region = 'select_country_region';
|
||||||
static const select_country = 'select_country';
|
static const select_country = 'select_country';
|
||||||
|
|
@ -186,5 +185,10 @@ abstract class LocaleKeys {
|
||||||
static const welcome_abroad = 'welcome_abroad';
|
static const welcome_abroad = 'welcome_abroad';
|
||||||
static const ready_to_explore = 'ready_to_explore';
|
static const ready_to_explore = 'ready_to_explore';
|
||||||
static const finish = 'finish';
|
static const finish = 'finish';
|
||||||
static const finish_all_practice = 'finish_all_practice';
|
static const finish_all_practice_lesson = 'finish_all_practice_lesson';
|
||||||
|
static const finish_all_practice_module = 'finish_all_practice_module';
|
||||||
|
static const finish_all_practice_course = 'finish_all_practice_course';
|
||||||
|
static const finish_all_practice_previouse_module = 'finish_all_practice_previouse_module';
|
||||||
|
static const finish_all_practice_previouse_course = 'finish_all_practice_previouse_course';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,8 @@ class ArifPayViewModel extends ReactiveViewModel {
|
||||||
if (await _statusChecker.checkConnection()) {
|
if (await _statusChecker.checkConnection()) {
|
||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
'plan_id': 1,
|
'plan_id': 1,
|
||||||
|
'provider': 'CHAPA',
|
||||||
'phone': '251$phone',
|
'phone': '251$phone',
|
||||||
'provider': 'ARIFPAY',
|
|
||||||
'email': 'test@gmail.com',
|
'email': 'test@gmail.com',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,9 @@ class AssessmentView extends StackedView<AssessmentViewModel> {
|
||||||
];
|
];
|
||||||
|
|
||||||
Widget _buildAssessmentIntroWrapper(AssessmentViewModel viewModel) =>
|
Widget _buildAssessmentIntroWrapper(AssessmentViewModel viewModel) =>
|
||||||
viewModel.busy(StateObjects.assessments) || viewModel.assessments.isEmpty
|
viewModel.busy(StateObjects.assessments)
|
||||||
? _buildPageLoadingIndicator(viewModel)
|
? _buildPageLoadingIndicator(viewModel)
|
||||||
: _buildAssessmentIntro();
|
: _buildAssessmentIntro(viewModel);
|
||||||
|
|
||||||
Widget _buildPageLoadingIndicator(AssessmentViewModel viewModel) =>
|
Widget _buildPageLoadingIndicator(AssessmentViewModel viewModel) =>
|
||||||
AssessmentLoadingScreen(
|
AssessmentLoadingScreen(
|
||||||
|
|
@ -64,7 +64,10 @@ class AssessmentView extends StackedView<AssessmentViewModel> {
|
||||||
onPop: viewModel.assessments.isEmpty ? viewModel.pop : null,
|
onPop: viewModel.assessments.isEmpty ? viewModel.pop : null,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildAssessmentIntro() => const AssessmentIntroScreen();
|
Widget _buildAssessmentIntro(AssessmentViewModel viewModel) =>
|
||||||
|
AssessmentIntroScreen(
|
||||||
|
hasAssessments: viewModel.assessments.isNotEmpty,
|
||||||
|
);
|
||||||
|
|
||||||
Widget _buildAssessment() => const AssessmentQuestionsScreen();
|
Widget _buildAssessment() => const AssessmentQuestionsScreen();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,9 @@ import 'package:yimaru_app/ui/widgets/large_app_bar.dart';
|
||||||
import '../assessment_viewmodel.dart';
|
import '../assessment_viewmodel.dart';
|
||||||
|
|
||||||
class AssessmentIntroScreen extends ViewModelWidget<AssessmentViewModel> {
|
class AssessmentIntroScreen extends ViewModelWidget<AssessmentViewModel> {
|
||||||
const AssessmentIntroScreen({super.key});
|
final bool hasAssessments;
|
||||||
|
|
||||||
|
const AssessmentIntroScreen({super.key, required this.hasAssessments});
|
||||||
|
|
||||||
Future<void> _next(AssessmentViewModel viewModel) async =>
|
Future<void> _next(AssessmentViewModel viewModel) async =>
|
||||||
viewModel.setFirstAssessment();
|
viewModel.setFirstAssessment();
|
||||||
|
|
@ -29,11 +31,8 @@ class AssessmentIntroScreen extends ViewModelWidget<AssessmentViewModel> {
|
||||||
children: _buildScaffoldChildren(viewModel),
|
children: _buildScaffoldChildren(viewModel),
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(AssessmentViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(AssessmentViewModel viewModel) =>
|
||||||
_buildAppBar(viewModel),
|
[_buildAppBar(viewModel), _buildExpandedBody(viewModel)];
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
|
||||||
];
|
|
||||||
|
|
||||||
Widget _buildExpandedBody(AssessmentViewModel viewModel) =>
|
Widget _buildExpandedBody(AssessmentViewModel viewModel) =>
|
||||||
Expanded(child: _buildBodyWrapper(viewModel));
|
Expanded(child: _buildBodyWrapper(viewModel));
|
||||||
|
|
@ -59,7 +58,7 @@ class AssessmentIntroScreen extends ViewModelWidget<AssessmentViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(AssessmentViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(AssessmentViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
@ -91,7 +90,7 @@ class AssessmentIntroScreen extends ViewModelWidget<AssessmentViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildLowerColumnChildren(AssessmentViewModel viewModel) => [
|
List<Widget> _buildLowerColumnChildren(AssessmentViewModel viewModel) => [
|
||||||
_buildContinueButton(viewModel),
|
if (hasAssessments) _buildContinueButton(viewModel),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSkipButtonWrapper(viewModel)
|
_buildSkipButtonWrapper(viewModel)
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class AssessmentResultScreen extends ViewModelWidget<AssessmentViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(AssessmentViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(AssessmentViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ class StartLessonScreen extends ViewModelWidget<AssessmentViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(AssessmentViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(AssessmentViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ class RequestCodeScreen extends ViewModelWidget<ForgetPasswordViewModel> {
|
||||||
required ForgetPasswordViewModel viewModel}) =>
|
required ForgetPasswordViewModel viewModel}) =>
|
||||||
[
|
[
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(context: context, viewModel: viewModel)
|
_buildExpandedBody(context: context, viewModel: viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ class ResetPasswordScreen extends ViewModelWidget<ForgetPasswordViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(ForgetPasswordViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(ForgetPasswordViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,17 +24,28 @@ class LearnCourseView extends StackedView<LearnCourseViewModel> {
|
||||||
await viewModel.navigateToLearnPractice(
|
await viewModel.navigateToLearnPractice(
|
||||||
id: course.id ?? 0, level: course.name ?? '');
|
id: course.id ?? 0, level: course.name ?? '');
|
||||||
} else {
|
} else {
|
||||||
await _showSheet(context: context, viewModel: viewModel);
|
if (course.access?.isAccessible ?? false) {
|
||||||
|
await _showSheet(
|
||||||
|
context: context,
|
||||||
|
viewModel: viewModel,
|
||||||
|
practice: PracticeReason.course);
|
||||||
|
} else {
|
||||||
|
await _showSheet(
|
||||||
|
context: context,
|
||||||
|
viewModel: viewModel,
|
||||||
|
practice: PracticeReason.previousCourse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showSheet(
|
Future<void> _showSheet(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
|
required PracticeReason practice,
|
||||||
required LearnCourseViewModel viewModel}) async =>
|
required LearnCourseViewModel viewModel}) async =>
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: kcTransparent,
|
backgroundColor: kcTransparent,
|
||||||
builder: (_) => _buildSheet(viewModel),
|
builder: (_) => _buildSheet(viewModel: viewModel, practice: practice),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -156,6 +167,11 @@ class LearnCourseView extends StackedView<LearnCourseViewModel> {
|
||||||
onPracticeTap: onPracticeTap,
|
onPracticeTap: onPracticeTap,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildSheet(LearnCourseViewModel viewModel) =>
|
Widget _buildSheet(
|
||||||
FinishPracticeSheet(onTap: viewModel.pop);
|
{required PracticeReason practice,
|
||||||
|
required LearnCourseViewModel viewModel}) =>
|
||||||
|
FinishPracticeSheet(
|
||||||
|
practice: practice,
|
||||||
|
onTap: viewModel.pop,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,23 @@ class LearnLessonView extends StackedView<LearnLessonViewModel> {
|
||||||
} else {
|
} else {
|
||||||
await _showSheet(context: context, viewModel: viewModel);
|
await _showSheet(context: context, viewModel: viewModel);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
/* if (index > 1) {
|
if (index > 1) {
|
||||||
if (viewModel.user?.subscriptionStatus?.toLowerCase() == 'subscribed') {
|
if (viewModel.user?.subscriptionStatus?.toLowerCase() == 'subscribed') {
|
||||||
|
if (lesson.access?.isAccessible ?? false) {
|
||||||
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
||||||
|
} else {
|
||||||
|
await _showSheet(context: context, viewModel: viewModel);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await viewModel.navigateToLearnSubscription();
|
await viewModel.navigateToLearnSubscription();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (lesson.access?.isAccessible ?? false) {
|
||||||
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
||||||
|
} else {
|
||||||
|
await _showSheet(context: context, viewModel: viewModel);
|
||||||
|
}
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -197,7 +205,8 @@ class LearnLessonView extends StackedView<LearnLessonViewModel> {
|
||||||
style: style18DG700,
|
style: style18DG700,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildListViewBuilder( {required BuildContext context,
|
Widget _buildListViewBuilder(
|
||||||
|
{required BuildContext context,
|
||||||
required LearnLessonViewModel viewModel}) =>
|
required LearnLessonViewModel viewModel}) =>
|
||||||
viewModel.busy(StateObjects.learnLessons)
|
viewModel.busy(StateObjects.learnLessons)
|
||||||
? _buildProgressIndicator()
|
? _buildProgressIndicator()
|
||||||
|
|
@ -207,14 +216,17 @@ class LearnLessonView extends StackedView<LearnLessonViewModel> {
|
||||||
child: CustomCircularProgressIndicator(color: kcPrimaryColor),
|
child: CustomCircularProgressIndicator(color: kcPrimaryColor),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildListView( {required BuildContext context,
|
Widget _buildListView(
|
||||||
required LearnLessonViewModel viewModel}) => ListView.builder(
|
{required BuildContext context,
|
||||||
|
required LearnLessonViewModel viewModel}) =>
|
||||||
|
ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: viewModel.lessons.length,
|
itemCount: viewModel.lessons.length,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemBuilder: (context, index) => _buildTile(
|
itemBuilder: (context, index) => _buildTile(
|
||||||
index: index,
|
index: index,
|
||||||
lesson: viewModel.lessons[index],
|
lesson: viewModel.lessons[index],
|
||||||
|
last: index == viewModel.lessons.length - 1 ,
|
||||||
onPracticeTap: () async => await _onPractice(
|
onPracticeTap: () async => await _onPractice(
|
||||||
index: index,
|
index: index,
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -231,18 +243,23 @@ required LearnLessonViewModel viewModel}) => ListView.builder(
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildTile({
|
Widget _buildTile({
|
||||||
|
required bool last,
|
||||||
required int index,
|
required int index,
|
||||||
required LearnLesson lesson,
|
required LearnLesson lesson,
|
||||||
required GestureTapCallback? onLessonTap,
|
required GestureTapCallback? onLessonTap,
|
||||||
required GestureTapCallback? onPracticeTap,
|
required GestureTapCallback? onPracticeTap,
|
||||||
}) =>
|
}) =>
|
||||||
LearnLessonTile(
|
LearnLessonTile(
|
||||||
|
last: last,
|
||||||
index: index,
|
index: index,
|
||||||
|
|
||||||
lesson: lesson,
|
lesson: lesson,
|
||||||
onLessonTap: onLessonTap,
|
onLessonTap: onLessonTap,
|
||||||
onPracticeTap: onPracticeTap,
|
onPracticeTap: onPracticeTap,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildSheet(LearnLessonViewModel viewModel) =>
|
Widget _buildSheet(LearnLessonViewModel viewModel) => FinishPracticeSheet(
|
||||||
FinishPracticeSheet(onTap: viewModel.pop);
|
onTap: viewModel.pop,
|
||||||
|
practice: PracticeReason.lesson,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,18 @@ class LearnLessonDetailView extends StackedView<LearnLessonDetailViewModel> {
|
||||||
required LearnLessonDetailViewModel viewModel}) async {
|
required LearnLessonDetailViewModel viewModel}) async {
|
||||||
await viewModel.pause();
|
await viewModel.pause();
|
||||||
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
||||||
|
|
||||||
|
|
||||||
/* if (index > 1) {
|
/* if (index > 1) {
|
||||||
if (viewModel.user?.subscriptionStatus?.toLowerCase() == 'subscribed') {
|
if (viewModel.user?.subscriptionStatus?.toLowerCase() == 'subscribed') {
|
||||||
|
await viewModel.pause();
|
||||||
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
||||||
} else {
|
} else {
|
||||||
|
await viewModel.pause();
|
||||||
await viewModel.navigateToLearnSubscription();
|
await viewModel.navigateToLearnSubscription();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
await viewModel.pause();
|
||||||
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
await viewModel.navigateToLearnPractice(lesson.id ?? 0);
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import 'learn_module_viewmodel.dart';
|
||||||
|
|
||||||
class LearnModuleView extends StackedView<LearnModuleViewModel> {
|
class LearnModuleView extends StackedView<LearnModuleViewModel> {
|
||||||
final LearnCourse course;
|
final LearnCourse course;
|
||||||
|
|
||||||
const LearnModuleView({Key? key, required this.course}) : super(key: key);
|
const LearnModuleView({Key? key, required this.course}) : super(key: key);
|
||||||
|
|
||||||
Future<void> _onPractice(
|
Future<void> _onPractice(
|
||||||
|
|
@ -27,17 +28,31 @@ class LearnModuleView extends StackedView<LearnModuleViewModel> {
|
||||||
await viewModel.navigateToLearnPractice(
|
await viewModel.navigateToLearnPractice(
|
||||||
id: module.id ?? 0, module: module.name ?? '');
|
id: module.id ?? 0, module: module.name ?? '');
|
||||||
} else {
|
} else {
|
||||||
await _showSheet(context: context, viewModel: viewModel);
|
if (module.access?.isAccessible ?? false) {
|
||||||
|
print('Accessible');
|
||||||
|
await _showSheet(
|
||||||
|
context: context,
|
||||||
|
viewModel: viewModel,
|
||||||
|
practice: PracticeReason.module);
|
||||||
|
} else {
|
||||||
|
print('Inaccessible');
|
||||||
|
|
||||||
|
await _showSheet(
|
||||||
|
context: context,
|
||||||
|
viewModel: viewModel,
|
||||||
|
practice: PracticeReason.previousModule);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showSheet(
|
Future<void> _showSheet(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
|
required PracticeReason practice,
|
||||||
required LearnModuleViewModel viewModel}) async =>
|
required LearnModuleViewModel viewModel}) async =>
|
||||||
await showModalBottomSheet(
|
await showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: kcTransparent,
|
backgroundColor: kcTransparent,
|
||||||
builder: (_) => _buildSheet(viewModel),
|
builder: (_) => _buildSheet(viewModel: viewModel, practice: practice),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -201,6 +216,11 @@ class LearnModuleView extends StackedView<LearnModuleViewModel> {
|
||||||
onModuleTap: onModuleTap,
|
onModuleTap: onModuleTap,
|
||||||
onPracticeTap: onPracticeTap);
|
onPracticeTap: onPracticeTap);
|
||||||
|
|
||||||
Widget _buildSheet(LearnModuleViewModel viewModel) =>
|
Widget _buildSheet(
|
||||||
FinishPracticeSheet(onTap: viewModel.pop);
|
{required PracticeReason practice,
|
||||||
|
required LearnModuleViewModel viewModel}) =>
|
||||||
|
FinishPracticeSheet(
|
||||||
|
practice: practice,
|
||||||
|
onTap: viewModel.pop,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import 'package:yimaru_app/ui/views/onboarding/screens/country_region_form_scree
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/educational_background_form_screen.dart';
|
import 'package:yimaru_app/ui/views/onboarding/screens/educational_background_form_screen.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/full_name_form_screen.dart';
|
import 'package:yimaru_app/ui/views/onboarding/screens/full_name_form_screen.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/gender_form_screen.dart';
|
import 'package:yimaru_app/ui/views/onboarding/screens/gender_form_screen.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/language_goal_form_screen.dart';
|
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/learning_goal_form_screen.dart';
|
import 'package:yimaru_app/ui/views/onboarding/screens/learning_goal_form_screen.dart';
|
||||||
|
import 'package:yimaru_app/ui/views/onboarding/screens/language_goal_form_screen.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/occupation_form_screen.dart';
|
import 'package:yimaru_app/ui/views/onboarding/screens/occupation_form_screen.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/screens/topic_form_screen.dart';
|
import 'package:yimaru_app/ui/views/onboarding/screens/topic_form_screen.dart';
|
||||||
|
|
||||||
|
|
@ -129,9 +129,9 @@ class OnboardingView extends StackedView<OnboardingViewModel>
|
||||||
Widget _buildCountryRegionForm() =>
|
Widget _buildCountryRegionForm() =>
|
||||||
CountryRegionFormScreen(regionController: regionController);
|
CountryRegionFormScreen(regionController: regionController);
|
||||||
|
|
||||||
Widget _buildLearningGoalForm() => const LearningGoalFormScreen();
|
Widget _buildLearningGoalForm() => const LanguageGoalFormScreens();
|
||||||
|
|
||||||
Widget _buildLanguageGoalForm() => const LanguageGoalFormScreen();
|
Widget _buildLanguageGoalForm() => const LearningGoalFormScreen();
|
||||||
|
|
||||||
Widget _buildChallengeForm() => const ChallengeFormScreen();
|
Widget _buildChallengeForm() => const ChallengeFormScreen();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -243,8 +243,7 @@ class OnboardingViewModel extends ReactiveViewModel
|
||||||
bool isSelectedLearningGoal(FieldOption value) =>
|
bool isSelectedLearningGoal(FieldOption value) =>
|
||||||
_selectedLearningGoal == value;
|
_selectedLearningGoal == value;
|
||||||
|
|
||||||
// Learning reason
|
// Language goal
|
||||||
|
|
||||||
void setSelectedLanguageGoal(FieldOption value) {
|
void setSelectedLanguageGoal(FieldOption value) {
|
||||||
_selectedLanguageGoal = value;
|
_selectedLanguageGoal = value;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ class AgeGroupFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -76,7 +75,7 @@ class AgeGroupFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ class ChallengeFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -77,7 +76,7 @@ class ChallengeFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,6 @@ class CountryRegionFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -93,7 +92,7 @@ class CountryRegionFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ class EducationalBackgroundFormScreen
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -78,7 +77,7 @@ class EducationalBackgroundFormScreen
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ class FullNameFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -75,7 +74,7 @@ class FullNameFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ class GenderFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -70,7 +69,7 @@ class GenderFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,43 @@
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:iconsax/iconsax.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:yimaru_app/ui/common/app_colors.dart';
|
import 'package:yimaru_app/ui/common/app_colors.dart';
|
||||||
import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart';
|
import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart';
|
||||||
import 'package:yimaru_app/ui/common/ui_helpers.dart';
|
import 'package:yimaru_app/ui/common/ui_helpers.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/custom_elevated_button.dart';
|
import 'package:yimaru_app/ui/widgets/custom_elevated_button.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/onboarding_viewmodel.dart';
|
import 'package:yimaru_app/ui/views/onboarding/onboarding_viewmodel.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/custom_small_radio_button.dart';
|
import 'package:yimaru_app/ui/widgets/custom_large_radio_button.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/large_app_bar.dart';
|
import 'package:yimaru_app/ui/widgets/large_app_bar.dart';
|
||||||
|
|
||||||
class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
class LanguageGoalFormScreens extends ViewModelWidget<OnboardingViewModel> {
|
||||||
const LanguageGoalFormScreen({super.key});
|
const LanguageGoalFormScreens({super.key});
|
||||||
|
|
||||||
|
IconData getIcon(int index) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
return Iconsax.book;
|
||||||
|
case 1:
|
||||||
|
return Iconsax.microphone;
|
||||||
|
case 2:
|
||||||
|
return Iconsax.bag;
|
||||||
|
}
|
||||||
|
return Icons.book;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String getSubtitle(int index) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
return 'I know some English, but i want to learn to speak it';
|
||||||
|
case 1:
|
||||||
|
return 'I already speak English, but I want more practice.';
|
||||||
|
case 2:
|
||||||
|
return 'I want courses for IELTS, TOEFL, Duolingo, or work';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
void _pop(OnboardingViewModel viewModel) {
|
void _pop(OnboardingViewModel viewModel) {
|
||||||
viewModel.resetLanguageGoalFormScreen();
|
viewModel.resetLanguageGoalFormScreen();
|
||||||
|
|
@ -22,6 +49,7 @@ class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
'language_goal': viewModel.selectedLanguageGoal?.code,
|
'language_goal': viewModel.selectedLanguageGoal?.code,
|
||||||
|
|
||||||
};
|
};
|
||||||
viewModel.addUserData(data);
|
viewModel.addUserData(data);
|
||||||
|
|
||||||
|
|
@ -44,7 +72,6 @@ class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -77,13 +104,10 @@ class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
|
verticalSpaceLarge,
|
||||||
|
_buildTitle(viewModel),
|
||||||
verticalSpaceMedium,
|
verticalSpaceMedium,
|
||||||
_buildTitle(),
|
_buildLanguageGoals(viewModel)
|
||||||
verticalSpaceSmall,
|
|
||||||
_buildSubtitle(),
|
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildReasons(viewModel),
|
|
||||||
verticalSpaceMedium,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
Widget _buildAppBar(OnboardingViewModel viewModel) => LargeAppBar(
|
Widget _buildAppBar(OnboardingViewModel viewModel) => LargeAppBar(
|
||||||
|
|
@ -96,22 +120,26 @@ class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
: viewModel.selectedLanguage['code'],
|
: viewModel.selectedLanguage['code'],
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildTitle() => Text(
|
Widget _buildTitle(OnboardingViewModel viewModel) => Text.rich(
|
||||||
LocaleKeys.language_goal.tr(),
|
TextSpan(
|
||||||
style: style25DG600,
|
text:
|
||||||
|
'${LocaleKeys.hello.tr()} ${viewModel.userData['first_name']},',
|
||||||
|
style: style18P600.copyWith(fontSize: 22),
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text: ' ${LocaleKeys.language_goal.tr()}',
|
||||||
|
style: style16DG600.copyWith(fontSize: 22),
|
||||||
|
)
|
||||||
|
]),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildSubtitle() => Text(
|
Widget _buildLanguageGoals(OnboardingViewModel viewModel) => ListView.builder(
|
||||||
LocaleKeys.your_goal.tr(),
|
|
||||||
style: style14MG400,
|
|
||||||
);
|
|
||||||
|
|
||||||
Widget _buildReasons(OnboardingViewModel viewModel) => ListView.builder(
|
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
itemCount: viewModel.languageGoals.length,
|
itemCount: viewModel.languageGoals.length,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemBuilder: (context, index) => _buildLanguageGoal(
|
itemBuilder: (context, index) => _buildLanguageGoal(
|
||||||
|
icon: getIcon(index),
|
||||||
|
subtitle: getSubtitle(index),
|
||||||
title:viewModel.languageGoals[index].label ?? '',
|
title:viewModel.languageGoals[index].label ?? '',
|
||||||
selected:
|
selected:
|
||||||
viewModel.isSelectedLanguageGoal(viewModel.languageGoals[index]),
|
viewModel.isSelectedLanguageGoal(viewModel.languageGoals[index]),
|
||||||
|
|
@ -123,10 +151,14 @@ class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
Widget _buildLanguageGoal(
|
Widget _buildLanguageGoal(
|
||||||
{required String title,
|
{required String title,
|
||||||
required bool selected,
|
required bool selected,
|
||||||
|
required IconData icon,
|
||||||
|
required String subtitle,
|
||||||
required GestureTapCallback onTap}) =>
|
required GestureTapCallback onTap}) =>
|
||||||
CustomSmallRadioButton(
|
CustomLargeRadioButton(
|
||||||
|
icon: icon,
|
||||||
title: title,
|
title: title,
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
|
subtitle: subtitle,
|
||||||
selected: selected,
|
selected: selected,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -146,5 +178,6 @@ class LanguageGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
: null,
|
: null,
|
||||||
backgroundColor: viewModel.selectedLanguageGoal != null
|
backgroundColor: viewModel.selectedLanguageGoal != null
|
||||||
? kcPrimaryColor
|
? kcPrimaryColor
|
||||||
: kcPrimaryColor.withOpacity(0.1));
|
: kcPrimaryColor.withOpacity(0.1),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,17 @@
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:iconsax/iconsax.dart';
|
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:yimaru_app/ui/common/app_colors.dart';
|
import 'package:yimaru_app/ui/common/app_colors.dart';
|
||||||
import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart';
|
import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart';
|
||||||
import 'package:yimaru_app/ui/common/ui_helpers.dart';
|
import 'package:yimaru_app/ui/common/ui_helpers.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/custom_elevated_button.dart';
|
import 'package:yimaru_app/ui/widgets/custom_elevated_button.dart';
|
||||||
import 'package:yimaru_app/ui/views/onboarding/onboarding_viewmodel.dart';
|
import 'package:yimaru_app/ui/views/onboarding/onboarding_viewmodel.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/custom_large_radio_button.dart';
|
import 'package:yimaru_app/ui/widgets/custom_small_radio_button.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/large_app_bar.dart';
|
import 'package:yimaru_app/ui/widgets/large_app_bar.dart';
|
||||||
|
|
||||||
class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
const LearningGoalFormScreen({super.key});
|
const LearningGoalFormScreen({super.key});
|
||||||
|
|
||||||
IconData getIcon(int index) {
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
return Iconsax.book;
|
|
||||||
case 1:
|
|
||||||
return Iconsax.microphone;
|
|
||||||
case 2:
|
|
||||||
return Iconsax.bag;
|
|
||||||
}
|
|
||||||
return Icons.book;
|
|
||||||
}
|
|
||||||
|
|
||||||
String getTitles(int index) {
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
return 'Learn to Speak English';
|
|
||||||
case 1:
|
|
||||||
return 'Practice Speaking English';
|
|
||||||
case 2:
|
|
||||||
return 'Skill-based Courses';
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSubtitle(int index) {
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
return 'I know some English, but i want to learn to speak it';
|
|
||||||
case 1:
|
|
||||||
return 'I already speak English, but I want more practice.';
|
|
||||||
case 2:
|
|
||||||
return 'I want courses for IELTS, TOEFL, Duolingo, or work';
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
void _pop(OnboardingViewModel viewModel) {
|
void _pop(OnboardingViewModel viewModel) {
|
||||||
viewModel.resetLearningGoalFormScreen();
|
viewModel.resetLearningGoalFormScreen();
|
||||||
viewModel.goBack();
|
viewModel.goBack();
|
||||||
|
|
@ -81,7 +44,6 @@ class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -114,10 +76,13 @@ class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
|
verticalSpaceLarge,
|
||||||
|
_buildTitle(),
|
||||||
|
verticalSpaceSmall,
|
||||||
|
_buildSubtitle(),
|
||||||
verticalSpaceMedium,
|
verticalSpaceMedium,
|
||||||
_buildTitle(viewModel),
|
_buildGoals(viewModel),
|
||||||
verticalSpaceMedium,
|
verticalSpaceMedium,
|
||||||
_buildLearningGoals(viewModel)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
Widget _buildAppBar(OnboardingViewModel viewModel) => LargeAppBar(
|
Widget _buildAppBar(OnboardingViewModel viewModel) => LargeAppBar(
|
||||||
|
|
@ -130,27 +95,23 @@ class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
: viewModel.selectedLanguage['code'],
|
: viewModel.selectedLanguage['code'],
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildTitle(OnboardingViewModel viewModel) => Text.rich(
|
Widget _buildTitle() => Text(
|
||||||
TextSpan(
|
LocaleKeys.learning_goal.tr(),
|
||||||
text:
|
style: style25DG600,
|
||||||
'${LocaleKeys.hello.tr()} ${viewModel.userData['first_name']},',
|
|
||||||
style: style18P600.copyWith(fontSize: 22),
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: ' ${LocaleKeys.learning_goal.tr()}',
|
|
||||||
style: style16DG600.copyWith(fontSize: 22),
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildLearningGoals(OnboardingViewModel viewModel) => ListView.builder(
|
Widget _buildSubtitle() => Text(
|
||||||
|
LocaleKeys.your_goal.tr(),
|
||||||
|
style: style14MG400,
|
||||||
|
);
|
||||||
|
|
||||||
|
Widget _buildGoals(OnboardingViewModel viewModel) => ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: 3, // viewModel.learningGoals.length,
|
padding: EdgeInsets.zero,
|
||||||
|
itemCount: viewModel.learningGoals.length,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemBuilder: (context, index) => _buildLearningGoal(
|
itemBuilder: (context, index) => _buildLearningGoal(
|
||||||
icon: getIcon(index),
|
title: viewModel.learningGoals[index].label ?? '',
|
||||||
title: getTitles(index),
|
|
||||||
subtitle: getSubtitle(index),
|
|
||||||
selected:
|
selected:
|
||||||
viewModel.isSelectedLearningGoal(viewModel.learningGoals[index]),
|
viewModel.isSelectedLearningGoal(viewModel.learningGoals[index]),
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
|
|
@ -161,14 +122,10 @@ class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
Widget _buildLearningGoal(
|
Widget _buildLearningGoal(
|
||||||
{required String title,
|
{required String title,
|
||||||
required bool selected,
|
required bool selected,
|
||||||
required IconData icon,
|
|
||||||
required String subtitle,
|
|
||||||
required GestureTapCallback onTap}) =>
|
required GestureTapCallback onTap}) =>
|
||||||
CustomLargeRadioButton(
|
CustomSmallRadioButton(
|
||||||
icon: icon,
|
|
||||||
title: title,
|
title: title,
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
subtitle: subtitle,
|
|
||||||
selected: selected,
|
selected: selected,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -188,6 +145,5 @@ class LearningGoalFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
: null,
|
: null,
|
||||||
backgroundColor: viewModel.selectedLearningGoal != null
|
backgroundColor: viewModel.selectedLearningGoal != null
|
||||||
? kcPrimaryColor
|
? kcPrimaryColor
|
||||||
: kcPrimaryColor.withOpacity(0.1),
|
: kcPrimaryColor.withOpacity(0.1));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ class OccupationFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -78,7 +77,7 @@ class OccupationFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ class TopicFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
|
|
||||||
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildScaffoldChildren(OnboardingViewModel viewModel) => [
|
||||||
_buildAppBar(viewModel),
|
_buildAppBar(viewModel),
|
||||||
verticalSpaceMedium,
|
|
||||||
_buildExpandedBody(viewModel)
|
_buildExpandedBody(viewModel)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -90,7 +89,7 @@ class TopicFormScreen extends ViewModelWidget<OnboardingViewModel> {
|
||||||
);
|
);
|
||||||
|
|
||||||
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
List<Widget> _buildUpperColumnChildren(OnboardingViewModel viewModel) => [
|
||||||
verticalSpaceMedium,
|
verticalSpaceLarge,
|
||||||
_buildTitle(),
|
_buildTitle(),
|
||||||
verticalSpaceSmall,
|
verticalSpaceSmall,
|
||||||
_buildSubtitle(),
|
_buildSubtitle(),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
import 'package:yimaru_app/models/course_lesson.dart';
|
import 'package:yimaru_app/models/course_lesson.dart';
|
||||||
import 'package:yimaru_app/models/course_module.dart';
|
import 'package:yimaru_app/models/course_module.dart';
|
||||||
|
import 'package:yimaru_app/ui/common/enmus.dart';
|
||||||
import 'package:yimaru_app/ui/views/course_module/course_module_viewmodel.dart';
|
import 'package:yimaru_app/ui/views/course_module/course_module_viewmodel.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/course_lesson_tile.dart';
|
import 'package:yimaru_app/ui/widgets/course_lesson_tile.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/custom_linear_progress_indicator.dart';
|
import 'package:yimaru_app/ui/widgets/custom_linear_progress_indicator.dart';
|
||||||
|
|
@ -182,6 +183,7 @@ class CourseModuleTileLarge extends ViewModelWidget<CourseModuleViewModel> {
|
||||||
|
|
||||||
Widget _buildSheet(CourseModuleViewModel viewModel) => FinishPracticeSheet(
|
Widget _buildSheet(CourseModuleViewModel viewModel) => FinishPracticeSheet(
|
||||||
onTap: viewModel.pop,
|
onTap: viewModel.pop,
|
||||||
|
practice: PracticeReason.lesson,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildCourseModules(CourseModuleViewModel viewModel) =>
|
Widget _buildCourseModules(CourseModuleViewModel viewModel) =>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import 'package:yimaru_app/ui/widgets/finish_practice_sheet.dart';
|
||||||
|
|
||||||
import '../../models/course_catalog.dart';
|
import '../../models/course_catalog.dart';
|
||||||
import '../common/app_colors.dart';
|
import '../common/app_colors.dart';
|
||||||
|
import '../common/enmus.dart';
|
||||||
import '../common/ui_helpers.dart';
|
import '../common/ui_helpers.dart';
|
||||||
import '../views/course_unit/course_unit_viewmodel.dart';
|
import '../views/course_unit/course_unit_viewmodel.dart';
|
||||||
import 'custom_circular_progress_indicator.dart';
|
import 'custom_circular_progress_indicator.dart';
|
||||||
|
|
@ -228,6 +229,7 @@ class CourseUnitTile extends ViewModelWidget<CourseUnitViewModel> {
|
||||||
|
|
||||||
Widget _buildSheet(CourseUnitViewModel viewModel) => FinishPracticeSheet(
|
Widget _buildSheet(CourseUnitViewModel viewModel) => FinishPracticeSheet(
|
||||||
onTap: viewModel.pop,
|
onTap: viewModel.pop,
|
||||||
|
practice: PracticeReason.course,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildCourseModulesState(CourseUnitViewModel viewModel) =>
|
Widget _buildCourseModulesState(CourseUnitViewModel viewModel) =>
|
||||||
|
|
@ -240,6 +242,7 @@ class CourseUnitTile extends ViewModelWidget<CourseUnitViewModel> {
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
child: _buildProgressIndicator(),
|
child: _buildProgressIndicator(),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildProgressIndicator() => const Center(
|
Widget _buildProgressIndicator() => const Center(
|
||||||
child: CustomCircularProgressIndicator(color: kcPrimaryColor),
|
child: CustomCircularProgressIndicator(color: kcPrimaryColor),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:yimaru_app/ui/common/app_colors.dart';
|
import 'package:yimaru_app/ui/common/app_colors.dart';
|
||||||
|
import 'package:yimaru_app/ui/common/enmus.dart';
|
||||||
import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart';
|
import 'package:yimaru_app/ui/common/translations/locale_keys.g.dart';
|
||||||
import 'package:yimaru_app/ui/common/ui_helpers.dart';
|
import 'package:yimaru_app/ui/common/ui_helpers.dart';
|
||||||
import 'package:yimaru_app/ui/widgets/custom_bottom_sheet.dart';
|
import 'package:yimaru_app/ui/widgets/custom_bottom_sheet.dart';
|
||||||
|
|
@ -9,9 +10,24 @@ import 'package:yimaru_app/ui/widgets/custom_bottom_sheet.dart';
|
||||||
import 'custom_elevated_button.dart';
|
import 'custom_elevated_button.dart';
|
||||||
|
|
||||||
class FinishPracticeSheet extends StatelessWidget {
|
class FinishPracticeSheet extends StatelessWidget {
|
||||||
|
final PracticeReason practice;
|
||||||
final GestureTapCallback? onTap;
|
final GestureTapCallback? onTap;
|
||||||
|
|
||||||
const FinishPracticeSheet({super.key, this.onTap});
|
const FinishPracticeSheet({super.key, this.onTap, required this.practice});
|
||||||
|
|
||||||
|
String getWarning() {
|
||||||
|
if (practice == PracticeReason.lesson) {
|
||||||
|
return LocaleKeys.finish_all_practice_lesson.tr();
|
||||||
|
} else if (practice == PracticeReason.module) {
|
||||||
|
return LocaleKeys.finish_all_practice_module.tr();
|
||||||
|
} else if (practice == PracticeReason.previousModule) {
|
||||||
|
return LocaleKeys.finish_all_practice_previouse_module.tr();
|
||||||
|
} else if (practice == PracticeReason.previousCourse) {
|
||||||
|
return LocaleKeys.finish_all_practice_previouse_course.tr();
|
||||||
|
} else {
|
||||||
|
return LocaleKeys.finish_all_practice_course.tr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _buildSheetWrapper();
|
Widget build(BuildContext context) => _buildSheetWrapper();
|
||||||
|
|
@ -44,7 +60,7 @@ class FinishPracticeSheet extends StatelessWidget {
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildMessage() => Text(
|
Widget _buildMessage() => Text(
|
||||||
LocaleKeys.finish_all_practice.tr(),
|
getWarning(),
|
||||||
style: style16DG600,
|
style: style16DG600,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,13 @@ class LearnCourseTile extends ViewModelWidget<LearnCourseViewModel> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, LearnCourseViewModel viewModel) =>
|
Widget build(BuildContext context, LearnCourseViewModel viewModel) =>
|
||||||
_buildExpansionTileCard(viewModel);
|
_buildExpansionTileCardWrapper(viewModel);
|
||||||
|
|
||||||
|
|
||||||
|
Widget _buildExpansionTileCardWrapper(LearnCourseViewModel viewModel)=> GestureDetector(
|
||||||
|
onTap: !(course.access?.isAccessible ?? false) ? onPracticeTap:null,
|
||||||
|
child: _buildExpansionTileCard(viewModel),
|
||||||
|
);
|
||||||
|
|
||||||
Widget _buildExpansionTileCard(LearnCourseViewModel viewModel) => Container(
|
Widget _buildExpansionTileCard(LearnCourseViewModel viewModel) => Container(
|
||||||
margin: const EdgeInsets.only(bottom: 15),
|
margin: const EdgeInsets.only(bottom: 15),
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import 'custom_linear_progress_indicator.dart';
|
||||||
|
|
||||||
class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
||||||
final int index;
|
final int index;
|
||||||
|
final bool last;
|
||||||
final LearnLesson lesson;
|
final LearnLesson lesson;
|
||||||
final GestureTapCallback? onLessonTap;
|
final GestureTapCallback? onLessonTap;
|
||||||
final GestureTapCallback? onPracticeTap;
|
final GestureTapCallback? onPracticeTap;
|
||||||
|
|
@ -24,6 +25,7 @@ class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
||||||
{super.key,
|
{super.key,
|
||||||
this.onLessonTap,
|
this.onLessonTap,
|
||||||
this.onPracticeTap,
|
this.onPracticeTap,
|
||||||
|
required this.last,
|
||||||
required this.index,
|
required this.index,
|
||||||
required this.lesson});
|
required this.lesson});
|
||||||
|
|
||||||
|
|
@ -31,10 +33,12 @@ class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
||||||
Widget build(BuildContext context, LearnLessonViewModel viewModel) =>
|
Widget build(BuildContext context, LearnLessonViewModel viewModel) =>
|
||||||
_buildContainerWrapper(viewModel);
|
_buildContainerWrapper(viewModel);
|
||||||
|
|
||||||
Widget _buildContainerWrapper(LearnLessonViewModel viewModel)=> GestureDetector(
|
Widget _buildContainerWrapper(LearnLessonViewModel viewModel) =>
|
||||||
|
GestureDetector(
|
||||||
onTap: !(lesson.access?.isAccessible ?? false) ? onPracticeTap : null,
|
onTap: !(lesson.access?.isAccessible ?? false) ? onPracticeTap : null,
|
||||||
child: _buildContainer(viewModel),
|
child: _buildContainer(viewModel),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildContainer(LearnLessonViewModel viewModel) => Container(
|
Widget _buildContainer(LearnLessonViewModel viewModel) => Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
margin: const EdgeInsets.only(bottom: 15),
|
margin: const EdgeInsets.only(bottom: 15),
|
||||||
|
|
@ -70,12 +74,14 @@ class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
||||||
controlAffinity: ListTileControlAffinity.trailing,
|
controlAffinity: ListTileControlAffinity.trailing,
|
||||||
expandedCrossAxisAlignment: CrossAxisAlignment.start,
|
expandedCrossAxisAlignment: CrossAxisAlignment.start,
|
||||||
tilePadding: const EdgeInsets.fromLTRB(15, 15, 15, 15),
|
tilePadding: const EdgeInsets.fromLTRB(15, 15, 15, 15),
|
||||||
backgroundColor: (lesson.access?.isCompleted ?? false)
|
|
||||||
? kcGreen.withOpacity(0.1)
|
|
||||||
: kcPrimaryColor.withOpacity(0.1),
|
|
||||||
childrenPadding: const EdgeInsets.fromLTRB(15, 0, 15, 15),
|
childrenPadding: const EdgeInsets.fromLTRB(15, 0, 15, 15),
|
||||||
initiallyExpanded: (lesson.access?.isAccessible ?? false) &&
|
initiallyExpanded: (lesson.access?.isAccessible ?? false) &&
|
||||||
!(lesson.access?.isCompleted ?? false),
|
!(lesson.access?.isCompleted ?? false),
|
||||||
|
backgroundColor: last && (lesson.access?.isAccessible ?? false)
|
||||||
|
? kcGreen.withOpacity(0.1)
|
||||||
|
: (lesson.access?.isCompleted ?? false)
|
||||||
|
? kcGreen.withOpacity(0.1)
|
||||||
|
: kcPrimaryColor.withOpacity(0.1),
|
||||||
collapsedBackgroundColor: (lesson.access?.isCompleted ?? false)
|
collapsedBackgroundColor: (lesson.access?.isCompleted ?? false)
|
||||||
? kcGreen.withOpacity(0.1)
|
? kcGreen.withOpacity(0.1)
|
||||||
: kcPrimaryColor.withOpacity(0.1),
|
: kcPrimaryColor.withOpacity(0.1),
|
||||||
|
|
@ -92,7 +98,9 @@ class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
||||||
style: style16DG600,
|
style: style16DG600,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildIconState() => (lesson.access?.isCompleted ?? false)
|
Widget _buildIconState() => last && (lesson.access?.isAccessible ?? false)
|
||||||
|
? _buildCompleteIcon()
|
||||||
|
: (lesson.access?.isCompleted ?? false)
|
||||||
? _buildCompleteIcon()
|
? _buildCompleteIcon()
|
||||||
: _buildPendingIcon();
|
: _buildPendingIcon();
|
||||||
|
|
||||||
|
|
@ -128,11 +136,15 @@ class LearnLessonTile extends ViewModelWidget<LearnLessonViewModel> {
|
||||||
Widget _buildProgress() => CustomLinearProgressIndicator(
|
Widget _buildProgress() => CustomLinearProgressIndicator(
|
||||||
activeColor: kcPrimaryColor,
|
activeColor: kcPrimaryColor,
|
||||||
backgroundColor: kcVeryLightGrey,
|
backgroundColor: kcVeryLightGrey,
|
||||||
progress: (lesson.access?.progressPercent ?? 0) / 100,
|
progress: last && (lesson.access?.isAccessible ?? false)
|
||||||
|
? 1
|
||||||
|
: (lesson.access?.progressPercent ?? 0) / 100,
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildProgressText() => Text(
|
Widget _buildProgressText() => Text(
|
||||||
(lesson.access?.isCompleted ?? false)
|
last && (lesson.access?.isAccessible ?? false)
|
||||||
|
? LocaleKeys.completed.tr()
|
||||||
|
: (lesson.access?.isCompleted ?? false)
|
||||||
? LocaleKeys.completed.tr()
|
? LocaleKeys.completed.tr()
|
||||||
: LocaleKeys.in_progress.tr(),
|
: LocaleKeys.in_progress.tr(),
|
||||||
style: style14P600,
|
style: style14P600,
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,13 @@ class LearnModuleTile extends ViewModelWidget<LearnModuleViewModel> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, LearnModuleViewModel viewModel) =>
|
Widget build(BuildContext context, LearnModuleViewModel viewModel) =>
|
||||||
_buildExpansionTileCard(context: context, viewModel: viewModel);
|
_buildExpansionTileCardWrapper(context: context, viewModel: viewModel);
|
||||||
|
|
||||||
|
Widget _buildExpansionTileCardWrapper( {required BuildContext context,
|
||||||
|
required LearnModuleViewModel viewModel})=> GestureDetector(
|
||||||
|
onTap: !(module.access?.isAccessible ?? false) ? onPracticeTap:null,
|
||||||
|
child: _buildExpansionTileCard(context: context,viewModel: viewModel),
|
||||||
|
);
|
||||||
Widget _buildExpansionTileCard(
|
Widget _buildExpansionTileCard(
|
||||||
{required BuildContext context,
|
{required BuildContext context,
|
||||||
required LearnModuleViewModel viewModel}) =>
|
required LearnModuleViewModel viewModel}) =>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
name: yimaru_app
|
name: yimaru_app
|
||||||
version: 0.1.28+30
|
version: 0.1.29+31
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
description: A new Flutter project.
|
description: A new Flutter project.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user