improvements.

cleaner_module_new_flow
Sikander Saleem 2 months ago
parent 8d60f4c81e
commit d242b190ce

@ -165,7 +165,11 @@ class _CleanerSearchDetailsViewState extends State<CleanerSearchDetailsView> {
if (isValid) {
if (mounted) {
getInitialData();
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => RecurrentWorkOrderView(taskId: widget.requestId)),
);
// getInitialData();
}
}
}

@ -45,8 +45,15 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
),
),
16.height,
...widget.checklistItems.map((item) => _buildChecklistItem(context, item)).toList(),
// 16.height,
ListView.separated(
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (cxt, index) => _buildChecklistItem(context, widget.checklistItems[index]),
separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
itemCount: widget.checklistItems.length)
.toShadowContainer(context, padding: 16),
16.height,
_buildImageCaptureWidget(context),
],
);
@ -59,28 +66,21 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
// Checkbox with title
Row(
children: [
Checkbox(
// visualDensity: const VisualDensity(horizontal: -4.0, vertical: -4.0),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
ListTileTheme(
horizontalTitleGap: 0,
child: Container(
alignment: Alignment.center,
height: 50.toScreenHeight,
child: CheckboxListTile(
value: item.isChecked,
controlAffinity: ListTileControlAffinity.leading,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
contentPadding: EdgeInsets.zero,
checkboxScaleFactor: 1.2,
side: BorderSide(color: Colors.black.withValues(alpha: .05)),
visualDensity: const VisualDensity(horizontal: -0.0, vertical: -4.0),
activeColor: AppColor.primary10,
onChanged: (bool? value) {
setState(() {
item.isChecked = value ?? false;
if (!item.isChecked) {
item.commentController.clear();
}
});
// Notify parent of changes
widget.onChecklistChanged?.call(widget.checklistItems);
},
),
8.width,
Expanded(
child: RichText(
title: RichText(
text: TextSpan(
children: [
TextSpan(
@ -101,13 +101,21 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
],
),
),
onChanged: (bool? value) {
setState(() {
item.isChecked = value ?? false;
if (!item.isChecked) {
item.commentController.clear();
}
});
// Notify parent of changes
widget.onChecklistChanged?.call(widget.checklistItems);
},
),
],
),
),
// Comment box - only visible when checked
if (item.isChecked) ...[
16.height,
// 16.height,
AppTextFormField(
controller: item.commentController,
labelText: context.translation.comment,
@ -126,7 +134,7 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
),
],
],
).toShadowContainer(context).paddingOnly(bottom: 16),
),
);
}

@ -19,8 +19,9 @@ import 'package:test_sa/views/widgets/total_working_time_detail_bottomsheet.dart
class RecurrentTaskInfoWidget extends StatefulWidget {
final RecurrentWoData? model;
bool isClosed;
bool isHouseKeeper;
RecurrentTaskInfoWidget({super.key, required this.model, this.isClosed = false});
RecurrentTaskInfoWidget({super.key, required this.model, this.isClosed = false, this.isHouseKeeper = false});
@override
State<RecurrentTaskInfoWidget> createState() => _RecurrentTaskInfoWidgetState();
@ -81,6 +82,11 @@ class _RecurrentTaskInfoWidgetState extends State<RecurrentTaskInfoWidget> {
'${context.translation.taskNo}: ${widget.model!.taskNo!}'.bodyText2(context).custom(color: AppColor.neutral120),
'Plan Name: ${widget.model?.planRecurrent?.planName ?? "-"}'.bodyText2(context).custom(color: AppColor.neutral120),
'${context.translation.site}: ${widget.model!.site!.siteName!}'.bodyText2(context).custom(color: AppColor.neutral120),
if (widget.isHouseKeeper) ...[
'${context.translation.department}: ${widget.model!.department?.name ?? "-"}'.bodyText2(context).custom(color: AppColor.neutral120),
'${context.translation.floor}: ${widget.model!.floor?.name ?? "-"}'.bodyText2(context).custom(color: AppColor.neutral120),
'${context.translation.room}: ${widget.model!.room?.name ?? "-"}'.bodyText2(context).custom(color: AppColor.neutral120),
],
'${context.translation.assignedEmployee}: ${widget.model!.engineer!.userName ?? ""}'.bodyText2(context).custom(color: AppColor.neutral120),
'${context.translation.scheduledDate}: ${widget.model!.scheduleDate!.toMonthYearFormat}'.bodyText2(context).custom(color: AppColor.neutral120),
],
@ -91,16 +97,20 @@ class _RecurrentTaskInfoWidgetState extends State<RecurrentTaskInfoWidget> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildingInfoWidget(label: context.translation.department, value: widget.model!.department?.name?.cleanupWhitespace.capitalizeFirstOfEach, context: context)
.ignorePointer(widget.isClosed),
8.height,
buildingInfoWidget(label: context.translation.floor, value: widget.model!.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach, context: context).ignorePointer(widget.isClosed),
8.height,
buildingInfoWidget(label: context.translation.room, value: widget.model!.room?.name?.cleanupWhitespace.capitalizeFirstOfEach, context: context).ignorePointer(widget.isClosed),
8.height,
if (!widget.isHouseKeeper) ...[
buildingInfoWidget(label: context.translation.department, value: widget.model!.department?.name?.cleanupWhitespace.capitalizeFirstOfEach, context: context)
.ignorePointer(widget.isClosed),
8.height,
buildingInfoWidget(label: context.translation.floor, value: widget.model!.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach, context: context).ignorePointer(widget.isClosed),
8.height,
buildingInfoWidget(label: context.translation.room, value: widget.model!.room?.name?.cleanupWhitespace.capitalizeFirstOfEach, context: context).ignorePointer(widget.isClosed),
8.height,
],
_timerWidget(context, totalWorkingHours),
8.height,
_commentWidget(context: context, model: widget.model).ignorePointer(widget.isClosed),
if (!widget.isHouseKeeper) ...[
8.height,
_commentWidget(context: context, model: widget.model).ignorePointer(widget.isClosed),
],
],
// ],
).toShadowContainer(context, padding: 12)

@ -56,6 +56,7 @@ class _RecurrentWorkOrderViewState extends State<RecurrentWorkOrderView> {
Widget build(BuildContext context) {
return Consumer<AllRequestsProvider>(builder: (context, requestProvider, child) {
isClosed = requestProvider.recurrentWoData?.status?.value == 1;
bool isHouseKeeper = requestProvider.recurrentWoData!.planRecurrentTaskCheckLists != null && requestProvider.recurrentWoData!.planRecurrentTaskCheckLists!.isNotEmpty;
return Scaffold(
appBar: DefaultAppBar(
title: context.translation.recurrentWo,
@ -77,7 +78,7 @@ class _RecurrentWorkOrderViewState extends State<RecurrentWorkOrderView> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RecurrentTaskInfoWidget(isClosed: isClosed,model: requestProvider.recurrentWoData),
RecurrentTaskInfoWidget(isClosed: isClosed, model: requestProvider.recurrentWoData, isHouseKeeper: isHouseKeeper),
IgnorePointer(
ignoring: isClosed,
child: requestProvider.recurrentWoData!.planRecurrentMedicalTaskRooms != null && requestProvider.recurrentWoData!.planRecurrentMedicalTaskRooms!.isNotEmpty
@ -90,7 +91,7 @@ class _RecurrentWorkOrderViewState extends State<RecurrentWorkOrderView> {
: const SizedBox(),
),
16.height,
requestProvider.recurrentWoData!.planRecurrentTaskCheckLists != null && requestProvider.recurrentWoData!.planRecurrentTaskCheckLists!.isNotEmpty
isHouseKeeper
? CleanerChecklistWidget(
isClosed: isClosed,
checklistItems: requestProvider.recurrentWoData!.planRecurrentTaskCheckLists ?? [],

Loading…
Cancel
Save