diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index b672ee62..a587fb7f 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -12,8 +12,8 @@ class URLs { set host(String value) => _host = value; - // static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/Files/DownloadFile?fileName=$file"); - static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/attachment/$file"); + static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/Files/DownloadFile?fileName=$file"); + // static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/attachment/$file"); // API Routes static get login => "$_baseUrl/MobileAuth/LoginIntegration"; // post diff --git a/lib/models/call_request_for_work_order_model.dart b/lib/models/call_request_for_work_order_model.dart index a6c2d5a5..35b34551 100644 --- a/lib/models/call_request_for_work_order_model.dart +++ b/lib/models/call_request_for_work_order_model.dart @@ -1,3 +1,5 @@ +import 'package:test_sa/models/lookup.dart'; + class CallRequestForWorkOrder { int id; String callNo; @@ -71,11 +73,11 @@ class Asset { String ipAddress; String macAddress; String portNumber; - String assetReplace; + Lookup assetReplace; String oldAsset; - bool isParent; + Lookup isParent; String parentAsset; - int assetType; + Lookup assetType; Site site; Building building; String floor; @@ -171,11 +173,11 @@ class Asset { ipAddress = json['ipAddress']; macAddress = json['macAddress']; portNumber = json['portNumber']; - assetReplace = json['assetReplace']; + assetReplace = json['assetReplace'] != null ? Lookup.fromJson(json['assetReplace']) : null; oldAsset = json['oldAsset']; - isParent = json['isParent']; + isParent = json['isParent'] != null ? Lookup.fromJson(json['isParent']) : null; parentAsset = json['parentAsset']; - assetType = json['assetType']; + assetType = json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null; site = json['site'] != null ? new Site.fromJson(json['site']) : null; building = json['building']; floor = json['floor']; diff --git a/lib/views/pages/user/requests/report/edit_service_report.dart b/lib/views/pages/user/requests/report/edit_service_report.dart index 07619f16..8191fc4d 100644 --- a/lib/views/pages/user/requests/report/edit_service_report.dart +++ b/lib/views/pages/user/requests/report/edit_service_report.dart @@ -416,7 +416,7 @@ class _EditServiceReportState extends State with TickerProvid ), ], ), - if (_serviceReport.callLastSituation.value == 2) + if (_serviceReport?.callLastSituation?.value == 2) Column( children: [ const SizedBox( @@ -1056,7 +1056,6 @@ class _EditServiceReportState extends State with TickerProvid return; } _validate = true; - print("jere1245"); // if (!_formKey.currentState.validate()) { // setState(() {}); // return;