feat: update kanban demo (#2008)

This commit is contained in:
Nathan.fooo
2023-03-17 11:01:14 +08:00
committed by GitHub
parent 0630dc10b7
commit 1dbfd838ef
7 changed files with 59 additions and 16 deletions

View File

@ -159,8 +159,11 @@ class DatabaseController {
);
}
Future<Either<Unit, FlowyError>> moveRow(RowPB fromRow,
{RowPB? toRow, String? groupId}) {
Future<Either<Unit, FlowyError>> moveRow({
required RowPB fromRow,
required String groupId,
RowPB? toRow,
}) {
return _databaseViewBackendSvc.moveRow(
fromRowId: fromRow.id,
toGroupId: groupId,

View File

@ -46,15 +46,13 @@ class DatabaseViewBackendService {
Future<Either<Unit, FlowyError>> moveRow({
required String fromRowId,
required String? toGroupId,
required String? toRowId,
required String toGroupId,
String? toRowId,
}) {
var payload = MoveGroupRowPayloadPB.create()
..viewId = viewId
..fromRowId = fromRowId;
if (toGroupId != null) {
payload.toGroupId = toGroupId;
}
..fromRowId = fromRowId
..toGroupId = toGroupId;
if (toRowId != null) {
payload.toRowId = toRowId;

View File

@ -54,7 +54,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
final toRow = groupControllers[groupId]?.rowAtIndex(toIndex);
if (fromRow != null) {
_databaseController.moveRow(
fromRow,
fromRow: fromRow,
toRow: toRow,
groupId: groupId,
);
@ -70,7 +70,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
final toRow = groupControllers[toGroupId]?.rowAtIndex(toIndex);
if (fromRow != null) {
_databaseController.moveRow(
fromRow,
fromRow: fromRow,
toRow: toRow,
groupId: toGroupId,
);