toJson method
Produces a Map that can be serialized to JSON.
Implementation
Map<String, dynamic> toJson() {
return <String, dynamic>{
if (id != null) 'id': id,
if (username != null) 'username': username,
if (email != null) 'email': email,
if (ipAddress != null) 'ip_address': ipAddress,
if (extras?.isNotEmpty ?? false) 'extras': extras,
};
}