validOrNull property

User? get validOrNull

Returns null if this user i not valid i.e. id is -1.

Implementation

User? get validOrNull => id == -1 ? null : this;