Checklists
Checklists render interactive task items with clickable checkboxes, keyboard toggle support, nested sub-tasks, and customizable checkbox indicator visuals.
- Included in:
notesConfiguration,documentConfiguration - Pure-Dart import:
package:vyuh_document_elements/checklist.dartorpackage:vyuh_document_elements/vyuh_document_elements.dart - Flutter extension:
ChecklistDocumentExtension(bundled inDocumentEditorElements.defaults) - Action namespace:
ChecklistActions
Quick example
dart
import 'package:vyuh_document/vyuh_document.dart';
import 'package:vyuh_document_elements/vyuh_document_elements.dart';
final doc = Document.of(notesConfiguration, [
Task('Review API surface', checked: true),
Task('Publish 0.89.1 cohort', checked: false),
]);What you can configure
| Property | Type / Values | Purpose |
|---|---|---|
checked | bool | Completion state toggled by clicking the indicator or running ToggleChecked |
level | int (0+) | Sub-task nesting depth (Tab / Shift+Tab) |
listId | String | Groups sibling tasks into one logical checklist |
presentation | ChecklistPresentation(indicatorStyle:) | Selects ChecklistIndicatorStyle visual treatment for the checkbox glyph |
paragraphFormat | ParagraphFormat | Spacing, line height, alignment, and indentation |
Actions & commands
| Action ID | Effect |
|---|---|
ChecklistActions.insert | Convert current block into a checklist or insert a new checklist |
ChecklistActions.insertItem | Insert a sibling task item |
- Typed command:
ToggleCheckedtogglescheckedcanonically through history so undo/redo restores checkbox state cleanly. - Markdown input rule: Typing
[]or[x]at the start of a line creates an unchecked or checked task item.
Restricting usage
- Remove checklists:
notesConfiguration.withoutElements([Task.element]) - Read-only checklists: In
DocumentInteractionMode.readOnly, checkboxes cannot mutate document state unless explicitly permitted by policy.
Format parity
| DOCX | HTML | Markdown | |
|---|---|---|---|
| Checkbox symbols / list items with completion state | Crisp vector checkbox glyphs (checked/unchecked) | <ul data-type="taskList"> with <input type="checkbox"> | GFM task lists (- [ ] / - [x]) |