From 65636ee9566d091c26e56e37e695e1627bc18be2 Mon Sep 17 00:00:00 2001 From: andrei Date: Wed, 3 Nov 2021 18:36:06 -0400 Subject: [PATCH] Editable and lockable text field for item labels --- lib/check_list.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/check_list.dart b/lib/check_list.dart index c66491a..6db6180 100644 --- a/lib/check_list.dart +++ b/lib/check_list.dart @@ -75,7 +75,16 @@ class _CheckList extends State { itemBuilder: (context, index) { return Card( 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, value: list[index].value, onChanged: