Some changes on work orders model attributes & change File Base Url (Still under testing)

main_design2.0
zaid_daoud 2 years ago
parent 383c634c50
commit bd299e2a6d

@ -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

@ -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'];

@ -416,7 +416,7 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
),
],
),
if (_serviceReport.callLastSituation.value == 2)
if (_serviceReport?.callLastSituation?.value == 2)
Column(
children: [
const SizedBox(
@ -1056,7 +1056,6 @@ class _EditServiceReportState extends State<EditServiceReport> with TickerProvid
return;
}
_validate = true;
print("jere1245");
// if (!_formKey.currentState.validate()) {
// setState(() {});
// return;

Loading…
Cancel
Save