Skip to content

Instantly share code, notes, and snippets.

@Abdulsametileri
Created February 17, 2021 19:33
Show Gist options
  • Save Abdulsametileri/c69fbe4426aa4e445f3edace3ceeb7cc to your computer and use it in GitHub Desktop.
Save Abdulsametileri/c69fbe4426aa4e445f3edace3ceeb7cc to your computer and use it in GitHub Desktop.
class InvoiceModel {
int id;
String date;
int amount;
InvoiceModel({this.id, this.date, this.amount});
InvoiceModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
date = json['date'];
amount = json['amount'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['date'] = this.date;
data['amount'] = this.amount;
return data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment