getToDeviceEventQueue method

  1. @override
Future<List<QueuedToDeviceEvent>> getToDeviceEventQueue()
override

Implementation

@override
Future<List<QueuedToDeviceEvent>> getToDeviceEventQueue() async {
  final raws = await _toDeviceQueueBox.getAllValues();
  final copiedRaws = raws.entries.map((entry) {
    final copiedRaw = copyMap(entry.value);
    copiedRaw['id'] = int.parse(entry.key);
    copiedRaw['content'] = jsonDecode(copiedRaw['content']);
    return copiedRaw;
  }).toList();
  return copiedRaws.map((raw) => QueuedToDeviceEvent.fromJson(raw)).toList();
}