From 5429c06349d8fc0bf1fa12eaac9c45ee0d304be4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 2 Aug 2021 17:33:13 +1000 Subject: [PATCH] Add isManufacturer accessor for Company --- lib/inventree/company.dart | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/inventree/company.dart b/lib/inventree/company.dart index 284faeaf..c4ca8773 100644 --- a/lib/inventree/company.dart +++ b/lib/inventree/company.dart @@ -24,11 +24,11 @@ class InvenTreeCompany extends InvenTreeModel { bool get isSupplier => jsondata['is_supplier'] ?? false; + bool get isManufacturer => jsondata['is_manufacturer'] ?? false; + bool get isCustomer => jsondata['is_customer'] ?? false; - InvenTreeCompany.fromJson(Map json) : super.fromJson(json) { - // TODO - } + InvenTreeCompany.fromJson(Map json) : super.fromJson(json); @override InvenTreeModel createFromJson(Map json) { @@ -57,9 +57,7 @@ class InvenTreeSupplierPart extends InvenTreeModel { InvenTreeSupplierPart() : super(); - InvenTreeSupplierPart.fromJson(Map json) : super.fromJson(json) { - // TODO - } + InvenTreeSupplierPart.fromJson(Map json) : super.fromJson(json); int get manufacturerId => (jsondata['manufacturer'] ?? -1) as int; @@ -92,8 +90,7 @@ class InvenTreeManufacturerPart extends InvenTreeModel { InvenTreeManufacturerPart() : super(); - InvenTreeManufacturerPart.fromJson(Map json) : super.fromJson(json) { - } + InvenTreeManufacturerPart.fromJson(Map json) : super.fromJson(json); int get partId => (jsondata['part'] ?? -1) as int;