Skip to content

Commit

Permalink
chore: remove todolist validation and set checked as false by default (
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 authored Sep 11, 2024
1 parent c3c7005 commit 14ea32a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ class TodoListBlockComponentBuilder extends BlockComponentBuilder {

@override
bool validate(Node node) {
return node.delta != null &&
node.attributes[TodoListBlockKeys.checked] is bool;
return node.delta != null;
}
}

Expand Down Expand Up @@ -135,7 +134,8 @@ class _TodoListBlockComponentWidgetState
@override
Node get node => widget.node;

bool get checked => widget.node.attributes[TodoListBlockKeys.checked];
bool get checked =>
widget.node.attributes[TodoListBlockKeys.checked] ?? false;

@override
Widget buildComponent(
Expand Down

0 comments on commit 14ea32a

Please sign in to comment.