diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart index 580ebe6c5e..e8a0406e0f 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/board_cell.dart @@ -14,33 +14,37 @@ class EditableCellNotifier { } class EditableRowNotifier { - Map cells = {}; + final Map _cells = {}; void insertCell( GridCellIdentifier cellIdentifier, EditableCellNotifier notifier, ) { - cells[EditableCellId.from(cellIdentifier)] = notifier; + _cells[EditableCellId.from(cellIdentifier)] = notifier; } void becomeFirstResponder() { - for (final notifier in cells.values) { + for (final notifier in _cells.values) { notifier.becomeFirstResponder.notify(); } } void resignFirstResponder() { - for (final notifier in cells.values) { + for (final notifier in _cells.values) { notifier.resignFirstResponder.notify(); } } + void clear() { + _cells.clear(); + } + void dispose() { - for (final notifier in cells.values) { + for (final notifier in _cells.values) { notifier.resignFirstResponder.notify(); } - cells.clear(); + _cells.clear(); } } diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart index 924faef0a5..9d5aefd9bc 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/card.dart @@ -89,20 +89,20 @@ class _BoardCardState extends State { List cells, ) { final List children = []; + rowNotifier.clear(); cells.asMap().forEach( (int index, GridCellIdentifier cellId) { final cellNotifier = EditableCellNotifier(); Widget child = widget.cellBuilder.buildCell( widget.groupId, cellId, - widget.isEditing, + index == 0 ? widget.isEditing : false, cellNotifier, ); if (index == 0) { rowNotifier.insertCell(cellId, cellNotifier); } - child = Padding( key: cellId.key(), padding: const EdgeInsets.only(left: 4, right: 4),