|
|
|
|
@ -17,6 +17,7 @@ import 'package:mc_common_app/view_models/dashboard_view_model_customer.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/custom_add_button_widget.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:sizer/sizer.dart';
|
|
|
|
|
|
|
|
|
|
class CommonAppointmentSliderWidget extends StatelessWidget {
|
|
|
|
|
final Function(AppointmentListModel)? onAppointmentClick;
|
|
|
|
|
@ -26,14 +27,14 @@ class CommonAppointmentSliderWidget extends StatelessWidget {
|
|
|
|
|
Widget getCarouselSliderWidget(AppType appType, AppointmentsVM appointmentsVM) {
|
|
|
|
|
return CarouselSlider.builder(
|
|
|
|
|
options: CarouselOptions(
|
|
|
|
|
height: appType == AppType.provider ? 110 : 140,
|
|
|
|
|
viewportFraction: 1.0,
|
|
|
|
|
height: appType == AppType.provider ? 121 : 140,
|
|
|
|
|
viewportFraction: 0.99999, // Todo: Dont do anything
|
|
|
|
|
enlargeCenterPage: false,
|
|
|
|
|
enableInfiniteScroll: false,
|
|
|
|
|
),
|
|
|
|
|
itemCount: appointmentsVM.myUpComingAppointments.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => BuildAppointmentContainerForCustomer(
|
|
|
|
|
isForHome: appType == AppType.provider,
|
|
|
|
|
isForProvider: appType == AppType.provider,
|
|
|
|
|
appointmentListModel: appointmentsVM.myUpComingAppointments[itemIndex],
|
|
|
|
|
onTapped: () {
|
|
|
|
|
if (appType == AppType.provider) {
|
|
|
|
|
@ -140,11 +141,11 @@ class CommonAppointmentSliderWidget extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
final bool? isForHome;
|
|
|
|
|
final bool isForProvider;
|
|
|
|
|
final AppointmentListModel? appointmentListModel;
|
|
|
|
|
final Function()? onTapped;
|
|
|
|
|
|
|
|
|
|
const BuildAppointmentContainerForCustomer({Key? key, this.isForHome = false, this.onTapped, required this.appointmentListModel}) : super(key: key);
|
|
|
|
|
const BuildAppointmentContainerForCustomer({Key? key, this.isForProvider = false, this.onTapped, required this.appointmentListModel}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
Widget showServices(String title, String icon, {bool isMoreText = false}) {
|
|
|
|
|
return Row(
|
|
|
|
|
@ -156,7 +157,7 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
Flexible(
|
|
|
|
|
child: title.toText(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isBold: true,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
color: isMoreText ? MyColors.primaryColor : MyColors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -197,78 +198,77 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
return Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
isForProvider // need to be updated through backend
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Image.asset(
|
|
|
|
|
MyAssets.bnCar,
|
|
|
|
|
width: 46,
|
|
|
|
|
height: 46,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
8.width,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
isForHome != null && isForHome!
|
|
|
|
|
? Image.asset(
|
|
|
|
|
MyAssets.bnCar,
|
|
|
|
|
width: 56,
|
|
|
|
|
height: 56,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
).toCircle(borderRadius: 100)
|
|
|
|
|
: Image.asset(
|
|
|
|
|
MyAssets.bnCar,
|
|
|
|
|
width: 80,
|
|
|
|
|
height: 85,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
8.width,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
(AppState().currentAppType == AppType.provider ? appointmentListModel!.customerName ?? "" : appointmentListModel!.branchName ?? "").toText(color: MyColors.black, isBold: true, fontSize: 16),
|
|
|
|
|
Row(
|
|
|
|
|
(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(
|
|
|
|
|
children: [
|
|
|
|
|
!isForProvider ? MyAssets.miniClock.buildSvg(height: 12) : SizedBox(),
|
|
|
|
|
2.width,
|
|
|
|
|
"${isForProvider ? "Appt. on:" : ""} ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}"
|
|
|
|
|
.toText(color: MyColors.lightTextColor, fontSize: 12, letterSpacing: -0.48, height: 19 / 12),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
!isForProvider
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
MyAssets.miniClock.buildSvg(height: 12),
|
|
|
|
|
2.width,
|
|
|
|
|
"${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}".toText(
|
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
LocaleKeys.appointment_details.tr().toText(
|
|
|
|
|
color: MyColors.primaryColor,
|
|
|
|
|
isUnderLine: true,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
),
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
MyAssets.arrowRight,
|
|
|
|
|
height: 9.69,
|
|
|
|
|
width: 13,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
9.height,
|
|
|
|
|
isForHome != null && isForHome!
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"Appointment Details".toText(
|
|
|
|
|
color: MyColors.primaryColor,
|
|
|
|
|
isUnderLine: true,
|
|
|
|
|
isBold: true,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
const Icon(Icons.arrow_forward),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: 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,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).onPress(onTapped!).toWhiteContainer(width: double.infinity, allPading: 12),
|
|
|
|
|
);
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).onPress(onTapped!).toWhiteContainer(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
allPading: 12,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|