Created
May 6, 2020 18:37
-
-
Save becek2n/a6fa2dfa649289a0c3cfa65f77974f19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KaryawanModel | |
{ | |
final int id; | |
final String nama; | |
final String telp; | |
final String email; | |
final int department; | |
final int jabatan; | |
KaryawanModel({ | |
this.id, | |
this.nama, | |
this.telp, | |
this.email, | |
this.department, | |
this.jabatan, | |
}); | |
Map<String, dynamic> mapToDbClient(){ | |
return { | |
"ID": this.id, | |
"Nama": this.nama, | |
"Telp": this.telp, | |
"Email": this.telp, | |
"Department": this.department, | |
"Jabatan": this.jabatan | |
}; | |
} | |
factory KaryawanModel.fromMap(Map<String, dynamic> map) { | |
final data = KaryawanModel( | |
id: map["ID"], | |
nama: map["Nama"], | |
telp: map["Telp"], | |
email: map["Email"], | |
department: map["Department"], | |
jabatan: map["Jabatan"] | |
); | |
return data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment