toJson method
Implementation
Map<String, dynamic> toJson() {
var json = <String, dynamic>{
"access_token": token,
"token_type": tokenType,
"expires_in": expiry
};
// Check if we have user to add it
if (user != null) {
json["user"] = user!.toJson();
}
// Check if we have device to add it
if (device != null) {
json["device"] = device!.toJson();
}
return json;
}