Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/pages/editor/editor_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ class _EditorState extends ConsumerState<EditorPage> {
note: note,
isNewNote: widget.isNewNote,
readOnly: readOnly,
// Checking and moving the items is not editing their texts: allow it in the reading mode, but never in
// the bin
toggleable: !currentNote.deleted,
reorderable: !currentNote.deleted,
onChanged: scheduleSave,
);
}
Expand Down
10 changes: 10 additions & 0 deletions lib/pages/editor/widgets/editors/checklist_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class ChecklistEditor extends ConsumerStatefulWidget {
required this.note,
required this.isNewNote,
required this.readOnly,
required this.toggleable,
required this.reorderable,
required this.onChanged,
});

Expand All @@ -24,6 +26,12 @@ class ChecklistEditor extends ConsumerStatefulWidget {
/// Whether the text fields are read only.
final bool readOnly;

/// Whether the checkboxes can be toggled even when the editor is [readOnly] (in the reading mode).
final bool toggleable;

/// Whether the items can be reordered even when the editor is [readOnly] (in the reading mode).
final bool reorderable;

/// Called when the note has changed.
final ValueChanged<Note> onChanged;

Expand All @@ -50,6 +58,8 @@ class _ChecklistEditorState extends ConsumerState<ChecklistEditor> {
child: Checklist(
lines: widget.note.checklistLines,
enabled: !widget.readOnly,
toggleable: widget.toggleable,
reorderable: widget.reorderable,
autofocusFirstLine: widget.isNewNote,
textInputAction: TextInputAction.newline,
textCapitalization: TextCapitalization.sentences,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ packages:
dependency: "direct main"
description:
name: flutter_checklist
sha256: "05535250455c0810db377ee86e34b0065bd039ededf198b726366bf70a8ccee6"
sha256: f3b836bfe8eeefd8222aa8f6170e2f7b57eb004439d22e95e896a627b334e0d9
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.1.0"
flutter_displaymode:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
flex_color_picker: ^3.8.0
flutter:
sdk: flutter
flutter_checklist: ^2.0.0
flutter_checklist: ^2.1.0
flutter_displaymode: ^0.7.0
flutter_expandable_fab: ^2.5.2
flutter_fgbg: ^0.8.0
Expand Down
Loading