Last active
April 26, 2020 10:50
-
-
Save IhwanID/1572032fa647988bb128fd0bb796e80c to your computer and use it in GitHub Desktop.
model
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
| import 'package:json_annotation/json_annotation.dart'; | |
| part 'company.g.dart'; | |
| @JsonSerializable() | |
| class CompaniesResponse { | |
| CompaniesResponse(this.status, this.data); | |
| final String status; | |
| final List<Company> data; | |
| factory CompaniesResponse.fromJson(Map<String, dynamic> json) => | |
| _$CompaniesResponseFromJson(json); | |
| Map<String, dynamic> toJson() => _$CompaniesResponseToJson(this); | |
| } | |
| @JsonSerializable() | |
| class Company { | |
| Company( | |
| {this.registration, | |
| this.companyName, | |
| this.website, | |
| this.platformName, | |
| this.registrationType, | |
| this.badanHukum, | |
| this.isSyariah, | |
| this.alamat}); | |
| final String registration; | |
| @JsonKey(name: 'company_name') | |
| final String companyName; | |
| final String website; | |
| @JsonKey(name: 'platform_name') | |
| final String platformName; | |
| @JsonKey(name: 'registration_type') | |
| final String registrationType; | |
| @JsonKey(name: 'badan_hukum') | |
| final String badanHukum; | |
| @JsonKey(name: 'is_syariah') | |
| final bool isSyariah; | |
| final String alamat; | |
| factory Company.fromJson(Map<String, dynamic> json) => | |
| _$CompanyFromJson(json); | |
| Map<String, dynamic> toJson() => _$CompanyToJson(this); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment