Quick Fixes

aamir_dev
Faiz Hashmi 9 months ago
parent 0ed41736b2
commit 14024def24

@ -333,7 +333,6 @@ class _AddNewServiceAppointmentPageState extends State<AddNewServiceAppointmentP
return; return;
} }
} }
try { try {
Utils.showLoading(context); Utils.showLoading(context);
GenericRespModel res = await serviceVM!.addNewServiceInAppointment(postParams); GenericRespModel res = await serviceVM!.addNewServiceInAppointment(postParams);

@ -116,38 +116,36 @@ class _AppointmentPageState extends State<AppointmentPage> {
Center(child: CircularProgressIndicator()), Center(child: CircularProgressIndicator()),
], ],
), ),
] else ] else ...[
...[ if (appointmentsVM.myFilteredAppointmentsForProvider.isEmpty)
if (appointmentsVM.myFilteredAppointmentsForProvider.isEmpty) EmptyWidget(
EmptyWidget( spacerWidget: const SizedBox(height: 25),
spacerWidget: const SizedBox(height: 25), text: LocaleKeys.noAppointmentFound.tr(),
text: LocaleKeys.noAppointmentFound.tr(), )
) else ...[
else ListView.separated(
...[ itemBuilder: (context, index) {
ListView.separated( return GeneralAppointmentWidget(
itemBuilder: (context, index) { isNeedToShowItems: true,
return GeneralAppointmentWidget( appointmentListModel: appointmentsVM.myFilteredAppointmentsForProvider[index],
isNeedToShowItems: true, isNeedTotalPayment: false,
appointmentListModel: appointmentsVM.myFilteredAppointmentsForProvider[index], onTap: () {
isNeedTotalPayment: false, appointmentsVM.selectedAppointmentIndex = index;
onTap: () { navigateWithName(
appointmentsVM.selectedAppointmentIndex = index; context,
navigateWithName( AppRoutes.appointmentDetailList,
context,
AppRoutes.appointmentDetailList,
);
},
); );
}, },
separatorBuilder: (context, snapchat) => 21.height, );
itemCount: appointmentsVM.myFilteredAppointmentsForProvider.length, },
physics: const NeverScrollableScrollPhysics(), separatorBuilder: (context, snapchat) => 21.height,
shrinkWrap: true, itemCount: appointmentsVM.myFilteredAppointmentsForProvider.length,
padding: const EdgeInsets.all(21), physics: const NeverScrollableScrollPhysics(),
), shrinkWrap: true,
], padding: const EdgeInsets.all(21),
),
], ],
],
], ],
), ),
), ),
@ -171,9 +169,9 @@ class _AppointmentPageState extends State<AppointmentPage> {
children: [ children: [
Expanded( Expanded(
child: LocaleKeys.slotsOverview.tr().toText( child: LocaleKeys.slotsOverview.tr().toText(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
Row( Row(
children: [ children: [
@ -195,7 +193,7 @@ class _AppointmentPageState extends State<AppointmentPage> {
), ),
) )
.onPress( .onPress(
() async { () async {
String date = await Utils.pickDateFromDatePicker(context, firstDate: DateTime(2023)); String date = await Utils.pickDateFromDatePicker(context, firstDate: DateTime(2023));
appointmentsVM.selectedDateForAppointments = date; appointmentsVM.selectedDateForAppointments = date;
await appointmentsVM.getAppointmentSlotsInfo(branchID: widget.branch.id!); await appointmentsVM.getAppointmentSlotsInfo(branchID: widget.branch.id!);
@ -223,10 +221,10 @@ class _AppointmentPageState extends State<AppointmentPage> {
color: Colors.white, color: Colors.white,
), ),
(appointmentsVM.appointmentSlots?.emptySlots ?? 0).toString().toText( (appointmentsVM.appointmentSlots?.emptySlots ?? 0).toString().toText(
fontSize: 9, fontSize: 9,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
), ),
], ],
).toContainer( ).toContainer(
backgroundColor: MyColors.darkIconColor, backgroundColor: MyColors.darkIconColor,
@ -245,10 +243,10 @@ class _AppointmentPageState extends State<AppointmentPage> {
color: Colors.white, color: Colors.white,
), ),
(appointmentsVM.appointmentSlots?.occupiedSlots ?? 0).toString().toText( (appointmentsVM.appointmentSlots?.occupiedSlots ?? 0).toString().toText(
fontSize: 9, fontSize: 9,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
), ),
], ],
).toContainer( ).toContainer(
backgroundColor: MyColors.darkIconColor, backgroundColor: MyColors.darkIconColor,
@ -264,13 +262,13 @@ class _AppointmentPageState extends State<AppointmentPage> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
LocaleKeys.totalSlots.tr().toText( LocaleKeys.totalSlots.tr().toText(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
(appointmentsVM.appointmentSlots?.totalSlots ?? 0).toString().toText( (appointmentsVM.appointmentSlots?.totalSlots ?? 0).toString().toText(
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
], ],
), ),
backgroundColor: MyColors.lightGreyEAColor, backgroundColor: MyColors.lightGreyEAColor,

@ -47,7 +47,6 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
int? serviceId = -1; int? serviceId = -1;
DropValue? category; DropValue? category;
DropValue? service; DropValue? service;
bool isEditDisabled = false; bool isEditDisabled = false;
bool isServiceActive = false; bool isServiceActive = false;

@ -54,7 +54,7 @@ class GeneralAppointmentWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
showServices( showServices(
"${appointmentListModel.appointmentServicesList!.first.providerServiceDescription} - ${appointmentListModel.appointmentServicesList!.first.serviceId}", "${appointmentListModel.appointmentServicesList!.first.providerServiceName} ${appointmentListModel.appointmentServicesList!.first.serviceId != 0 ? '- ${appointmentListModel.appointmentServicesList!.first.serviceId}' : ""}",
MyAssets.modificationsIcon, MyAssets.modificationsIcon,
), ),
if (isNeedToShowItems) ...itemsList, if (isNeedToShowItems) ...itemsList,
@ -77,7 +77,9 @@ class GeneralAppointmentWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
showServices( showServices(
"${appointmentListModel.appointmentServicesList![index].providerServiceDescription} - ${appointmentListModel.appointmentServicesList![index].serviceId}", MyAssets.modificationsIcon), "${appointmentListModel.appointmentServicesList![index].providerServiceName} ${appointmentListModel.appointmentServicesList![index].serviceId != 0 ? '- ${appointmentListModel.appointmentServicesList![index].serviceId}' : ""}",
MyAssets.modificationsIcon,
),
if (isNeedToShowItems) ...itemsList, if (isNeedToShowItems) ...itemsList,
], ],
).paddingOnly(bottom: 6); ).paddingOnly(bottom: 6);

@ -28,9 +28,9 @@ class ServiceProviderWidget extends StatelessWidget {
return const Center(child: CircularProgressIndicator()); return const Center(child: CircularProgressIndicator());
} else { } else {
return serviceVM.branches == null || serviceVM.branches!.data == null return serviceVM.branches == null || serviceVM.branches!.data == null
? Center(child: LocaleKeys.noBranchFound.tr().toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium)) ? Center(child: LocaleKeys.noBranchFound.tr().toText(fontSize: 16, color: MyColors.lightTextColor))
: serviceVM.homePageBranches.isEmpty : serviceVM.homePageBranches.isEmpty
? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium)) ? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor))
: ListView.builder( : ListView.builder(
itemCount: serviceVM.homePageBranches.length, itemCount: serviceVM.homePageBranches.length,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,

Loading…
Cancel
Save