exportDump method

  1. @override
Future<String> exportDump()
override

Implementation

@override
Future<String> exportDump() async {
  final dataMap = {
    _clientBoxName: await _clientBox.getAllValues(),
    _accountDataBoxName: await _accountDataBox.getAllValues(),
    _roomsBoxName: await _roomsBox.getAllValues(),
    _roomStateBoxName: await _roomStateBox.getAllValues(),
    _roomMembersBoxName: await _roomMembersBox.getAllValues(),
    _toDeviceQueueBoxName: await _toDeviceQueueBox.getAllValues(),
    _roomAccountDataBoxName: await _roomAccountDataBox.getAllValues(),
    _inboundGroupSessionsBoxName:
        await _inboundGroupSessionsBox.getAllValues(),
    _outboundGroupSessionsBoxName:
        await _outboundGroupSessionsBox.getAllValues(),
    _olmSessionsBoxName: await _olmSessionsBox.getAllValues(),
    _userDeviceKeysBoxName: await _userDeviceKeysBox.getAllValues(),
    _userDeviceKeysOutdatedBoxName:
        await _userDeviceKeysOutdatedBox.getAllValues(),
    _userCrossSigningKeysBoxName:
        await _userCrossSigningKeysBox.getAllValues(),
    _ssssCacheBoxName: await _ssssCacheBox.getAllValues(),
    _presencesBoxName: await _presencesBox.getAllValues(),
    _timelineFragmentsBoxName: await _timelineFragmentsBox.getAllValues(),
    _eventsBoxName: await _eventsBox.getAllValues(),
    _seenDeviceIdsBoxName: await _seenDeviceIdsBox.getAllValues(),
    _seenDeviceKeysBoxName: await _seenDeviceKeysBox.getAllValues(),
  };
  final json = jsonEncode(dataMap);
  await clear();
  return json;
}