|
|
|
@ -27,23 +27,26 @@ class CommonAppointmentSliderWidget extends StatelessWidget {
|
|
|
|
|
Widget getCarouselSliderWidget(AppType appType, AppointmentsVM appointmentsVM) {
|
|
|
|
|
return CarouselSlider.builder(
|
|
|
|
|
options: CarouselOptions(
|
|
|
|
|
height: appType == AppType.provider ? 121 : 140,
|
|
|
|
|
viewportFraction: 0.99999, // Todo: Dont do anything
|
|
|
|
|
height: appType == AppType.provider ? 121 : 96,
|
|
|
|
|
viewportFraction: 1,
|
|
|
|
|
pageSnapping: true,
|
|
|
|
|
enlargeCenterPage: false,
|
|
|
|
|
enableInfiniteScroll: false,
|
|
|
|
|
),
|
|
|
|
|
itemCount: appointmentsVM.myUpComingAppointments.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => BuildAppointmentContainerForCustomer(
|
|
|
|
|
isForProvider: appType == AppType.provider,
|
|
|
|
|
appointmentListModel: appointmentsVM.myUpComingAppointments[itemIndex],
|
|
|
|
|
onTapped: () {
|
|
|
|
|
if (appType == AppType.provider) {
|
|
|
|
|
onAppointmentClick!(appointmentsVM.myUpComingAppointments[itemIndex]);
|
|
|
|
|
} else {
|
|
|
|
|
navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentsVM.myUpComingAppointments[itemIndex]);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) =>
|
|
|
|
|
BuildAppointmentContainerForCustomer(
|
|
|
|
|
isForProvider: appType == AppType.provider,
|
|
|
|
|
isForCustomerHome: true,
|
|
|
|
|
appointmentListModel: appointmentsVM.myUpComingAppointments[itemIndex],
|
|
|
|
|
onTapped: () {
|
|
|
|
|
if (appType == AppType.provider) {
|
|
|
|
|
onAppointmentClick!(appointmentsVM.myUpComingAppointments[itemIndex]);
|
|
|
|
|
} else {
|
|
|
|
|
navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentsVM.myUpComingAppointments[itemIndex]);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -142,10 +145,11 @@ class CommonAppointmentSliderWidget extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
final bool isForProvider;
|
|
|
|
|
final bool isForCustomerHome;
|
|
|
|
|
final AppointmentListModel? appointmentListModel;
|
|
|
|
|
final Function()? onTapped;
|
|
|
|
|
|
|
|
|
|
const BuildAppointmentContainerForCustomer({Key? key, this.isForProvider = false, this.onTapped, required this.appointmentListModel}) : super(key: key);
|
|
|
|
|
const BuildAppointmentContainerForCustomer({Key? key, this.isForProvider = false, this.onTapped, required this.appointmentListModel, this.isForCustomerHome = false}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
Widget showServices(String title, String icon, {bool isMoreText = false}) {
|
|
|
|
|
return Row(
|
|
|
|
@ -181,7 +185,7 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
List<Widget> servicesList = List.generate(
|
|
|
|
|
2,
|
|
|
|
|
(index) => showServices(appointmentListModel.appointmentServicesList![index].providerServiceDescription, MyAssets.modificationsIcon),
|
|
|
|
|
(index) => showServices(appointmentListModel.appointmentServicesList![index].providerServiceDescription, MyAssets.modificationsIcon),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (appointmentListModel.appointmentServicesList!.length > 1) {
|
|
|
|
@ -204,22 +208,26 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
isForProvider // need to be updated through backend
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Image.asset(
|
|
|
|
|
MyAssets.bnCar,
|
|
|
|
|
width: 46,
|
|
|
|
|
height: 46,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
MyAssets.bnCar,
|
|
|
|
|
width: isForCustomerHome ? 46 : 77,
|
|
|
|
|
height: isForCustomerHome ? 46 : 113,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
).toCircle(
|
|
|
|
|
borderRadius: isForCustomerHome ? 100 : 0,
|
|
|
|
|
),
|
|
|
|
|
8.width,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
(AppState().currentAppType == AppType.provider ? appointmentListModel!.branchName ?? "" : appointmentListModel!.branchName ?? "")
|
|
|
|
|
.toText(color: MyColors.greyColor, fontSize: 12, letterSpacing: 0, height: 19 / 12),
|
|
|
|
|
(AppState().currentAppType == AppType.provider ? appointmentListModel!.customerName ?? "" : appointmentListModel!.branchName ?? "")
|
|
|
|
|
.toText(color: MyColors.black, fontSize: 16, letterSpacing: -0.64, height: 24 / 16),
|
|
|
|
|
Row(
|
|
|
|
|
AppState().currentAppType == AppType.provider ? (AppState().currentAppType == AppType.provider ? appointmentListModel!.branchName ?? "" : appointmentListModel!.branchName ?? "")
|
|
|
|
|
.toText(color: MyColors.greyColor, fontSize: 12, letterSpacing: 0, height: 19 / 12) : SizedBox(),
|
|
|
|
|
|
|
|
|
|
(AppState().currentAppType == AppType.provider ? appointmentListModel!.providerName ?? "" : appointmentListModel!.branchName ?? "")
|
|
|
|
|
.toText(color: MyColors.black, fontSize: 16, letterSpacing: -0.64, height: 24 / 16)
|
|
|
|
|
|
|
|
|
|
, Row(
|
|
|
|
|
children: [
|
|
|
|
|
!isForProvider ? MyAssets.miniClock.buildSvg(height: 12) : SizedBox(),
|
|
|
|
|
2.width,
|
|
|
|
@ -230,45 +238,45 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
8.height,
|
|
|
|
|
!isForProvider
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.appointment_details.tr().toText(
|
|
|
|
|
color: MyColors.primaryColor,
|
|
|
|
|
isUnderLine: true,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
),
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
MyAssets.arrowRight,
|
|
|
|
|
height: 9.69,
|
|
|
|
|
width: 13,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.appointment_details.tr().toText(
|
|
|
|
|
color: MyColors.primaryColor,
|
|
|
|
|
isUnderLine: true,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
),
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
MyAssets.arrowRight,
|
|
|
|
|
height: 9.69,
|
|
|
|
|
width: 13,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
//ic_arrow_right.svg
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
MyAssets.arrowRight,
|
|
|
|
|
height: 9.69,
|
|
|
|
|
width: 13,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
//ic_arrow_right.svg
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
MyAssets.arrowRight,
|
|
|
|
|
height: 9.69,
|
|
|
|
|
width: 13,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).onPress(onTapped!).toWhiteContainer(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
allPading: 12,
|
|
|
|
|
);
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
allPading: 12,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|