You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
461 B
Dart
23 lines
461 B
Dart
class Part{
|
|
int id;
|
|
String code;
|
|
String name;
|
|
int quantity;
|
|
|
|
Part({
|
|
this.id,
|
|
this.code,
|
|
this.name,
|
|
this.quantity = 1,
|
|
});
|
|
|
|
factory Part.fromJson(Map<String,dynamic> parsedJson){
|
|
return Part(
|
|
id: parsedJson["id"],
|
|
code: parsedJson["partNo"],
|
|
name: parsedJson["partName"],
|
|
quantity: parsedJson["partQuantity"] == null
|
|
? 1 : int.tryParse(parsedJson["partQuantity"].toString()) ?? 1,
|
|
);
|
|
}
|
|
} |