mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: add card at the beginning (#3835)
This commit is contained in:
@ -177,6 +177,7 @@ class DatabaseController {
|
||||
Future<Either<RowMetaPB, FlowyError>> createRow({
|
||||
RowId? startRowId,
|
||||
String? groupId,
|
||||
bool fromBeginning = false,
|
||||
void Function(RowDataBuilder builder)? withCells,
|
||||
}) {
|
||||
Map<String, String>? cellDataByFieldId;
|
||||
@ -191,6 +192,7 @@ class DatabaseController {
|
||||
startRowId: startRowId,
|
||||
groupId: groupId,
|
||||
cellDataByFieldId: cellDataByFieldId,
|
||||
fromBeginning: fromBeginning,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,13 @@ class DatabaseViewBackendService {
|
||||
RowId? startRowId,
|
||||
String? groupId,
|
||||
Map<String, String>? cellDataByFieldId,
|
||||
bool fromBeginning = false,
|
||||
}) {
|
||||
final payload = CreateRowPayloadPB.create()..viewId = viewId;
|
||||
payload.startRowId = startRowId ?? "";
|
||||
|
||||
if (!fromBeginning || startRowId != null) {
|
||||
payload.startRowId = startRowId ?? "";
|
||||
}
|
||||
|
||||
if (groupId != null) {
|
||||
payload.groupId = groupId;
|
||||
|
@ -90,7 +90,11 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
|
||||
);
|
||||
},
|
||||
createHeaderRow: (String groupId) async {
|
||||
final result = await databaseController.createRow(groupId: groupId);
|
||||
final result = await databaseController.createRow(
|
||||
groupId: groupId,
|
||||
fromBeginning: true,
|
||||
);
|
||||
|
||||
result.fold(
|
||||
(_) {},
|
||||
(err) => Log.error(err),
|
||||
|
Reference in New Issue
Block a user