You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aku_new_community/lib/model/manager/article_borrow_model.dart

34 lines
862 B

3 years ago
import 'package:aku_new_community/model/common/img_model.dart';
class ArticleBorrowModel {
3 years ago
int? id;
String? name;
int? quantity;
List<ImgModel>? imgUrls;
ArticleBorrowModel({this.id, this.name, this.quantity, this.imgUrls});
ArticleBorrowModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
quantity = json['quantity'];
if (json['imgUrls'] != null) {
4 years ago
imgUrls = [];
json['imgUrls'].forEach((v) {
3 years ago
imgUrls!.add(new ImgModel.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['quantity'] = this.quantity;
if (this.imgUrls != null) {
3 years ago
data['imgUrls'] = this.imgUrls!.map((v) => v.toJson()).toList();
}
return data;
}
}