File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
frontend/app_flowy/lib/plugins/board/presentation/card Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -14,33 +14,37 @@ class EditableCellNotifier {
1414}
1515
1616class EditableRowNotifier {
17- Map <EditableCellId , EditableCellNotifier > cells = {};
17+ final Map <EditableCellId , EditableCellNotifier > _cells = {};
1818
1919 void insertCell (
2020 GridCellIdentifier cellIdentifier,
2121 EditableCellNotifier notifier,
2222 ) {
23- cells [EditableCellId .from (cellIdentifier)] = notifier;
23+ _cells [EditableCellId .from (cellIdentifier)] = notifier;
2424 }
2525
2626 void becomeFirstResponder () {
27- for (final notifier in cells .values) {
27+ for (final notifier in _cells .values) {
2828 notifier.becomeFirstResponder.notify ();
2929 }
3030 }
3131
3232 void resignFirstResponder () {
33- for (final notifier in cells .values) {
33+ for (final notifier in _cells .values) {
3434 notifier.resignFirstResponder.notify ();
3535 }
3636 }
3737
38+ void clear () {
39+ _cells.clear ();
40+ }
41+
3842 void dispose () {
39- for (final notifier in cells .values) {
43+ for (final notifier in _cells .values) {
4044 notifier.resignFirstResponder.notify ();
4145 }
4246
43- cells .clear ();
47+ _cells .clear ();
4448 }
4549}
4650
Original file line number Diff line number Diff line change @@ -89,20 +89,20 @@ class _BoardCardState extends State<BoardCard> {
8989 List <GridCellIdentifier > cells,
9090 ) {
9191 final List <Widget > children = [];
92+ rowNotifier.clear ();
9293 cells.asMap ().forEach (
9394 (int index, GridCellIdentifier cellId) {
9495 final cellNotifier = EditableCellNotifier ();
9596 Widget child = widget.cellBuilder.buildCell (
9697 widget.groupId,
9798 cellId,
98- widget.isEditing,
99+ index == 0 ? widget.isEditing : false ,
99100 cellNotifier,
100101 );
101102
102103 if (index == 0 ) {
103104 rowNotifier.insertCell (cellId, cellNotifier);
104105 }
105-
106106 child = Padding (
107107 key: cellId.key (),
108108 padding: const EdgeInsets .only (left: 4 , right: 4 ),
You can’t perform that action at this time.
0 commit comments