pm checklist data fix

main_design2.0
Sikander Saleem 2 years ago
parent f6ea56d907
commit eadf74d54e

@ -25,7 +25,8 @@ class _PentryPMChecklistFormState extends State<PentryPMChecklistForm> {
@override
Widget build(BuildContext context) {
final list = widget.models?.where((element) => element.task != null)?.toList();
final list =
widget.models?.where((element) => element.task != null)?.toList();
return (list?.isEmpty ?? true)
? context.translation.noDataFound.heading5(context).center
: ListView.builder(
@ -45,45 +46,60 @@ class _PentryPMChecklistFormState extends State<PentryPMChecklistForm> {
}
setState(() {});
},
subtitle: showLabel.isNotEmpty && showLabel.contains(index) ? null : "${context.translation.status} ${list[index].taskStatusName}".bodyText(context),
iconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
collapsedIconColor: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
childrenPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
subtitle: showLabel.isNotEmpty && showLabel.contains(index)
? null
: "${context.translation.status} ${list[index].taskStatusName}"
.bodyText(context),
iconColor:
context.isDark ? AppColor.neutral30 : AppColor.neutral50,
collapsedIconColor:
context.isDark ? AppColor.neutral30 : AppColor.neutral50,
childrenPadding: EdgeInsets.symmetric(
horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
children: [
if (showLabel.isNotEmpty && showLabel.contains(index))
SingleItemDropDownMenu<Lookup, PpmChecklistStatusProvider>(
SingleItemDropDownMenu<Lookup,
PpmChecklistStatusProvider>(
context: context,
backgroundColor: context.isDark ? AppColor.neutral50 : null,
initialValue: list[index].taskStatusId == null ? null : Lookup(id: list[index].taskStatusId, name: list[index].taskStatusName),
backgroundColor:
context.isDark ? AppColor.neutral50 : null,
initialValue: list[index].taskStatusId == null
? null
: Lookup(
id: list[index].taskStatusId,
name: list[index].taskStatusName),
title: context.translation.status,
onSelect: (value) {
if(value!=null) {
if (value != null) {
list[index].taskStatusId = value.id;
list[index].taskStatusName = value.name;
}
},
),
if (showLabel.isNotEmpty && showLabel.contains(index)) 8.height,
if (showLabel.isNotEmpty && showLabel.contains(index))
8.height,
AppTextFormField(
labelText: context.translation.measuredValue,
initialValue: list[index].measuredValue,
// enable: false,
backgroundColor: context.isDark ? AppColor.neutral20 : null,
// enable: false,
backgroundColor:
context.isDark ? AppColor.neutral20 : null,
// backgroundColor: context.isDark ? AppColor.neutral50 : null,
// onChange: (text) {
// list[index].measuredValue = text;
// },
onChange: (text) {
list[index].measuredValue = text;
},
),
8.height,
AppTextFormField(
labelText: context.translation.comment,
initialValue: list[index].taskComment,
// enable: false,
backgroundColor: context.isDark ? AppColor.neutral20 : null,
// enable: false,
backgroundColor:
context.isDark ? AppColor.neutral20 : null,
// backgroundColor: context.isDark ? AppColor.neutral50 : null,
// onChange: (text) {
// list[index].taskComment = text;
// },
onChange: (text) {
list[index].taskComment = text;
},
),
8.height,
],

Loading…
Cancel
Save