deserializeDbRelaySetProp function

  1. @isarProtected
dynamic deserializeDbRelaySetProp(
  1. IsarReader reader,
  2. int property
)

Implementation

@isarProtected
dynamic deserializeDbRelaySetProp(IsarReader reader, int property) {
  switch (property) {
    case 1:
      return IsarCore.readString(reader, 1) ?? '';
    case 2:
      return IsarCore.readString(reader, 2) ?? '';
    case 3:
      return IsarCore.readString(reader, 3) ?? '';
    case 4:
      {
        if (IsarCore.readNull(reader, 4)) {
          return RelayDirection.inbox;
        } else {
          return _dbRelaySetDirection[IsarCore.readByte(reader, 4)] ??
              RelayDirection.inbox;
        }
      }
    case 5:
      return IsarCore.readLong(reader, 5);
    case 6:
      {
        final length = IsarCore.readList(reader, 6, IsarCore.readerPtrPtr);
        {
          final reader = IsarCore.readerPtr;
          if (reader.isNull) {
            return const <DbRelaySetItem>[];
          } else {
            final list = List<DbRelaySetItem>.filled(
                length,
                DbRelaySetItem(
                  '',
                  const <DbPubkeyMapping>[],
                ),
                growable: true);
            for (var i = 0; i < length; i++) {
              {
                final objectReader = IsarCore.readObject(reader, i);
                if (objectReader.isNull) {
                  list[i] = DbRelaySetItem(
                    '',
                    const <DbPubkeyMapping>[],
                  );
                } else {
                  final embedded = deserializeDbRelaySetItem(objectReader);
                  IsarCore.freeReader(objectReader);
                  list[i] = embedded;
                }
              }
            }
            IsarCore.freeReader(reader);
            return list;
          }
        }
      }
    default:
      throw ArgumentError('Unknown property: $property');
  }
}