chore: add remove out of bound guard

This commit is contained in:
appflowy 2022-08-26 08:32:25 +08:00
parent 96fcedf771
commit 2b725f8f71
3 changed files with 8 additions and 1 deletions

View File

@ -37,6 +37,9 @@ class _BoardSelectOptionCellState extends State<BoardSelectOptionCell> {
return BlocProvider.value(
value: _cellBloc,
child: BlocBuilder<BoardSelectOptionCellBloc, BoardSelectOptionCellState>(
// buildWhen: (previous, current) {
// return previous.selectedOptions != current.selectedOptions;
// },
builder: (context, state) {
if (state.selectedOptions
.where((element) => element.id == widget.groupId)

View File

@ -121,6 +121,10 @@ class AFBoardColumnDataController extends ChangeNotifier with EquatableMixin {
columnData._items.add(newItem);
Log.debug('[$AFBoardColumnDataController] $columnData add $newItem');
} else {
if (index >= columnData._items.length) {
return;
}
final removedItem = columnData._items.removeAt(index);
columnData._items.insert(index, newItem);
Log.debug(

View File

@ -140,7 +140,7 @@ class _ReorderDragTargetState<T extends DragTargetData>
widget.insertAnimationController,
widget.deleteAnimationController,
) ??
LongPressDraggable<DragTargetData>(
Draggable<DragTargetData>(
maxSimultaneousDrags: 1,
data: widget.dragTargetData,
ignoringFeedbackSemantics: false,