diff --git a/lib/src/widgets/raw_editor.dart b/lib/src/widgets/raw_editor.dart index c2df6395..e7f7ff5c 100644 --- a/lib/src/widgets/raw_editor.dart +++ b/lib/src/widgets/raw_editor.dart @@ -764,6 +764,7 @@ class RawEditorState extends EditorState // https://github.com/singerdmx/flutter-quill/issues/619 // We cannot treat {"list": "checked"} and {"list": "unchecked"} as // block of the same style + // This causes controller.selection to go to offset 0 bool _disableScrollControllerAnimateOnce = false; void _showCaretOnScreen() { diff --git a/lib/src/widgets/toolbar/toggle_check_list_button.dart b/lib/src/widgets/toolbar/toggle_check_list_button.dart index ed24a84d..cf52ff00 100644 --- a/lib/src/widgets/toolbar/toggle_check_list_button.dart +++ b/lib/src/widgets/toolbar/toggle_check_list_button.dart @@ -55,15 +55,13 @@ class _ToggleCheckListButtonState extends State { } bool _getIsToggled(Map attrs) { - if (widget.attribute.key == Attribute.list.key) { - final attribute = attrs[widget.attribute.key]; - if (attribute == null) { - return false; - } - return attribute.value == widget.attribute.value || - attribute.value == Attribute.checked.value; + final attribute = attrs[Attribute.list.key]; + + if (attribute == null) { + return false; } - return attrs.containsKey(widget.attribute.key); + return attribute.value == Attribute.unchecked.value || + attribute.value == Attribute.checked.value; } @override