Merge branch 'zaid_development_new' into sikander-development

# Conflicts:
#	lib/controllers/api_routes/urls.dart
main_design2.0
Sikander Saleem 2 years ago
commit 71ccd100b5

@ -2,19 +2,19 @@ class URLs {
URLs._();
static const host2 = "http://194.163.164.213/atoms/api";
//static const host1 = "https://atomsuat.hmg.com"; // old uat url
static const host1 = "https://atomsm.hmg.com"; // production url
static const host1 = "https://atomsuat.hmg.com"; // uat url
static const host3 = "https://atomsmdev.hmg.com"; // uat url
// static const host1 = "http://109.123.243.118:9000";
static String _baseUrl = "$_host/mobile";
static String _host = host1;
static String _host = host3;
set host(String value) => _host = value;
static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_baseUrl/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 :1 (file.contains("/") ? file : "$_host/attachment/$file");
// API Routes
static get login => "$_baseUrl/MobileAuth/LoginIntegration"; // post

@ -39,6 +39,7 @@ class SearchWorkOrder {
this.nurseSignature,
this.woParentDto,
this.timer,
this.mrNumber,
});
SearchWorkOrder.fromJson(dynamic json) {
@ -51,6 +52,7 @@ class SearchWorkOrder {
assetType = json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
assignedEmployee = json['assignedEmployee'] != null ? AssignedEmployee.fromJson(json['assignedEmployee']) : null;
visitDate = json['visitDate'];
mrNumber = json['mrNumber'];
if (json['assistantEmployees'] != null) {
assistantEmployees = [];
json['assistantEmployees'].forEach((v) {
@ -145,6 +147,7 @@ class SearchWorkOrder {
engSignature = wo.engSignature ?? engSignature;
nurseSignature = wo.nurseSignature ?? nurseSignature;
woParentDto = wo.woParentDto ?? woParentDto;
mrNumber = wo.mrNumber ?? mrNumber;
}
num id;
@ -180,6 +183,7 @@ class SearchWorkOrder {
String nurseSignature;
WoParentDto woParentDto;
TimerModel timer;
String mrNumber;
SearchWorkOrder copyWith({
num id,
@ -215,6 +219,7 @@ class SearchWorkOrder {
String nurseSignature,
WoParentDto woParentDto,
TimerModel timer,
String mrNumber,
}) =>
SearchWorkOrder(
id: id ?? this.id,
@ -250,6 +255,7 @@ class SearchWorkOrder {
nurseSignature: nurseSignature ?? this.nurseSignature,
woParentDto: woParentDto ?? this.woParentDto,
timer: timer ?? this.timer,
mrNumber: mrNumber ?? this.mrNumber,
);
Map<String, dynamic> toJson() {
@ -319,6 +325,9 @@ class SearchWorkOrder {
if (woParentDto != null) {
map['woParentDto'] = woParentDto.toJson();
}
if (mrNumber != null) {
map['mrNumber'] = mrNumber;
}
return map;
}

@ -13,7 +13,6 @@ import 'package:test_sa/views/widgets/status/service_request/supplier_engineers_
import '../../../controllers/localization/localization.dart';
import '../../../controllers/providers/api/status_drop_down/report/service_report_maintenance_situation_provider.dart';
import '../../app_style/colors.dart';
import '../../widgets/timer/app_timer.dart';
import '../../widgets/titles/app_sub_title.dart';
import 'auto_generated_vendor_name.dart';
@ -144,6 +143,7 @@ class _WorkOrderDetailsBottomSheetState extends State<WorkOrderDetailsBottomShee
}
if (status?.value == 12 || _workOrder.calllastSituation?.value == 12) {
_workOrder.calllastSituation = status;
_workOrder.mrNumber = null;
setState(() {});
} else {
_workOrder.calllastSituation = status;
@ -152,8 +152,16 @@ class _WorkOrderDetailsBottomSheetState extends State<WorkOrderDetailsBottomShee
},
woId: widget.subWorkOrder?.parentWOId?.toString(),
),
if(_workOrder.calllastSituation.value ==12)
ASubTitle(" You have to add parts", color: AColors.primaryColor, padding: EdgeInsets.all(2), font: 12,),
if (_workOrder.calllastSituation.value == 12) const ASubTitle(" You have to add parts", color: Colors.amber, padding: EdgeInsets.all(2), font: 11),
if (_workOrder.calllastSituation.value == 12) const SizedBox(height: 8),
if (_workOrder.calllastSituation.value == 12)
ATextFormField(
labelText: "MR number",
initialValue: _workOrder.mrNumber,
onSaved: (value) {
_workOrder.mrNumber = value;
},
),
if (_showVendorFields) const SizedBox(height: 8),
if (_showVendorFields)
AutoGeneratedVendorName(

@ -86,6 +86,12 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
return;
}
}
if (_gasRefillProvider.department?.name == null) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text("Failed to complete your request")));
_isLoading = false;
setState(() {});
return;
}
int status = widget.gasRefillModel == null
? await _gasRefillProvider.createModel(

Loading…
Cancel
Save