Skip to content

Commit

Permalink
feat: support collapsed list
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jul 17, 2023
1 parent 0249d41 commit 023f3c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';

const indentableBlockTypes = {
'bulleted_list',
'numbered_list',
'todo_list',
'paragraph',
final indentableBlockTypes = {
BulletedListBlockKeys.type,
NumberedListBlockKeys.type,
TodoListBlockKeys.type,
ParagraphBlockKeys.type,
};

/// Indent the current block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ class _DesktopSelectionServiceWidgetState
}
min = min.clamp(start, end);
final node = sortedNodes[min];
if (node.children.isNotEmpty && node.children.first.rect.top <= offset.dy) {
if (node.children.isNotEmpty &&
node.children.first.renderBox != null &&
node.children.first.rect.top <= offset.dy) {
final children = node.children.toList(growable: false);
return _getNodeInOffset(
children,
Expand Down

0 comments on commit 023f3c8

Please sign in to comment.