|
|
|
|
@ -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),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|