Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Last active July 4, 2020 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/55fe1d9fe409e38e8677171bbe0a4ff7 to your computer and use it in GitHub Desktop.
Save PatilShreyas/55fe1d9fe409e38e8677171bbe0a4ff7 to your computer and use it in GitHub Desktop.
/// FeedbackForm is a data class which stores data fields of Feedback.
class FeedbackForm {
String name;
String email;
String mobileNo;
String feedback;
FeedbackForm(this.name, this.email, this.mobileNo, this.feedback);
factory FeedbackForm.fromJson(dynamic json) {
return FeedbackForm("${json['name']}", "${json['email']}",
"${json['mobileNo']}", "${json['feedback']}");
}
// Method to make GET parameters.
Map toJson() => {
'name': name,
'email': email,
'mobileNo': mobileNo,
'feedback': feedback
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment