bulkCreate method

  1. @override
FutureOr<void> bulkCreate(
  1. List<AttendanceLogModel> entities
)
override

Implementation

@override
FutureOr<void> bulkCreate(
  List<AttendanceLogModel> entities,
) async {
  return retryLocalCallOperation(() async {
    final logsCompanions = entities
        .map((e) => e.companion.copyWith(
              uploadToServer: const Value(true),
            ))
        .toList();

    await sql.batch((batch) async {
      batch.insertAll(
        sql.attendance,
        logsCompanions,
        mode: InsertMode.insertOrReplace,
      );
    });
  });
}