FixedThings Before QA

aamir_dev
Faiz Hashmi 1 year ago
parent e2f10aba52
commit fea3c806ec

@ -667,5 +667,9 @@
"itemPrice": "سعر العنصر", "itemPrice": "سعر العنصر",
"appointmentBookingOption": "سيسمح هذا الخيار للعميل بحجز موعد لهذه الخدمات.", "appointmentBookingOption": "سيسمح هذا الخيار للعميل بحجز موعد لهذه الخدمات.",
"workshopAvailabilityOption": "سيظهر هذا الخيار للعميل إذا كان يمكنه الحصول على هذه الخدمة في الورشة أم لا.", "workshopAvailabilityOption": "سيظهر هذا الخيار للعميل إذا كان يمكنه الحصول على هذه الخدمة في الورشة أم لا.",
"appointmentLocationOption": "سيسمح هذا الخيار للعميل بحجز موعد في الموقع الذي يختاره." "appointmentLocationOption": "سيسمح هذا الخيار للعميل بحجز موعد في الموقع الذي يختاره.",
"deleteScheduleConfirmation": "هل أنت متأكد أنك تريد حذف هذا الجدول؟",
"deleteScheduleAdConfirmationMessage": "سيتم إزالة جميع فترات المواعيد ولن يتمكن العملاء من حجز مواعيد لهذا الجدول.",
"branchSchedules": "جداول الفرع",
"noSchedulesFound": "لم تقم بإضافة أي جدول لهذا الفرع."
} }

@ -668,5 +668,9 @@
"itemPrice": "Item Price", "itemPrice": "Item Price",
"bookAppointmentForServices": "This option will allow customer to book appointment for these services.", "bookAppointmentForServices": "This option will allow customer to book appointment for these services.",
"showServiceAvailability": "This option will show to customer that you can avail this service on workshop or not.", "showServiceAvailability": "This option will show to customer that you can avail this service on workshop or not.",
"bookAppointmentAtLocation": "This option will allow customer to book appointment at their desired location." "bookAppointmentAtLocation": "This option will allow customer to book appointment at their desired location.",
"deleteScheduleConfirmation": " Are you sure you want to delete this Schedule?",
"deleteScheduleAdConfirmationMessage": "All the appointment slots will be removed and customers will no longer be able to book appointments for this schedule.",
"branchSchedules": "Branch Schedules",
"noSchedulesFound": "You have not added any schedule for this branch."
} }

@ -683,7 +683,11 @@ class CodegenLoader extends AssetLoader{
"itemPrice": "سعر العنصر", "itemPrice": "سعر العنصر",
"appointmentBookingOption": "سيسمح هذا الخيار للعميل بحجز موعد لهذه الخدمات.", "appointmentBookingOption": "سيسمح هذا الخيار للعميل بحجز موعد لهذه الخدمات.",
"workshopAvailabilityOption": "سيظهر هذا الخيار للعميل إذا كان يمكنه الحصول على هذه الخدمة في الورشة أم لا.", "workshopAvailabilityOption": "سيظهر هذا الخيار للعميل إذا كان يمكنه الحصول على هذه الخدمة في الورشة أم لا.",
"appointmentLocationOption": "سيسمح هذا الخيار للعميل بحجز موعد في الموقع الذي يختاره." "appointmentLocationOption": "سيسمح هذا الخيار للعميل بحجز موعد في الموقع الذي يختاره.",
"deleteScheduleConfirmation": "هل أنت متأكد أنك تريد حذف هذا الجدول؟",
"deleteScheduleAdConfirmationMessage": "سيتم إزالة جميع فترات المواعيد ولن يتمكن العملاء من حجز مواعيد لهذا الجدول.",
"branchSchedules": "جداول الفرع",
"noSchedulesFound": "لم تقم بإضافة أي جدول لهذا الفرع."
}; };
static const Map<String,dynamic> en_US = { static const Map<String,dynamic> en_US = {
"firstTimeLogIn": "First Time Log In", "firstTimeLogIn": "First Time Log In",
@ -1355,7 +1359,11 @@ static const Map<String,dynamic> en_US = {
"itemPrice": "Item Price", "itemPrice": "Item Price",
"bookAppointmentForServices": "This option will allow customer to book appointment for these services.", "bookAppointmentForServices": "This option will allow customer to book appointment for these services.",
"showServiceAvailability": "This option will show to customer that you can avail this service on workshop or not.", "showServiceAvailability": "This option will show to customer that you can avail this service on workshop or not.",
"bookAppointmentAtLocation": "This option will allow customer to book appointment at their desired location." "bookAppointmentAtLocation": "This option will allow customer to book appointment at their desired location.",
"deleteScheduleConfirmation": " Are you sure you want to delete this Schedule?",
"deleteScheduleAdConfirmationMessage": "All the appointment slots will be removed and customers will no longer be able to book appointments for this schedule.",
"branchSchedules": "Branch Schedules",
"noSchedulesFound": "You have not added any schedule for this branch."
}; };
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
} }

@ -1,6 +1,6 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
abstract class LocaleKeys { abstract class LocaleKeys {
static const firstTimeLogIn = 'firstTimeLogIn'; static const firstTimeLogIn = 'firstTimeLogIn';
static const signUp = 'signUp'; static const signUp = 'signUp';
static const changeMobile = 'changeMobile'; static const changeMobile = 'changeMobile';
@ -47,7 +47,7 @@ abstract class LocaleKeys {
static const emailChangedSuccessfully = 'emailChangedSuccessfully'; static const emailChangedSuccessfully = 'emailChangedSuccessfully';
static const passwordIsUpdated = 'passwordIsUpdated'; static const passwordIsUpdated = 'passwordIsUpdated';
static const passwordShouldContains = 'passwordShouldContains'; static const passwordShouldContains = 'passwordShouldContains';
static const successfullyRegistered = ' successfullyRegistered'; static const successfullyRegistered = ' successfullyRegistered';
static const pleaseEnterSamePassword = 'pleaseEnterSamePassword'; static const pleaseEnterSamePassword = 'pleaseEnterSamePassword';
static const firstNameMandatory = 'firstNameMandatory'; static const firstNameMandatory = 'firstNameMandatory';
static const surnameNameMandatory = 'surnameNameMandatory'; static const surnameNameMandatory = 'surnameNameMandatory';
@ -647,5 +647,12 @@ abstract class LocaleKeys {
static const appointmentBookingOption = 'appointmentBookingOption'; static const appointmentBookingOption = 'appointmentBookingOption';
static const workshopAvailabilityOption = 'workshopAvailabilityOption'; static const workshopAvailabilityOption = 'workshopAvailabilityOption';
static const appointmentLocationOption = 'appointmentLocationOption'; static const appointmentLocationOption = 'appointmentLocationOption';
static const deleteScheduleConfirmation = 'deleteScheduleConfirmation';
static const deleteScheduleAdConfirmationMessage = 'deleteScheduleAdConfirmationMessage';
static const branchSchedules = 'branchSchedules';
static const noSchedulesFound = 'noSchedulesFound';
static const bookAppointmentAtLocation = 'bookAppointmentAtLocation';
static const showServiceAvailability = 'showServiceAvailability';
static const bookAppointmentForServices = 'bookAppointmentForServices';
} }

@ -79,7 +79,7 @@ class CommonServicesImp implements CommonAppServices {
final status = await AppPermissions.checkStoragePermissions(context); final status = await AppPermissions.checkStoragePermissions(context);
if (status) { if (status) {
result = await FilePicker.platform.pickFiles(allowMultiple: true, type: fileType, allowedExtensions: allowedExtensions); result = await FilePicker.platform.pickFiles(allowMultiple: false, type: fileType, allowedExtensions: allowedExtensions);
} }
List<File> pickedFiles = []; List<File> pickedFiles = [];
@ -109,6 +109,4 @@ class CommonServicesImp implements CommonAppServices {
return 0.0; return 0.0;
} }
} }
} }

@ -225,6 +225,8 @@ class AppointmentsVM extends BaseVM {
branchSelectedServiceId = id; branchSelectedServiceId = id;
currentServiceSelection = branchServices.firstWhere((element) => element.serviceProviderServiceId == id.selectedId); currentServiceSelection = branchServices.firstWhere((element) => element.serviceProviderServiceId == id.selectedId);
log("currentServiceSelection isAllowAppointmentHome: ${currentServiceSelection!.isAllowAppointmentHome}");
log("currentServiceSelection serviceDescription: ${currentServiceSelection!.serviceDescription}");
notifyListeners(); notifyListeners();
} }

@ -122,7 +122,6 @@ class ServiceVM extends BaseVM {
filterUserBranchCategories() { filterUserBranchCategories() {
categories = []; categories = [];
print("Filter Branch Executed");
List<BranchDetailModel>? localbranches; List<BranchDetailModel>? localbranches;
if (branches!.data != null) { if (branches!.data != null) {
if (selectedBranchStatus == 3) { if (selectedBranchStatus == 3) {
@ -416,6 +415,7 @@ class ServiceVM extends BaseVM {
Future<void> fetchServicesByCategoryId(int categoryId) async { Future<void> fetchServicesByCategoryId(int categoryId) async {
servicesDropList = []; servicesDropList = [];
setState(ViewState.busy); setState(ViewState.busy);
//TODO: here
services = await branchRepo.fetchServicesByCategoryId(serviceCategoryId: categoryId); // to get all the services services = await branchRepo.fetchServicesByCategoryId(serviceCategoryId: categoryId); // to get all the services
for (var element in services!.data!) { for (var element in services!.data!) {
servicesDropList.add( servicesDropList.add(

@ -14,6 +14,7 @@ class PickedFilesContainer extends StatelessWidget {
final bool isReview; final bool isReview;
final bool isPdf; final bool isPdf;
final bool isFromNetwork; final bool isFromNetwork;
final bool allowAdButton;
final Function() onAddFilePressed; final Function() onAddFilePressed;
const PickedFilesContainer({ const PickedFilesContainer({
@ -26,6 +27,7 @@ class PickedFilesContainer extends StatelessWidget {
this.isReview = false, this.isReview = false,
this.isPdf = false, this.isPdf = false,
this.isFromNetwork = false, this.isFromNetwork = false,
this.allowAdButton = true,
}) : super(key: key); }) : super(key: key);
@override @override
@ -37,9 +39,13 @@ class PickedFilesContainer extends StatelessWidget {
crossAxisSpacing: 4.0, crossAxisSpacing: 4.0,
mainAxisSpacing: 8.0, mainAxisSpacing: 8.0,
children: List.generate( children: List.generate(
isReview ? pickedFiles.length : pickedFiles.length + 1, !allowAdButton
? pickedFiles.length
: (isReview)
? pickedFiles.length
: pickedFiles.length + 1,
(index) { (index) {
if (index == pickedFiles.length && !isReview) { if (index == pickedFiles.length && !isReview && allowAdButton) {
return Container( return Container(
decoration: BoxDecoration(color: MyColors.greyButtonColor, border: Border.all(width: 2, color: MyColors.greyAddBorderColor)), decoration: BoxDecoration(color: MyColors.greyButtonColor, border: Border.all(width: 2, color: MyColors.greyAddBorderColor)),
margin: const EdgeInsets.all(8), margin: const EdgeInsets.all(8),
@ -121,22 +127,22 @@ class BuildFilesContainer extends StatelessWidget {
width: 70, width: 70,
) )
.paddingAll(8), .paddingAll(8),
!isReview if (!isReview) ...[
? Align( Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: MyAssets.closeWithOrangeBg.buildSvg( child: MyAssets.closeWithOrangeBg.buildSvg(
fit: BoxFit.fill, fit: BoxFit.fill,
height: 30, height: 30,
width: 30, width: 30,
), ),
).onPress(() { ).onPress(() {
if (onCrossPressedPrimary == null) { if (onCrossPressedPrimary == null) {
onCrossPressedSecondary!(index!, image.filePath!); onCrossPressedSecondary!(index!, image.filePath!);
return; return;
} }
onCrossPressedPrimary!(image.filePath!); onCrossPressedPrimary!(image.filePath!);
}) })
: const SizedBox() ]
], ],
)), )),
], ],

@ -8,6 +8,7 @@ import 'package:mc_common_app/models/general_models/widgets_models.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart';
import 'package:mc_common_app/views/location_views/pick_location_page.dart'; import 'package:mc_common_app/views/location_views/pick_location_page.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart';
@ -94,7 +95,13 @@ class AppointmentServicePickBottomSheet extends StatelessWidget {
maxHeight: 48, maxHeight: 48,
title: LocaleKeys.home.tr(), title: LocaleKeys.home.tr(),
txtColor: appointmentsVM.isHomeTapped ? MyColors.white : MyColors.darkTextColor, txtColor: appointmentsVM.isHomeTapped ? MyColors.white : MyColors.darkTextColor,
onPressed: () => appointmentsVM.updateIsHomeTapped(true), onPressed: () {
if (appointmentsVM.currentServiceSelection != null && (appointmentsVM.currentServiceSelection!.isAllowAppointmentHome ?? false)) {
appointmentsVM.updateIsHomeTapped(true);
} else {
Utils.showToast("The Selected Service is not available at Home Location.");
}
},
), ),
), ),
12.width, 12.width,
@ -116,8 +123,8 @@ class AppointmentServicePickBottomSheet extends StatelessWidget {
errorValue: appointmentsVM.pickHomeLocationError, errorValue: appointmentsVM.pickHomeLocationError,
value: appointmentsVM.pickedHomeLocation, value: appointmentsVM.pickedHomeLocation,
isNeedClickAll: true, isNeedClickAll: true,
postfixData: Icons.location_on, postfixData: Icons.add_location_outlined,
postFixDataColor: MyColors.darkTextColor, postFixDataColor: MyColors.darkPrimaryColor,
onTap: () { onTap: () {
navigateTo( navigateTo(
context, context,
@ -148,14 +155,14 @@ class AppointmentServicePickBottomSheet extends StatelessWidget {
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
if (appointmentsVM.isHomeTapped && !appointmentsVM.isFetchingServices) ...[ if (appointmentsVM.isHomeTapped && !appointmentsVM.isFetchingServices && appointmentsVM.currentServiceSelection != null && (appointmentsVM.currentServiceSelection!.isAllowAppointmentHome ?? false)) ...[
const Divider(thickness: 1, height: 1), const Divider(thickness: 1, height: 1),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
// TODO: This Price will be decided according to the service selected, We will calculate the KMs and multiple it with price per KMs // TODO: This Price will be decided according to the service selected, We will calculate the KMs and multiple it with price per KMs
150.toString().toText(fontSize: 30, isBold: true), appointmentsVM.currentServiceSelection!.rangePricePerKm.toString().toText(fontSize: 30, isBold: true),
LocaleKeys.sar.tr().toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5), "${LocaleKeys.sar.tr()}/km".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
], ],
), ),
LocaleKeys.additionalChargesNotice.tr().toText(fontSize: 12, color: MyColors.lightTextColor), LocaleKeys.additionalChargesNotice.tr().toText(fontSize: 12, color: MyColors.lightTextColor),

@ -1,10 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:sizer/sizer.dart';
class DropValue { class DropValue {
int id; int id;
@ -55,40 +55,43 @@ class _DropdownFieldState extends State<DropdownField> {
dropdownValue = widget.dropdownValue; dropdownValue = widget.dropdownValue;
return Column( return Column(
children: [ children: [
Container( IgnorePointer(
decoration: widget.showAppointmentPickerVariant ? null : Utils.containerColorRadiusBorderWidth(MyColors.white, 0, MyColors.darkPrimaryColor, 2), ignoring: !widget.isSelectAble,
margin: const EdgeInsets.all(0), child: Container(
padding: const EdgeInsets.only(left: 8, right: 8), decoration: widget.showAppointmentPickerVariant ? null : Utils.containerColorRadiusBorderWidth(MyColors.white, 0, widget.isSelectAble ? MyColors.darkPrimaryColor : MyColors.greyACColor, 2),
width: widget.showAppointmentPickerVariant ? 170 : null, margin: const EdgeInsets.all(0),
child: DropdownButton<DropValue>( padding: const EdgeInsets.only(left: 8, right: 8),
value: dropdownValue, width: widget.showAppointmentPickerVariant ? 170 : null,
icon: const Icon(Icons.keyboard_arrow_down_sharp), child: DropdownButton<DropValue>(
elevation: 16, value: dropdownValue,
iconSize: widget.showAppointmentPickerVariant ? 26 : 16, icon: Icon(Icons.keyboard_arrow_down_sharp, color: !widget.isSelectAble ? Colors.transparent : null),
iconEnabledColor: borderColor, elevation: 16,
iconDisabledColor: borderColor, iconSize: widget.showAppointmentPickerVariant ? 26 : 16,
isExpanded: true, iconEnabledColor: borderColor,
style: const TextStyle( iconDisabledColor: borderColor,
color: borderColor, isExpanded: true,
fontSize: 15, style: const TextStyle(
), color: borderColor,
hint: (widget.hint ?? "").toText(color: borderColor, fontSize: 15, fontWeight: MyFonts.Medium), fontSize: 15,
underline: Container(height: 0), ),
onChanged: (DropValue? newValue) { hint: (widget.hint ?? "").toText(color: borderColor, fontSize: 15, fontWeight: MyFonts.Medium),
setState(() { underline: Container(height: 0),
dropdownValue = newValue!; onChanged: (DropValue? newValue) {
widget.onSelect(newValue); setState(() {
}); dropdownValue = newValue!;
}, widget.onSelect(newValue);
items: (widget.list ?? defaultV).map<DropdownMenuItem<DropValue>>( });
(DropValue value) {
return DropdownMenuItem<DropValue>(
value: value,
enabled: value.isEnabled ?? true,
child: value.value.toText(fontSize: 15, color: value.isEnabled == false ? MyColors.darkTextColor : null, fontWeight: MyFonts.Medium),
);
}, },
).toList(), items: (widget.list ?? defaultV).map<DropdownMenuItem<DropValue>>(
(DropValue value) {
return DropdownMenuItem<DropValue>(
value: value,
enabled: value.isEnabled ?? true,
child: value.value.toText(fontSize: 15, color: value.isEnabled == false ? MyColors.darkTextColor : null, fontWeight: MyFonts.Medium),
);
},
).toList(),
),
), ),
), ),
if (widget.errorValue != "") if (widget.errorValue != "")

Loading…
Cancel
Save