Editable and lockable text field for item labels

This commit is contained in:
andrei 2021-11-03 18:36:06 -04:00
parent aac93df46b
commit 65636ee956
1 changed files with 10 additions and 1 deletions

View File

@ -75,7 +75,16 @@ class _CheckList extends State<CheckList> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Card( return Card(
child: CheckboxListTile( child: CheckboxListTile(
title: Text(list[index].text), title: TextFormField(
enabled:
(listData != null && (!listData!.isTemplate! || _editable)),
decoration: InputDecoration(border: InputBorder.none),
initialValue: list[index].text,
onChanged: (value) {
list[index].text = value;
_updateItem(list[index]);
},
),
controlAffinity: ListTileControlAffinity.leading, controlAffinity: ListTileControlAffinity.leading,
value: list[index].value, value: list[index].value,
onChanged: onChanged: