deserializeDbUserRelayList function

  1. @isarProtected
DbUserRelayList deserializeDbUserRelayList(
  1. IsarReader reader
)

Implementation

@isarProtected
DbUserRelayList deserializeDbUserRelayList(IsarReader reader) {
  final String _pubKey;
  _pubKey = IsarCore.readString(reader, 2) ?? '';
  final int _createdAt;
  _createdAt = IsarCore.readLong(reader, 3);
  final int _refreshedTimestamp;
  _refreshedTimestamp = IsarCore.readLong(reader, 4);
  final List<DbRelayListItem> _items;
  {
    final length = IsarCore.readList(reader, 5, IsarCore.readerPtrPtr);
    {
      final reader = IsarCore.readerPtr;
      if (reader.isNull) {
        _items = const <DbRelayListItem>[];
      } else {
        final list = List<DbRelayListItem>.filled(
            length,
            DbRelayListItem(
              '',
              ReadWriteMarker.readOnly,
            ),
            growable: true);
        for (var i = 0; i < length; i++) {
          {
            final objectReader = IsarCore.readObject(reader, i);
            if (objectReader.isNull) {
              list[i] = DbRelayListItem(
                '',
                ReadWriteMarker.readOnly,
              );
            } else {
              final embedded = deserializeDbRelayListItem(objectReader);
              IsarCore.freeReader(objectReader);
              list[i] = embedded;
            }
          }
        }
        IsarCore.freeReader(reader);
        _items = list;
      }
    }
  }
  final object = DbUserRelayList(
    pubKey: _pubKey,
    createdAt: _createdAt,
    refreshedTimestamp: _refreshedTimestamp,
    items: _items,
  );
  return object;
}