Skip to content

Commit

Permalink
Merge pull request #5 from dhikshith12/master
Browse files Browse the repository at this point in the history
toString toJson methods to override 'Instance of SignResult'
  • Loading branch information
daewu14 authored Jun 7, 2023
2 parents b6ebc78 + 59972cb commit 5ca6b8a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/models/sign_in_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ class SignInResult {
googleIdToken: json["google_id_token"] == null ? null : json["google_id_token"],
id: json["id"] == null ? null : json["id"],
);

///
/// To Json method to use in stringify
///
Map<String, dynamic> toJson(){
return {
"credential": credential,
"username": username,
"password": password,
"id_token": idToken,
"display_name": displayName,
"google_id_token": googleIdToken,
"id": id
}
}

///
/// To String method to print
///
@override
String toString(){
return toJson().toString();
}
}

///
Expand Down

0 comments on commit 5ca6b8a

Please sign in to comment.