Last active
June 11, 2019 17:37
-
-
Save mirajehossain/94ea73c156f272379a5854006fe14738 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| { | |
| "status": true, | |
| "message": "Message", | |
| "statusCode": 200, | |
| "data": { | |
| "access_token": "mytoken here" | |
| } | |
| } | |
| */ | |
| class UserModel { | |
| bool status; | |
| int statusCode; | |
| String message; | |
| Data data; | |
| UserModel( | |
| { | |
| this.status, | |
| this.statusCode, | |
| this.message, | |
| this.data | |
| }); | |
| factory UserModel.fromJson(Map<String, dynamic> parsedJson){ | |
| return UserModel( | |
| status: parsedJson['status'], | |
| statusCode : parsedJson['statusCode'], | |
| message : parsedJson ['message'], | |
| data : Data.fromJson(parsedJson ['data']) | |
| ); | |
| } | |
| } | |
| class Data{ | |
| String access_token; | |
| Data({ | |
| this.access_token | |
| }); | |
| factory Data.fromJson(Map<String, String> json){ | |
| return Data( | |
| access_token: json['access_token'] | |
| ); | |
| } | |
| } |
mezoni
commented
Jun 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment