saveAll method Null safety

Future<List<LCObject>> saveAll(
  1. List<LCObject> objectList
)

Saves all objects in objectList.

Implementation

static Future<List<LCObject>> saveAll(List<LCObject> objectList) async {
  // 断言没有循环依赖
  objectList.forEach((item) {
    if (_LCBatch.hasCircleReference(item)) {
      throw new ArgumentError('Found a circle dependency when save.');
    }
  });

  Queue<_LCBatch> batches = _LCBatch.batchObjects(objectList, true);
  await _saveBatches(batches);
  return objectList;
}