mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-11-16 18:37:40 +00:00
fix: insert row index
This commit is contained in:
parent
8a7c3a9cfc
commit
b9135d26a9
@ -213,7 +213,8 @@ class _GridRowsState extends State<_GridRows> {
|
|||||||
key: _key,
|
key: _key,
|
||||||
initialItemCount: context.read<GridBloc>().state.rows.length,
|
initialItemCount: context.read<GridBloc>().state.rows.length,
|
||||||
itemBuilder: (BuildContext context, int index, Animation<double> animation) {
|
itemBuilder: (BuildContext context, int index, Animation<double> animation) {
|
||||||
return _renderRow(context, state.rows[index], animation);
|
final rowData = context.read<GridBloc>().state.rows[index];
|
||||||
|
return _renderRow(context, rowData, animation);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -210,7 +210,6 @@ class FlowyOverlayState extends State<FlowyOverlay> {
|
|||||||
_overlayList.remove(firstItem);
|
_overlayList.remove(firstItem);
|
||||||
if (firstItem.delegate != null) {
|
if (firstItem.delegate != null) {
|
||||||
firstItem.delegate!.didRemove();
|
firstItem.delegate!.didRemove();
|
||||||
|
|
||||||
if (firstItem.delegate!.asBarrier()) {
|
if (firstItem.delegate!.asBarrier()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,6 +61,10 @@ impl ClientGridBlockMetaEditor {
|
|||||||
|
|
||||||
let change = block_pad.add_row_meta(row, start_row_id)?;
|
let change = block_pad.add_row_meta(row, start_row_id)?;
|
||||||
row_count = block_pad.number_of_rows();
|
row_count = block_pad.number_of_rows();
|
||||||
|
|
||||||
|
if row_index.is_none() {
|
||||||
|
row_index = Some(row_count - 1);
|
||||||
|
}
|
||||||
Ok(change)
|
Ok(change)
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@ -92,8 +92,11 @@ impl GridBlockMetaEditorManager {
|
|||||||
let mut row_count = 0;
|
let mut row_count = 0;
|
||||||
for row in row_metas {
|
for row in row_metas {
|
||||||
let _ = self.persistence.insert_or_update(&row.block_id, &row.id)?;
|
let _ = self.persistence.insert_or_update(&row.block_id, &row.id)?;
|
||||||
inserted_row_orders.push(IndexRowOrder::from(&row));
|
let mut row_order = IndexRowOrder::from(&row);
|
||||||
row_count = editor.create_row(row, None).await?.0;
|
let (count, index) = editor.create_row(row, None).await?;
|
||||||
|
row_count = count;
|
||||||
|
row_order.index = index;
|
||||||
|
inserted_row_orders.push(row_order);
|
||||||
}
|
}
|
||||||
changesets.push(GridBlockMetaChangeset::from_row_count(&block_id, row_count));
|
changesets.push(GridBlockMetaChangeset::from_row_count(&block_id, row_count));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user