user property Null safety

User? user

Implementation

User? get user => data.isEmpty ? null : User.fromJson(data);