deserializeDbEvent function

  1. @isarProtected
DbEvent deserializeDbEvent(
  1. IsarReader reader
)

Implementation

@isarProtected
DbEvent deserializeDbEvent(IsarReader reader) {
  final String _pubKey;
  _pubKey = IsarCore.readString(reader, 2) ?? '';
  final int _kind;
  _kind = IsarCore.readLong(reader, 3);
  final int _createdAt;
  {
    final value = IsarCore.readLong(reader, 4);
    if (value == -9223372036854775808) {
      _createdAt = 0;
    } else {
      _createdAt = value;
    }
  }
  final List<List<String>> _tags;
  {
    final json = isarJsonDecode(IsarCore.readString(reader, 5) ?? 'null');
    if (json is List) {
      _tags = castToListOfListOfString(json);
    } else {
      _tags = const <List<String>>[];
    }
  }
  final String _content;
  _content = IsarCore.readString(reader, 7) ?? '';
  final String _sig;
  _sig = IsarCore.readString(reader, 8) ?? '';
  final bool? _validSig;
  {
    if (IsarCore.readNull(reader, 9)) {
      _validSig = null;
    } else {
      _validSig = IsarCore.readBool(reader, 9);
    }
  }
  final List<String> _sources;
  {
    final length = IsarCore.readList(reader, 10, IsarCore.readerPtrPtr);
    {
      final reader = IsarCore.readerPtr;
      if (reader.isNull) {
        _sources = const <String>[];
      } else {
        final list = List<String>.filled(length, '', growable: true);
        for (var i = 0; i < length; i++) {
          list[i] = IsarCore.readString(reader, i) ?? '';
        }
        IsarCore.freeReader(reader);
        _sources = list;
      }
    }
  }
  final object = DbEvent(
    pubKey: _pubKey,
    kind: _kind,
    createdAt: _createdAt,
    tags: _tags,
    content: _content,
    sig: _sig,
    validSig: _validSig,
    sources: _sources,
  );
  return object;
}