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