Future storeBuffer()

Source

storeBuffer() async {
  List<ValueEntry> entries = buffer.map(asValueEntry).toList();

  if (entries.isNotEmpty) {
    try {
      if (!isStartDateFilled) {
        _link.updateValue("${path}/startDate", entries.first.timestamp);
      }

      _link.updateValue("${path}/lwv", entries.last.value);
      _link.updateValue("${path}/endDate", entries.last.timestamp);
    } catch (e) {
    }
  }
  buffer.clear();
  await group.storeValues(entries);
}