Initial commit: Penyerahan final Source code Tugas Akhir
This commit is contained in:
23
lib/models/subcategories_model.dart
Normal file
23
lib/models/subcategories_model.dart
Normal file
@ -0,0 +1,23 @@
|
||||
class SubCategoryModel {
|
||||
final String subId;
|
||||
final String nameSubCategory;
|
||||
|
||||
SubCategoryModel({
|
||||
required this.subId,
|
||||
required this.nameSubCategory,
|
||||
});
|
||||
|
||||
factory SubCategoryModel.fromJson(Map<String, dynamic> json) {
|
||||
return SubCategoryModel(
|
||||
subId: json['id'],
|
||||
nameSubCategory: json['name_subcategory'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': subId,
|
||||
'name_subcategory': nameSubCategory,
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user