diff --git a/lib/models/profile/branch2.dart b/lib/models/profile/branch2.dart index a2af03d..25e1141 100644 --- a/lib/models/profile/branch2.dart +++ b/lib/models/profile/branch2.dart @@ -103,7 +103,7 @@ class ServiceProviderBranch { final int? id; int? countryID; - final String? countryName; + String? countryName; final int? cityId; final dynamic? cityName; final String? branchName; diff --git a/lib/pages/settings/branch/branch_detail_page.dart b/lib/pages/settings/branch/branch_detail_page.dart index 17521b3..267faa1 100644 --- a/lib/pages/settings/branch/branch_detail_page.dart +++ b/lib/pages/settings/branch/branch_detail_page.dart @@ -33,7 +33,6 @@ class _BranchDetailPageState extends State { // TODO: implement initState super.initState(); widget.branchData.serviceProviderServices!.forEach((element) { - categories.add( new CategoryData( id: element.categoryId, @@ -75,7 +74,7 @@ class _BranchDetailPageState extends State { Row( children: [ Expanded( - child: titleWidget(icons + "ic_branchs.svg", "Branch Info"), + child: titleWidget(icons + "ic_branchs.svg", LocaleKeys.branchInfo), ), IconButton( onPressed: () { @@ -90,11 +89,11 @@ class _BranchDetailPageState extends State { 8.height, Column( children: [ - showData("Country:", widget.branchData.countryID.toString()), - showData("City", widget.branchData.cityId.toString()), - showData("Branch Name:", widget.branchData.branchName.toString()), - showData("Branch Description:", widget.branchData.branchDescription.toString()), - showData("Address:", widget.branchData.address.toString()), + showData(LocaleKeys.country.tr() + ":", widget.branchData.countryName.toString()), + showData(LocaleKeys.city.tr() + ":", widget.branchData.cityName.toString()), + showData(LocaleKeys.branchName.tr() + ":", widget.branchData.branchName.toString()), + showData(LocaleKeys.branchDescription.tr() + ":", widget.branchData.branchDescription.toString()), + showData(LocaleKeys.address.tr() + ":", widget.branchData.address.toString()), ], ), Container( @@ -115,7 +114,11 @@ class _BranchDetailPageState extends State { ListView.builder( itemBuilder: (context, index) { return Container( - child: ("- " + categories[pIndex].services![index].serviceName.toString()).toText14(), + child: ("- " + + (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" + ? categories[pIndex].services![index].serviceNameN.toString() + : categories[pIndex].services![index].serviceName.toString())) + .toText14(), ); }, itemCount: categories[pIndex].services?.length, @@ -142,7 +145,7 @@ class _BranchDetailPageState extends State { Padding( padding: const EdgeInsets.all(12.0), child: ShowFillButton( - title: "Edit Services", + title: LocaleKeys.editServices, maxWidth: double.infinity, onPressed: () { navigateWithName( diff --git a/lib/pages/settings/branch/branch_list_page.dart b/lib/pages/settings/branch/branch_list_page.dart index 4449f56..1d6215c 100644 --- a/lib/pages/settings/branch/branch_list_page.dart +++ b/lib/pages/settings/branch/branch_list_page.dart @@ -85,7 +85,7 @@ class _BranchListPageState extends State { Row( children: [ Icon( - Icons.place, + Icons.place, size: 12, color: MyColors.darkPrimaryColor, ), @@ -143,7 +143,8 @@ class _BranchListPageState extends State { ).toContainer().onPress(() async { // await navigateWithName(context, AppRoutes.defineBranch, arguments: snapshot.data!.data![index]); // setState(() {}); - snapshot.data!.data!.serviceProviderBranch![index].countryID=snapshot.data!.data!.countryID; + snapshot.data!.data!.serviceProviderBranch![index].countryID = snapshot.data!.data!.countryID; + snapshot.data!.data!.serviceProviderBranch![index].countryName = snapshot.data!.data!.countryName; await navigateWithName(context, AppRoutes.branchDetail, arguments: snapshot.data!.data!.serviceProviderBranch![index]); setState(() {}); }); diff --git a/lib/pages/settings/branch/define_branch_page.dart b/lib/pages/settings/branch/define_branch_page.dart index 65c71f5..277b7c4 100644 --- a/lib/pages/settings/branch/define_branch_page.dart +++ b/lib/pages/settings/branch/define_branch_page.dart @@ -55,7 +55,7 @@ class _DefineBranchPageState extends State { country = await UserApiClent().getAllCountries(); setState(() { country!.data?.forEach((element) { - if (widget.branchData!.id != null) { + if (widget.branchData != null) if (widget.branchData!.id != null) { if (element.id == widget.branchData!.countryID) { countryValue = new DropValue( element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? (element.countryNameN ?? "") : (element.countryName ?? ""), element.countryCode ?? ""); @@ -64,7 +64,7 @@ class _DefineBranchPageState extends State { countryDropList.add( new DropValue(element.id ?? 0, EasyLocalization.of(context)?.currentLocale?.countryCode == "SA" ? (element.countryNameN ?? "") : (element.countryName ?? ""), element.countryCode ?? "")); }); - if (widget.branchData!.id != null) fetchCites(); + if (widget.branchData != null) if (widget.branchData!.id != null) fetchCites(); }); } @@ -76,7 +76,7 @@ class _DefineBranchPageState extends State { cities = await UserApiClent().getAllCites(countryId.toString()); setState(() { cities!.data?.forEach((element) { - if (widget.branchData!.id != null) { + if (widget.branchData != null) if (widget.branchData!.id != null) { if (element.id == widget.branchData!.cityId) { address = widget.branchData!.address!; branchName = widget.branchData!.branchName!; @@ -237,9 +237,9 @@ class _DefineBranchPageState extends State { child: Padding( padding: const EdgeInsets.only(left: 20, right: 20, bottom: 20), child: ShowFillButton( - title: widget.branchData!.id == null ? LocaleKeys.createBranch.tr() : LocaleKeys.updateBranch.tr(), + title: widget.branchData != null ? (widget.branchData!.id == null ? LocaleKeys.createBranch.tr() : LocaleKeys.updateBranch.tr()) : LocaleKeys.createBranch.tr(), onPressed: () async { - if (widget.branchData!.id == null) { + if (widget.branchData == null) { Utils.showLoading(context); MResponse res = await BranchApiClent().createBranch(branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString()); Utils.hideLoading(context); diff --git a/lib/pages/settings/define_license_page.dart b/lib/pages/settings/define_license_page.dart index e5780b7..4dd88ae 100644 --- a/lib/pages/settings/define_license_page.dart +++ b/lib/pages/settings/define_license_page.dart @@ -130,7 +130,7 @@ class _DefineLicensePageState extends State { ), Padding( padding: const EdgeInsets.only(left: 20, right: 20, top: 4, bottom: 8), - child: "Please enter the detail for commercial records and attach the license images".toText14(color: MyColors.lightTextColor, textAlign: TextAlign.center), + child: LocaleKeys.enter_licence_detail.tr().toText14(color: MyColors.lightTextColor, textAlign: TextAlign.center), ), TxtField( hint: LocaleKeys.description.tr(), diff --git a/resources/langs/ar-SA.json b/resources/langs/ar-SA.json index 06c0c75..1c2ec45 100644 --- a/resources/langs/ar-SA.json +++ b/resources/langs/ar-SA.json @@ -34,21 +34,21 @@ "change": "تغيير", "verifyAccount": "التحقق من الحساب", "login": "تسجيل دخول", - "log_in": "Log In", + "log_in": "تسجيل الدخول", "welcomeMessage": "مرحبا", - "welcomeDes": "You one stop place all your car needs", + "welcomeDes": "أنت مكان واحد لكل ما تحتاجه سيارتك", "forgetPass": "نسيت كلمة المرور ؟", "enterPhoneNumber": "رقم جوال ", "phoneNumberVerified": "تم التحقق من الجوال", "verifyNewPassword": "التحقق من كلمة المرور", "EnterPass": "ادخل كلمة المرور", - "send": "Send", - "retrivePassword": "Retrive password by one of following method", - "retriveOnPhone": "We will send the opt to your registered mobile number", - "retriveOnEmail": "We will send the opt to your registered email address", - "enterPhoneForVerfication": "Please enter your phone number We will send you the verification code", - "selectYourCountry": "Select Your Country", - "welcomeBack": "Welcome Back!!!", + "send": "إرسال", + "retrivePassword": "استرجع كلمة المرور بإحدى الطرق التالية", + "retriveOnPhone": "سوف نرسل الاختيار إلى رقم هاتفك المحمول المسجل", + "retriveOnEmail": "سوف نرسل الاختيار إلى عنوان بريدك الإلكتروني المسجل", + "enterPhoneForVerfication": "الرجاء إدخال رقم هاتفك وسنرسل لك رمز التحقق", + "selectYourCountry": "اختر بلدك", + "welcomeBack": "مرحبًا بعودتك!!!", "alreadySigned": " تم تسجيل الدخول", "emailChangedSuccessfully": "تم تغيير الايميل بنجاح", "passwordIsUpdated": "تم تحجيث كلمة المرور", @@ -164,10 +164,14 @@ "remove": "إزالة", "no_branch": "لم يتم إضافة فرع حتى الآن", "login_once": "الرجاء تسجيل الدخول مرة واحدة", - "defineLicenese": "Upload Licenses and Certificates", - "description": "Description", - "attachFile": "Attach File", - "branchLocation": "Branch info and Location", - "tapToEdit": "Tap to edit", - "myServiceBranches": "My Service Branches" + "defineLicenese": "تحميل التراخيص والشهادات", + "description": "وصف", + "attachFile": "أرفق ملف", + "branchLocation": "معلومات الفرع والموقع", + "tapToEdit": "انقر للتعديل", + "myServiceBranches": "فروع خدمتي", + "enter_licence_detail": "الرجاء إدخال تفاصيل السجلات التجارية وإرفاق صور الترخيص", + "country": "بلد", + "city": "مدينة", + "editServices": "تحرير الخدمات" } diff --git a/resources/langs/en-US.json b/resources/langs/en-US.json index 7434e10..a78a2a5 100644 --- a/resources/langs/en-US.json +++ b/resources/langs/en-US.json @@ -169,5 +169,9 @@ "attachFile": "Attach File", "branchLocation": "Branch info and Location", "tapToEdit": "Tap to edit", - "myServiceBranches": "My Service Branches" + "myServiceBranches": "My Service Branches", + "enter_licence_detail": "Please enter the detail for commercial records and attach the license images", + "country": "country", + "city": "city", + "editServices": "Edit Services" }