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

Loading…
Cancel
Save