|
|
|
|
@ -50,7 +50,7 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
itemBuilder: (cxt, index) => _buildChecklistItem(context, widget.checklistItems[index]),
|
|
|
|
|
separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
|
|
|
|
|
separatorBuilder: (cxt, index) => const Divider(height: 1, color: AppColor.neutral30, thickness: 1).paddingOnly(top: 16, bottom: 16),
|
|
|
|
|
itemCount: widget.checklistItems.length)
|
|
|
|
|
.toShadowContainer(context, padding: 16),
|
|
|
|
|
16.height,
|
|
|
|
|
@ -66,13 +66,63 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
ListTileTheme(
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AbsorbPointer(
|
|
|
|
|
absorbing: true,
|
|
|
|
|
child: Transform.scale(
|
|
|
|
|
scale: 1.2,
|
|
|
|
|
child: Checkbox(
|
|
|
|
|
value: item.isChecked,
|
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
|
side: BorderSide(color: Colors.black.withValues(alpha: .05)),
|
|
|
|
|
visualDensity: const VisualDensity(horizontal: -4.0, vertical: -4.0),
|
|
|
|
|
activeColor: AppColor.primary10,
|
|
|
|
|
onChanged: (bool? value) {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
10.width,
|
|
|
|
|
RichText(
|
|
|
|
|
text: TextSpan(
|
|
|
|
|
children: [
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: item.title,
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(
|
|
|
|
|
color: context.isDark ? AppColor.neutral10 : AppColor.neutral120,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (item.isMandatory)
|
|
|
|
|
TextSpan(
|
|
|
|
|
text: ' *',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).expanded,
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
setState(() {
|
|
|
|
|
item.isChecked = !item.isChecked;
|
|
|
|
|
if (!item.isChecked) {
|
|
|
|
|
item.commentController.clear();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
widget.onChecklistChanged?.call(widget.checklistItems);
|
|
|
|
|
}),
|
|
|
|
|
/* ListTileTheme(
|
|
|
|
|
horizontalTitleGap: 0,
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
minVerticalPadding: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
height: 50.toScreenHeight,
|
|
|
|
|
color: Colors.amberAccent,
|
|
|
|
|
child: CheckboxListTile(
|
|
|
|
|
value: item.isChecked,
|
|
|
|
|
minVerticalPadding: 0,
|
|
|
|
|
controlAffinity: ListTileControlAffinity.leading,
|
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
@ -108,14 +158,13 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
|
|
|
|
|
item.commentController.clear();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// Notify parent of changes
|
|
|
|
|
widget.onChecklistChanged?.call(widget.checklistItems);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),*/
|
|
|
|
|
if (item.isChecked) ...[
|
|
|
|
|
// 16.height,
|
|
|
|
|
12.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: item.commentController,
|
|
|
|
|
labelText: context.translation.comment,
|
|
|
|
|
@ -128,7 +177,6 @@ class _CleanerChecklistWidgetState extends State<CleanerChecklistWidget> {
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
item.comment = value;
|
|
|
|
|
// Notify parent of changes
|
|
|
|
|
widget.onChecklistChanged?.call(widget.checklistItems);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|