|
|
|
|
@ -90,59 +90,64 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
|
|
|
|
|
// ),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 350.h,
|
|
|
|
|
child: SfCalendar(
|
|
|
|
|
controller: _calendarController,
|
|
|
|
|
minDate: DateTime.now(),
|
|
|
|
|
showNavigationArrow: true,
|
|
|
|
|
headerHeight: 60.h,
|
|
|
|
|
headerStyle: CalendarHeaderStyle(
|
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
textStyle: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor, fontFamily: "Poppins"),
|
|
|
|
|
),
|
|
|
|
|
viewHeaderStyle: ViewHeaderStyle(
|
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
|
dayTextStyle: TextStyle(fontSize: 14.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor),
|
|
|
|
|
),
|
|
|
|
|
view: CalendarView.month,
|
|
|
|
|
todayHighlightColor: Colors.transparent,
|
|
|
|
|
todayTextStyle: TextStyle(color: AppColors.textColor, fontWeight: FontWeight.bold),
|
|
|
|
|
selectionDecoration: ShapeDecoration(
|
|
|
|
|
color: AppColors.transparent,
|
|
|
|
|
shape: SmoothRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.r),
|
|
|
|
|
smoothness: 1,
|
|
|
|
|
side: BorderSide(color: AppColors.primaryRedColor, width: 1.5),
|
|
|
|
|
child: Localizations.override(
|
|
|
|
|
context: context,
|
|
|
|
|
locale: const Locale('en'),
|
|
|
|
|
child: SfCalendar(
|
|
|
|
|
controller: _calendarController,
|
|
|
|
|
minDate: DateTime.now(),
|
|
|
|
|
showNavigationArrow: true,
|
|
|
|
|
headerHeight: 60.h,
|
|
|
|
|
headerStyle: CalendarHeaderStyle(
|
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
textStyle: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor, fontFamily: "Poppins"),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
cellBorderColor: AppColors.transparent,
|
|
|
|
|
dataSource: MeetingDataSource(_getDataSource()),
|
|
|
|
|
monthCellBuilder: (context, details) => Padding(
|
|
|
|
|
padding: EdgeInsets.all(12.h),
|
|
|
|
|
child: details.date.day.toString().toText14(
|
|
|
|
|
isCenter: true,
|
|
|
|
|
color: details.date == _calendarController.selectedDate ? AppColors.primaryRedColor : AppColors.textColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
monthViewSettings: MonthViewSettings(
|
|
|
|
|
dayFormat: "EEE",
|
|
|
|
|
appointmentDisplayMode: MonthAppointmentDisplayMode.indicator,
|
|
|
|
|
showTrailingAndLeadingDates: false,
|
|
|
|
|
appointmentDisplayCount: 1,
|
|
|
|
|
monthCellStyle: MonthCellStyle(
|
|
|
|
|
textStyle: TextStyle(fontSize: 19.f),
|
|
|
|
|
viewHeaderStyle: ViewHeaderStyle(
|
|
|
|
|
backgroundColor: AppColors.scaffoldBgColor,
|
|
|
|
|
dayTextStyle: TextStyle(fontSize: 14.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor, fontFamily: "Poppins"),
|
|
|
|
|
),
|
|
|
|
|
view: CalendarView.month,
|
|
|
|
|
todayHighlightColor: Colors.transparent,
|
|
|
|
|
todayTextStyle: TextStyle(color: AppColors.textColor, fontWeight: FontWeight.bold, fontFamily: "Poppins"),
|
|
|
|
|
selectionDecoration: ShapeDecoration(
|
|
|
|
|
color: AppColors.transparent,
|
|
|
|
|
shape: SmoothRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10.r),
|
|
|
|
|
smoothness: 1,
|
|
|
|
|
side: BorderSide(color: AppColors.primaryRedColor, width: 1.5),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
cellBorderColor: AppColors.transparent,
|
|
|
|
|
dataSource: MeetingDataSource(_getDataSource()),
|
|
|
|
|
monthCellBuilder: (context, details) => Padding(
|
|
|
|
|
padding: EdgeInsets.all(12.h),
|
|
|
|
|
child: details.date.day.toString().toText14(
|
|
|
|
|
isCenter: true,
|
|
|
|
|
color: details.date == _calendarController.selectedDate ? AppColors.primaryRedColor : AppColors.textColor,
|
|
|
|
|
isEnglishOnly: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
monthViewSettings: MonthViewSettings(
|
|
|
|
|
dayFormat: "EEE",
|
|
|
|
|
appointmentDisplayMode: MonthAppointmentDisplayMode.indicator,
|
|
|
|
|
showTrailingAndLeadingDates: false,
|
|
|
|
|
appointmentDisplayCount: 1,
|
|
|
|
|
monthCellStyle: MonthCellStyle(
|
|
|
|
|
textStyle: TextStyle(fontSize: 19.f),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: (CalendarTapDetails details) {
|
|
|
|
|
_calendarController.selectedDate = details.date;
|
|
|
|
|
_onDaySelected(details.date!);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
onTap: (CalendarTapDetails details) {
|
|
|
|
|
_calendarController.selectedDate = details.date;
|
|
|
|
|
_onDaySelected(details.date!);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10.h),
|
|
|
|
|
Transform.translate(
|
|
|
|
|
offset: const Offset(0.0, -10.0),
|
|
|
|
|
child: selectedDateDisplay.toText16(weight: FontWeight.w500),
|
|
|
|
|
child: selectedDateDisplay.toText16(weight: FontWeight.w500, isEnglishOnly: true),
|
|
|
|
|
),
|
|
|
|
|
//TODO: Add Next Day Span here
|
|
|
|
|
dayEvents.isNotEmpty
|
|
|
|
|
@ -153,23 +158,23 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
|
|
|
|
|
child: Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
alignment: WrapAlignment.start,
|
|
|
|
|
spacing: 6.h,
|
|
|
|
|
runSpacing: 6.h,
|
|
|
|
|
children: List.generate(
|
|
|
|
|
dayEvents.length, // Generate a large number of items to ensure scrolling
|
|
|
|
|
(index) => TimeSlotChip(
|
|
|
|
|
label: dayEvents[index].isoTime!,
|
|
|
|
|
isSelected: index == selectedButtonIndex,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedButtonIndex = index;
|
|
|
|
|
selectedTime = dayEvents[index].isoTime!;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
spacing: 6.h,
|
|
|
|
|
runSpacing: 6.h,
|
|
|
|
|
children: List.generate(
|
|
|
|
|
dayEvents.length, // Generate a large number of items to ensure scrolling
|
|
|
|
|
(index) => TimeSlotChip(
|
|
|
|
|
label: dayEvents[index].isoTime!,
|
|
|
|
|
isSelected: index == selectedButtonIndex,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedButtonIndex = index;
|
|
|
|
|
selectedTime = dayEvents[index].isoTime!;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Utils.getNoDataWidget(context, noDataText: LocaleKeys.noFreeSlot.tr(context: context)),
|
|
|
|
|
|
|
|
|
|
@ -179,7 +184,7 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
|
|
|
|
|
isDisabled: dayEvents.isEmpty,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (appState.isAuthenticated) {
|
|
|
|
|
if(selectedTime == LocaleKeys.waitingAppointment.tr(context: context)){
|
|
|
|
|
if (selectedTime == LocaleKeys.waitingAppointment.tr(context: context)) {
|
|
|
|
|
bookAppointmentsViewModel.setWaitingAppointmentProjectID(bookAppointmentsViewModel.selectedDoctor.projectID!);
|
|
|
|
|
bookAppointmentsViewModel.setWaitingAppointmentDoctor(bookAppointmentsViewModel.selectedDoctor);
|
|
|
|
|
|
|
|
|
|
@ -351,26 +356,20 @@ class TimeSlotChip extends StatelessWidget {
|
|
|
|
|
side: BorderSide(color: isSelected ? AppColors.warningColorYellow : AppColors.borderOnlyColor.withOpacity(0.2), width: 1),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: label.toText12(
|
|
|
|
|
color: isSelected ? AppColors.whiteColor : Colors.black87,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
child: label.toText12(color: isSelected ? AppColors.whiteColor : Colors.black87, fontWeight: FontWeight.w500, isEnglishOnly: true),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 14.h, vertical: 8.h),
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
shape: SmoothRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8.h),
|
|
|
|
|
smoothness: 1,
|
|
|
|
|
side: BorderSide(color: isSelected ? AppColors.primaryRedColor : AppColors.borderOnlyColor.withOpacity(0.2), width: 1),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: label.toText12(
|
|
|
|
|
color: isSelected ? AppColors.primaryRedColor : AppColors.textColor,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
shape: SmoothRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8.h),
|
|
|
|
|
smoothness: 1,
|
|
|
|
|
side: BorderSide(color: isSelected ? AppColors.primaryRedColor : AppColors.borderOnlyColor.withOpacity(0.2), width: 1),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: label.toText12(color: isSelected ? AppColors.primaryRedColor : AppColors.textColor, fontWeight: FontWeight.w500, isEnglishOnly: true),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|