|
|
|
|
@ -44,6 +44,7 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
padding: const EdgeInsets.only(left: 16,right: 16),
|
|
|
|
|
child: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
@ -55,6 +56,10 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
|
|
|
|
|
calendarFormat: CalendarFormat.week,
|
|
|
|
|
weekendDays: const [],
|
|
|
|
|
onCalendarCreated: (controller) {},
|
|
|
|
|
onPageChanged: (date) {
|
|
|
|
|
_initialDate = date;
|
|
|
|
|
Provider.of<AllRequestsProvider>(context, listen: false).getCalenderRequests(from: date, to: date.add(const Duration(days: 7)));
|
|
|
|
|
},
|
|
|
|
|
calendarBuilders: CalendarBuilders(
|
|
|
|
|
headerTitleBuilder: (context, dateTime) => Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
@ -101,7 +106,7 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
|
|
|
|
|
bool isPPMs = list[index].nameOfType == "PPMs";
|
|
|
|
|
|
|
|
|
|
return isServiceRequest
|
|
|
|
|
? ServiceRequestItemView(list[index])
|
|
|
|
|
? ServiceRequestItemView(list[index], showShadow: false)
|
|
|
|
|
: isGasRefill
|
|
|
|
|
? GasRefillItemView(list[index])
|
|
|
|
|
: isPPMs
|
|
|
|
|
@ -114,34 +119,13 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (cxt, index) => 8.height,
|
|
|
|
|
separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
|
|
|
|
|
itemCount: snapshot.isCalendarLoading ? 6 : snapshot.calendarRequests.requestsDetails.length,
|
|
|
|
|
),
|
|
|
|
|
// TableCalendar(
|
|
|
|
|
// headerVisible: false,
|
|
|
|
|
// calendarFormat: CalendarFormat.week,
|
|
|
|
|
// firstDay: DateTime.utc(2010, 10, 16),
|
|
|
|
|
// lastDay: DateTime.utc(2030, 3, 14),
|
|
|
|
|
// focusedDay: currentDateTime,
|
|
|
|
|
// currentDay: currentDateTime,
|
|
|
|
|
// rowHeight: 37,
|
|
|
|
|
// calendarStyle: CalendarStyle(
|
|
|
|
|
// todayDecoration: cellDecoration(),
|
|
|
|
|
// todayTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
|
|
|
|
|
// selectedTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
|
|
|
|
|
// rangeStartTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
|
|
|
|
|
// rangeEndTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
|
|
|
|
|
// ),
|
|
|
|
|
// daysOfWeekStyle: DaysOfWeekStyle(
|
|
|
|
|
// weekdayStyle: AppTextStyles.bodyText.copyWith(color: AppColor.neutral50),
|
|
|
|
|
// weekendStyle: AppTextStyles.bodyText.copyWith(color: AppColor.neutral50),
|
|
|
|
|
// ),
|
|
|
|
|
// availableGestures: AvailableGestures.none,
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context);
|
|
|
|
|
}),
|
|
|
|
|
).paddingOnly(start: 16, end: 16);
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BoxDecoration cellDecoration({Color color}) => BoxDecoration(color: color ?? Colors.transparent, shape: BoxShape.circle);
|
|
|
|
|
|