master_new_changes
Aamir 1 year ago
parent f5a71aa15b
commit 36754b524d

@ -40,7 +40,7 @@
"forgetPass": "Forget Password ?", "forgetPass": "Forget Password ?",
"phoneNumberVerified": "Phone Number Verified", "phoneNumberVerified": "Phone Number Verified",
"verifyNewPassword": "Verify New Password", "verifyNewPassword": "Verify New Password",
"EnterPass": "Enter Password ?", "EnterPass": "Enter Password",
"alreadySigned": " Already Signed Up and Logged In", "alreadySigned": " Already Signed Up and Logged In",
"emailChangedSuccessfully": "Email is Changed Successfully", "emailChangedSuccessfully": "Email is Changed Successfully",
"passwordIsUpdated": "Password is Updated", "passwordIsUpdated": "Password is Updated",

@ -690,7 +690,7 @@ static const Map<String,dynamic> en_US = {
"forgetPass": "Forget Password ?", "forgetPass": "Forget Password ?",
"phoneNumberVerified": "Phone Number Verified", "phoneNumberVerified": "Phone Number Verified",
"verifyNewPassword": "Verify New Password", "verifyNewPassword": "Verify New Password",
"EnterPass": "Enter Password ?", "EnterPass": "Enter Password",
"alreadySigned": " Already Signed Up and Logged In", "alreadySigned": " Already Signed Up and Logged In",
"emailChangedSuccessfully": "Email is Changed Successfully", "emailChangedSuccessfully": "Email is Changed Successfully",
"passwordIsUpdated": "Password is Updated", "passwordIsUpdated": "Password is Updated",

@ -239,7 +239,9 @@ class AppointmentsVM extends BaseVM {
} }
void removeServiceInCurrentAppointment(int index) { void removeServiceInCurrentAppointment(int index) {
int serviceId = servicesInCurrentAppointment.elementAt(index).serviceProviderServiceId ?? -1; int serviceId = servicesInCurrentAppointment
.elementAt(index)
.serviceProviderServiceId ?? -1;
allSelectedItemsInAppointments.removeWhere((element) => element.serviceProviderServiceId == serviceId); allSelectedItemsInAppointments.removeWhere((element) => element.serviceProviderServiceId == serviceId);
servicesInCurrentAppointment.removeAt(index); servicesInCurrentAppointment.removeAt(index);
notifyListeners(); notifyListeners();
@ -360,7 +362,8 @@ class AppointmentsVM extends BaseVM {
myAppointments = await appointmentRepo.getMyAppointmentsForCustomersByFilters(); myAppointments = await appointmentRepo.getMyAppointmentsForCustomersByFilters();
// myFilteredAppointments = myAppointments; // myFilteredAppointments = myAppointments;
myUpComingAppointments = myAppointments.where((element) => element.appointmentStatusEnum == AppointmentStatusEnum.booked || element.appointmentStatusEnum == AppointmentStatusEnum.confirmed).toList(); myUpComingAppointments =
myAppointments.where((element) => element.appointmentStatusEnum == AppointmentStatusEnum.booked || element.appointmentStatusEnum == AppointmentStatusEnum.confirmed).toList();
setState(ViewState.idle); setState(ViewState.idle);
applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments); applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments);
notifyListeners(); notifyListeners();
@ -431,7 +434,8 @@ class AppointmentsVM extends BaseVM {
bool inNeedToEnableMergeButton = false; bool inNeedToEnableMergeButton = false;
updateCheckBoxInMergeRequest(int currentIndex) { updateCheckBoxInMergeRequest(int currentIndex) {
myFilteredAppointments2[selectedAppointmentIndex].customerAppointmentList![currentIndex].isSelected = !(myFilteredAppointments2[selectedAppointmentIndex].customerAppointmentList?[currentIndex].isSelected ?? false); myFilteredAppointments2[selectedAppointmentIndex].customerAppointmentList![currentIndex].isSelected =
!(myFilteredAppointments2[selectedAppointmentIndex].customerAppointmentList?[currentIndex].isSelected ?? false);
int count = countSelected(myFilteredAppointments2[selectedAppointmentIndex].customerAppointmentList ?? []); int count = countSelected(myFilteredAppointments2[selectedAppointmentIndex].customerAppointmentList ?? []);
if (count > 1) if (count > 1)
@ -442,7 +446,10 @@ class AppointmentsVM extends BaseVM {
} }
int countSelected(List<AppointmentListModel> appointments) { int countSelected(List<AppointmentListModel> appointments) {
return appointments.where((appointment) => appointment.isSelected == true).toList().length; return appointments
.where((appointment) => appointment.isSelected == true)
.toList()
.length;
} }
updateSelectedAppointmentDate({required int dateIndex, required int scheduleIndex}) { updateSelectedAppointmentDate({required int dateIndex, required int scheduleIndex}) {
@ -500,7 +507,8 @@ class AppointmentsVM extends BaseVM {
for (var element in allSelectedItemsInAppointments) { for (var element in allSelectedItemsInAppointments) {
if (!ifItemAlreadySelected(element.id!)) { if (!ifItemAlreadySelected(element.id!)) {
servicesInCurrentAppointment[serviceIndex].serviceItems!.add(serviceItemsFromApi[index]); servicesInCurrentAppointment[serviceIndex].serviceItems!.add(serviceItemsFromApi[index]);
servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice = servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice + double.parse((serviceItemsFromApi[index].price) ?? "0.0"); servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice =
servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice + double.parse((serviceItemsFromApi[index].price) ?? "0.0");
} }
} }
} }
@ -508,7 +516,8 @@ class AppointmentsVM extends BaseVM {
selectedSubServicesCounter = selectedSubServicesCounter - 1; selectedSubServicesCounter = selectedSubServicesCounter - 1;
currentServiceSelection!.serviceItems!.removeWhere((element) => element.id == itemId); currentServiceSelection!.serviceItems!.removeWhere((element) => element.id == itemId);
allSelectedItemsInAppointments.removeWhere((element) => element.id == itemId); allSelectedItemsInAppointments.removeWhere((element) => element.id == itemId);
servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice = servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice - double.parse((serviceItemsFromApi[index].price) ?? "0.0"); servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice =
servicesInCurrentAppointment[serviceIndex].currentTotalServicePrice - double.parse((serviceItemsFromApi[index].price) ?? "0.0");
servicesInCurrentAppointment[serviceIndex].serviceItems!.removeWhere((element) => element.id == itemId); servicesInCurrentAppointment[serviceIndex].serviceItems!.removeWhere((element) => element.id == itemId);
} }
notifyListeners(); notifyListeners();
@ -608,13 +617,14 @@ class AppointmentsVM extends BaseVM {
Column( Column(
children: List.generate( children: List.generate(
selectedService.serviceItems!.length, selectedService.serviceItems!.length,
(index) => Row( (index) =>
mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
"${selectedService.serviceItems![index].name}".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), children: [
"${selectedService.serviceItems![index].price} SAR".toText(fontSize: 12, isBold: true), "${selectedService.serviceItems![index].name}".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
], "${selectedService.serviceItems![index].price} SAR".toText(fontSize: 12, isBold: true),
), ],
),
), ),
), ),
Row( Row(
@ -649,7 +659,8 @@ class AppointmentsVM extends BaseVM {
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
(selectedService.isHomeSelected ? "${(selectedService.currentTotalServicePrice) + (double.parse((selectedService.rangePricePerKm ?? "0.0")) * totalKms)}" : "${selectedService.currentTotalServicePrice}") (selectedService.isHomeSelected ? "${(selectedService.currentTotalServicePrice) + (double.parse((selectedService.rangePricePerKm ?? "0.0")) * totalKms)}" : "${selectedService
.currentTotalServicePrice}")
.toText(fontSize: 29, isBold: true), .toText(fontSize: 29, isBold: true),
2.width, 2.width,
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5),
@ -1073,10 +1084,10 @@ class AppointmentsVM extends BaseVM {
DropValue( DropValue(
element.id ?? 0, element.id ?? 0,
((element.categoryName!.isEmpty ((element.categoryName!.isEmpty
? "N/A" ? "N/A"
: countryCode == "SA" : countryCode == "SA"
? element.categoryNameN ? element.categoryNameN
: element.categoryName) ?? : element.categoryName) ??
"N/A"), "N/A"),
""), ""),
); );
@ -1491,4 +1502,11 @@ class AppointmentsVM extends BaseVM {
} }
setState(ViewState.idle); setState(ViewState.idle);
} }
bool isShowMergeButton() {
return myFilteredAppointments2[selectedAppointmentIndex]
.customerAppointmentList!
.every((appointment) => appointment.appointmentStatusEnum == AppointmentStatusEnum.confirmed);
}
} }

@ -29,13 +29,13 @@ class _ForgetPasswordPageState extends State<ForgetPasswordPage> {
ClassType type = ClassType.EMAIL; ClassType type = ClassType.EMAIL;
Country? _country; Country? _country;
String countryCode = ""; String countryCode = "";
DropValue? tempCountry;
late UserVM userVM; late UserVM userVM;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
scheduleMicrotask(() { scheduleMicrotask(() {
userVM = Provider.of(context, listen: false); userVM = Provider.of(context, listen: false);
getCountryList(); getCountryList();
@ -142,8 +142,12 @@ class _ForgetPasswordPageState extends State<ForgetPasswordPage> {
); );
return Padding( return Padding(
padding: const EdgeInsets.all(2.0), padding: const EdgeInsets.all(2.0),
child: DropdownField((DropValue value) { child: DropdownField( dropdownValue: tempCountry ,(DropValue value) {
countryCode = value.subValue; countryCode = value.subValue;
tempCountry = value;
setState(() {
});
}, list: dropList, hint: LocaleKeys.selectCountryCode.tr()), }, list: dropList, hint: LocaleKeys.selectCountryCode.tr()),
); );
} else { } else {

@ -35,7 +35,7 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
//TODO: ONLY FOR DEVELOPMENT PURPOSE //TODO: ONLY FOR DEVELOPMENT PURPOSE
// String phoneNum = "966504278212", password = "Fa@1234"; // String phoneNum = "966504278212", password = "Fa@1234";
// String phoneNum = "966504278213", password = "Fa@1234"; // String phoneNum = "966504278213", password = "Fa@1234";
String phoneNum = "966504278213", password = "Fa@1234"; String phoneNum = "", password = "";
String email = ""; String email = "";
String countryCode = ""; String countryCode = "";
Country? _country; Country? _country;
@ -48,23 +48,23 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
scheduleMicrotask(() { scheduleMicrotask(() {
userVM = Provider.of(context, listen: false); userVM = Provider.of(context, listen: false);
context.read<UserVM>().getAvailBio(); context.read<UserVM>().getAvailBio();
if (AppState().currentAppType == AppType.provider) { // if (AppState().currentAppType == AppType.provider) {
phoneNum = "966530896018"; // phoneNum = "966530896018";
password = "Amir@1234"; // password = "Amir@1234";
//
// phoneNum = "966569755630"; // // phoneNum = "966569755630";
// password = "Amir12345@"; //AAmir Sal // // password = "Amir12345@"; //AAmir Sal
//
// phoneNum = "966598646795"; // // phoneNum = "966598646795";
// password = "Zahoor@123"; // // password = "Zahoor@123";
//
// User Details // // User Details
// phoneNum = "966554870506"; // // phoneNum = "966554870506";
// password = "Sikander123@"; // "lastName": "sik", // // password = "Sikander123@"; // "lastName": "sik",
// "email": "sikander@gmail.com", // // "email": "sikander@gmail.com",
// phoneNum = "966569755630"; // // phoneNum = "966569755630";
// password = "Amir12345@"; // // password = "Amir12345@";
} // }
getCountryList(); getCountryList();
}); });
@ -78,7 +78,7 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: const CustomAppBar(isRemoveBackButton: true, title: ""), appBar: const CustomAppBar(isRemoveBackButton: true, title: ""),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,

Loading…
Cancel
Save