mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: options don't refresh after moving the card (#1536)
Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -97,11 +97,22 @@ class GridRowCache {
|
||||
}
|
||||
}
|
||||
|
||||
void _updateRows(List<RowPB> updatedRows) {
|
||||
void _updateRows(List<UpdatedRowPB> updatedRows) {
|
||||
if (updatedRows.isEmpty) return;
|
||||
List<RowPB> rowPBs = [];
|
||||
for (final updatedRow in updatedRows) {
|
||||
for (final fieldId in updatedRow.fieldIds) {
|
||||
final key = GridCellCacheKey(
|
||||
fieldId: fieldId,
|
||||
rowId: updatedRow.row.id,
|
||||
);
|
||||
_cellCache.remove(key);
|
||||
}
|
||||
rowPBs.add(updatedRow.row);
|
||||
}
|
||||
|
||||
final updatedIndexs =
|
||||
_rowList.updateRows(updatedRows, (rowPB) => buildGridRow(rowPB));
|
||||
_rowList.updateRows(rowPBs, (rowPB) => buildGridRow(rowPB));
|
||||
if (updatedIndexs.isNotEmpty) {
|
||||
_rowChangeReasonNotifier.receive(RowsChangedReason.update(updatedIndexs));
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ class _PropertyList extends StatelessWidget {
|
||||
builder: (context, state) {
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(child: _wrapScrollbar(buildList(state))),
|
||||
Expanded(child: _wrapScrollbar(buildRowCells(state))),
|
||||
const VSpace(10),
|
||||
_CreateFieldButton(
|
||||
viewId: viewId,
|
||||
@ -126,7 +126,7 @@ class _PropertyList extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildList(RowDetailState state) {
|
||||
Widget buildRowCells(RowDetailState state) {
|
||||
return ListView.separated(
|
||||
controller: _scrollController,
|
||||
itemCount: state.gridCells.length,
|
||||
|
Reference in New Issue
Block a user