diff --git a/assets/images/arrived_icon.svg b/assets/images/arrived_icon.svg
new file mode 100644
index 00000000..a5951d03
--- /dev/null
+++ b/assets/images/arrived_icon.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/images/clock.svg b/assets/images/clock.svg
new file mode 100644
index 00000000..7c816867
--- /dev/null
+++ b/assets/images/clock.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/drag_icon.svg b/assets/images/drag_icon.svg
new file mode 100644
index 00000000..168ad9f8
--- /dev/null
+++ b/assets/images/drag_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/image-plus.svg b/assets/images/image-plus.svg
new file mode 100644
index 00000000..105b9c3e
--- /dev/null
+++ b/assets/images/image-plus.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/request_icon.svg b/assets/images/request_icon.svg
new file mode 100644
index 00000000..a0e0d462
--- /dev/null
+++ b/assets/images/request_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/scan_asset.svg b/assets/images/scan_asset.svg
new file mode 100644
index 00000000..b2dd1353
--- /dev/null
+++ b/assets/images/scan_asset.svg
@@ -0,0 +1,8 @@
+
diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart
index 03e76360..a28859a9 100644
--- a/lib/controllers/api_routes/urls.dart
+++ b/lib/controllers/api_routes/urls.dart
@@ -35,7 +35,11 @@ class URLs {
static get engineerRejectUrl=> '$_baseUrl/ServiceRequest/EngineerReject';
static get engineerFixRemotlyUrl=> '$_baseUrl/ServiceRequest/EngineerFixRemotly';
static get engineerNeedVisitUrl=> '$_baseUrl/ServiceRequest/EngineerNeedVisit';
+ static get engineerMarkAsFixUrl=> '$_baseUrl/ServiceRequest/EngineerMarkAsFix';
static get getWorkOrderByIdUrl=> '$_baseUrl/ServiceRequest/GetWorkOrderById';
+ static get deleteActivitySparePartUrl=> '$_baseUrl/ServiceRequest/DeleteActivitySparePart';
+ static get createActivitySparePartUrl=> '$_baseUrl/ServiceRequest/CreateActivitySparePart';
+ static get updateActivitySparePartUrl=> '$_baseUrl/ServiceRequest/UpdateActivitySparePart';
static get assignEngineerToWorkOrderUrl=> '$_baseUrl/ServiceRequest/AssignEngineerToWorkOrder';
static get getDepartments => "$_baseUrl/Customer/GetDepartmentLookup"; // get
static get getAssets => "$_baseUrl/Asset/GetAssets"; // get
diff --git a/lib/controllers/providers/api/service_requests_provider.dart b/lib/controllers/providers/api/service_requests_provider.dart
index 5d8e15e6..406eb304 100644
--- a/lib/controllers/providers/api/service_requests_provider.dart
+++ b/lib/controllers/providers/api/service_requests_provider.dart
@@ -44,6 +44,14 @@ class ServiceRequestsProvider extends ChangeNotifier {
// 500 service not available
int stateCode;
bool _isDetialLoading=false;
+ bool _ackhnowledge = false;
+
+ bool get ackhnowledge => _ackhnowledge;
+
+ set ackhnowledge(bool value) {
+ _ackhnowledge = value;
+ notifyListeners();
+ }
bool get isDetialLoading => _isDetialLoading;
diff --git a/lib/dashboard_latest/dashboard_view.dart b/lib/dashboard_latest/dashboard_view.dart
index 56b2b048..a9348703 100644
--- a/lib/dashboard_latest/dashboard_view.dart
+++ b/lib/dashboard_latest/dashboard_view.dart
@@ -62,6 +62,8 @@ class _DashboardViewState extends State {
allRequestsProvider = Provider.of(context, listen: false);
notificationsProvider = Provider.of(context, listen: false);
user = userProvider.user;
+ log('user token i got is ${user.token}');
+
await getAllRequests();
await requestDetailProvider.engineerRejectWorkOrder(id: '3',feedBack: 'Abcdef');
diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart
index fa760b9e..4a5b7342 100644
--- a/lib/extensions/string_extensions.dart
+++ b/lib/extensions/string_extensions.dart
@@ -10,6 +10,14 @@ extension StringExtensions on String {
DateTime dateTime = DateTime.tryParse(this);
return "${DateFormat('dd MMM, yyyy').format(dateTime)}\n${DateFormat('hh:mm a').format(dateTime)}";
}
+ String get toDragAbleTimerFormat {
+ DateTime dateTime = DateTime.tryParse(this);
+ return DateFormat('HH:mm:ss').format(dateTime);
+ }
+ String get toInitialVisitCardFormat {
+ DateTime dateTime = DateTime.tryParse(this);
+ return "${DateFormat('dd MMM, yyyy').format(dateTime)} at ${DateFormat('hh:mm a').format(dateTime)}";
+ }
String get toServiceRequestDetailsFormat {
try {
diff --git a/lib/l10n/app_ar.arb b/lib/l10n/app_ar.arb
index 35bf5d60..da5cb730 100644
--- a/lib/l10n/app_ar.arb
+++ b/lib/l10n/app_ar.arb
@@ -73,6 +73,21 @@
"brand": "ماركة",
"clearSearch": "تنظيف البحث",
"closed": "غلق",
+ "close": "يغلق",
+ "attachFiles": "إرفاق الملفات",
+ "hours": "ساعات",
+ "internal": "داخلي",
+ "external": "خارجي",
+ "addInternalActivity": "إضافة نشاط داخلي",
+ "addExternalActivity": "إضافة نشاط خارجي",
+ "remotely": "عن بُعد",
+ "workshop": "ورشة",
+ "activityStatus": "حالة النشاط",
+ "scanOrPickAsset": "امسح أو اختر الأصل",
+ "takeAction": "اتخذ إجراء",
+ "pleaseConfirmTheIssueHasBeenResolved": "يرجى تأكيد أن المشكلة قد تم حلها",
+ "nurseAcknowledge": "أقر بإكمال أمر العمل هذا",
+ "abroad": "خارج البلاد",
"create": "انشاء",
"createServiceRequest": "انشاء طلب خدمة",
"delete": "مسح",
@@ -276,6 +291,18 @@
"timeAndDuration": "الوقت والمدة",
"assetsCondition": "حالة الأصول",
"attachmentsAcknowledge": "إقرار & المرفقات",
+ "up_and_running": "قيد التشغيل",
+ "partially_down": "معطل جزئيًا",
+ "fully_down": "معطل تمامًا",
+ "verify_asset_details": "تحقق من تفاصيل الأصل",
+ "equipment_status": "حالة المعدات",
+ "failureReason": "سبب الفشل",
+ "visitDateAndTime": "تاريخ ووقت الزيارة",
+ "markAsFixed": "تحديد كإصلاح",
+ "iHaveArrived": "لقد وصلت",
+ "fixedRemotely": "تم الإصلاح عن بُعد",
+ "needAVisit": "بحاجة إلى زيارة",
+ "solutions": "الحلول",
"welcome" : "مرحبا،",
"openWhatsapp" : "الإنتقال الى الواتس اب",
"callUs" : "إتصل بنا",
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index 275ff9a3..03163f06 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -69,6 +69,21 @@
"brand": "manufacture",
"clearSearch": "Clear Search",
"closed": "Closed",
+ "close": "Close",
+ "scanOrPickAsset": "Scan or Pick Asset",
+ "attachFiles": "Attach Files",
+ "activityStatus": "Activity Status",
+ "takeAction": "Take Action",
+ "pleaseConfirmTheIssueHasBeenResolved": "Please confirm the issue has been resolved",
+ "nurseAcknowledge": "I acknowledge the completion of this work order",
+ "hours": "Hours",
+ "internal": "Internal",
+ "external": "External",
+ "addInternalActivity": "Add Internal Activity",
+ "addExternalActivity": "Add External Activity",
+ "remotely": "Remotely",
+ "workshop": "Workshop",
+ "abroad": "Abroad",
"create": "Create",
"createServiceRequest": "Create Service Request",
"delete": "Delete",
@@ -248,6 +263,18 @@
"timeAndDuration": "Time and Duration",
"assetsCondition": "Asset’s Condition",
"attachmentsAcknowledge": "Attachments & Acknowledge",
+ "up_and_running": "Up & Running",
+ "partially_down": "Partially Down",
+ "needAVisit": "Need a Visit",
+ "fixedRemotely": "Fixed Remotely",
+ "iHaveArrived": "I have arrived",
+ "verify_asset_details": "Verify Asset Details",
+ "equipment_status": "Equipment Status",
+ "failureReason": "Failure Reason",
+ "visitDateAndTime": "Visit Date & Time",
+ "markAsFixed": "Mark as Fixed",
+ "fully_down": "Fully Down",
+ "solutions": "Solutions",
"callUs" : "Call Us",
"liveChat" : "Live Chat",
"feedBack" : "Feedback",
diff --git a/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart b/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart
new file mode 100644
index 00000000..6293805e
--- /dev/null
+++ b/lib/models/helper_data_models/spare_part/activity_spare_part_model.dart
@@ -0,0 +1,64 @@
+class ActivitySparePartModel {
+ int id;
+ int workOrderId;
+ int partCatalogItemId;
+ int quantity;
+ String comment;
+ List sparePartAttachments;
+
+ ActivitySparePartModel(
+ {this.id,
+ this.workOrderId,
+ this.partCatalogItemId,
+ this.quantity,
+ this.comment,
+ this.sparePartAttachments});
+
+ ActivitySparePartModel.fromJson(Map json) {
+ id = json['id'];
+ workOrderId = json['workOrderId'];
+ partCatalogItemId = json['partCatalogItemId'];
+ quantity = json['quantity'];
+ comment = json['comment'];
+ if (json['acitiySparePartAttachments'] != null) {
+ sparePartAttachments = [];
+ json['acitiySparePartAttachments'].forEach((v) {
+ sparePartAttachments
+ .add(SparePartAttachments.fromJson(v));
+ });
+ }
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['id'] = id;
+ data['workOrderId'] = workOrderId;
+ data['partCatalogItemId'] = partCatalogItemId;
+ data['quantity'] = quantity;
+ data['comment'] = comment;
+ if (sparePartAttachments != null) {
+ data['acitiySparePartAttachments'] =
+ sparePartAttachments.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
+
+class SparePartAttachments {
+ int id;
+ String name;
+
+ SparePartAttachments({this.id, this.name});
+
+ SparePartAttachments.fromJson(Map json) {
+ id = json['id'];
+ name = json['name'];
+ }
+
+ Map toJson() {
+ final Map data = {};
+ data['id'] = id;
+ data['name'] = name;
+ return data;
+ }
+}
diff --git a/lib/models/helper_data_models/workorder/mark_as_fixed_model.dart b/lib/models/helper_data_models/workorder/mark_as_fixed_model.dart
new file mode 100644
index 00000000..a44cb687
--- /dev/null
+++ b/lib/models/helper_data_models/workorder/mark_as_fixed_model.dart
@@ -0,0 +1,23 @@
+class MarkAsFixed {
+ int workOrderId;
+ String feedback;
+
+ MarkAsFixed({
+ this.workOrderId,
+ this.feedback,
+ });
+
+ factory MarkAsFixed.fromJson(Map json) {
+ return MarkAsFixed(
+ workOrderId: json['workOrderId'],
+ feedback: json['feedback'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'workOrderId': workOrderId,
+ 'feedback': feedback,
+ };
+ }
+}
diff --git a/lib/models/lookup.dart b/lib/models/lookup.dart
index 0878bae1..8552e081 100644
--- a/lib/models/lookup.dart
+++ b/lib/models/lookup.dart
@@ -25,6 +25,7 @@ class Lookup extends Base {
}
factory Lookup.fromJson(Map parsedJson) {
+
if (parsedJson == null) return null;
return Lookup(
name: parsedJson["name"],
diff --git a/lib/models/new_models/workOrderDetail.dart b/lib/models/new_models/workOrderDetail.dart
index 2841f195..249570c8 100644
--- a/lib/models/new_models/workOrderDetail.dart
+++ b/lib/models/new_models/workOrderDetail.dart
@@ -1,3 +1,5 @@
+import 'package:test_sa/models/lookup.dart';
+
class WorkOrderDetail {
WorkOrder data;
String message;
@@ -42,20 +44,20 @@ class WorkOrder {
WorkOrderCreatedBy workOrderCreatedBy;
DateTime requestedDate;
Asset asset;
- AssetGroup assetGroup;
- Manufacturer manufacturer;
- Model model;
- AssetNDModel assetNDModel;
+ Lookup assetGroup;
+ Lookup manufacturer;
+ Lookup model;
+ Lookup assetNDModel;
Site site;
- Building building;
- Floor floor;
- Department department;
+ Lookup building;
+ Lookup floor;
+ Lookup department;
dynamic room;
- AssetType assetType;
+ Lookup assetType;
AssignedEmployee assignedEmployee;
dynamic lastActivityStatus;
- Status status;
- NextStep nextStep;
+ Lookup status;
+ Lookup nextStep;
dynamic assetVerificationType;
List workOrderContactPerson;
EquipmentStatus equipmentStatus;
@@ -128,20 +130,20 @@ class WorkOrder {
workOrderCreatedBy: WorkOrderCreatedBy.fromJson(json['workOrderCreatedBy']),
requestedDate: DateTime.parse(json['requestedDate']),
asset: Asset.fromJson(json['asset']),
- assetGroup: AssetGroup.fromJson(json['assetGroup']),
- manufacturer: Manufacturer.fromJson(json['manufacturer']),
- model: Model.fromJson(json['model']),
- assetNDModel: AssetNDModel.fromJson(json['assetNDModel']),
+ assetGroup: json['assetGroup']??Lookup.fromJson(json['assetGroup']),
+ manufacturer:json['manufacturer']?? Lookup.fromJson(json['manufacturer']),
+ model: json['model']?? Lookup.fromJson(json['model']),
+ assetNDModel:json['assetNDModel']?? Lookup.fromJson(json['assetNDModel']),
site: Site.fromJson(json['site']),
- building: Building.fromJson(json['building']),
- floor: Floor.fromJson(json['floor']),
- department: Department.fromJson(json['department']),
+ building: json['building']??Lookup.fromJson(json['building']),
+ floor: json['floor']??Lookup.fromJson(json['floor']),
+ department:json['department']?? Lookup.fromJson(json['department']),
room: json['room'],
- assetType: AssetType.fromJson(json['assetType']),
+ assetType: json['assetType']??Lookup.fromJson(json['assetType']),
assignedEmployee: AssignedEmployee.fromJson(json['assignedEmployee']),
lastActivityStatus: json['lastActivityStatus'],
- status: Status.fromJson(json['status']),
- nextStep: NextStep.fromJson(json['nextStep']),
+ status: json['status']??Lookup.fromJson(json['status']),
+ nextStep: json['nextStep']??Lookup.fromJson(json['nextStep']),
assetVerificationType: json['assetVerificationType'],
workOrderContactPerson: (json['workOrderContactPerson'] as List)
.map((i) => WorkOrderContactPerson.fromJson(i))
@@ -257,262 +259,6 @@ class Asset {
}
}
-class AssetGroup {
- int id;
- String name;
-
- AssetGroup({this.id, this.name});
-
- factory AssetGroup.fromJson(Map json) {
- return AssetGroup(
- id: json['id'],
- name: json['name'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- };
- }
-
-}
-
-class Manufacturer {
- int id;
- String name;
-
- Manufacturer({this.id, this.name});
-
- factory Manufacturer.fromJson(Map json) {
- return Manufacturer(
- id: json['id'],
- name: json['name'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- };
- }
-}
-
-class Model {
- int id;
- String name;
-
- Model({this.id, this.name});
-
- factory Model.fromJson(Map json) {
- return Model(
- id: json['id'],
- name: json['name'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- };
- }
-}
-
-class AssetNDModel {
- int id;
- String name;
-
- AssetNDModel({this.id, this.name});
-
- factory AssetNDModel.fromJson(Map json) {
- return AssetNDModel(
- id: json['id'],
- name: json['name'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- };
- }
-}
-
-class Site {
- int id;
- String siteName;
-
- Site({this.id, this.siteName});
-
- factory Site.fromJson(Map json) {
- return Site(
- id: json['id'],
- siteName: json['siteName'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'siteName': siteName,
- };
- }
-}
-
-class Building {
- int id;
- String name;
- int value;
-
- Building({this.id, this.name, this.value});
-
- factory Building.fromJson(Map json) {
- return Building(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
-
-class Floor {
- int id;
- String name;
- int value;
-
- Floor({this.id, this.name, this.value});
-
- factory Floor.fromJson(Map json) {
- return Floor(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
-
-class Department {
- int id;
- String name;
-
- Department({this.id, this.name});
-
- factory Department.fromJson(Map json) {
- return Department(
- id: json['id'],
- name: json['name'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- };
- }
-}
-
-class AssetType {
- int id;
- String name;
- int value;
-
- AssetType({this.id, this.name, this.value});
-
- factory AssetType.fromJson(Map json) {
- return AssetType(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
-
-class AssignedEmployee {
- String id;
- String userName;
-
- AssignedEmployee({this.id, this.userName});
-
- factory AssignedEmployee.fromJson(Map json) {
- return AssignedEmployee(
- id: json['id'],
- userName: json['userName'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'userName': userName,
- };
- }
-}
-
-class Status {
- int id;
- String name;
- int value;
-
- Status({this.id, this.name, this.value});
-
- factory Status.fromJson(Map json) {
- return Status(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
-
-class NextStep {
- int id;
- String name;
- int value;
-
- NextStep({this.id, this.name, this.value});
-
- factory NextStep.fromJson(Map json) {
- return NextStep(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
-
class WorkOrderContactPerson {
int id;
String name;
@@ -585,6 +331,266 @@ class ContactUser {
}
}
+class AssignedEmployee {
+ String id;
+ String userName;
+
+ AssignedEmployee({this.id, this.userName});
+
+ factory AssignedEmployee.fromJson(Map json) {
+ return AssignedEmployee(
+ id: json['id'],
+ userName: json['userName'],
+ );
+ }
+ Map toJson() {
+ return {
+ 'id': id,
+ 'userName': userName,
+ };
+ }
+}
+
+class Site {
+ int id;
+ String siteName;
+
+ Site({this.id, this.siteName});
+
+ factory Site.fromJson(Map json) {
+ return Site(
+ id: json['id'],
+ siteName: json['siteName'],
+ );
+ }
+ Map toJson() {
+ return {
+ 'id': id,
+ 'siteName': siteName,
+ };
+ }
+}
+
+///
+
+// class AssetGroup {
+// int id;
+// String name;
+//
+// AssetGroup({this.id, this.name});
+//
+// factory AssetGroup.fromJson(Map json) {
+// return AssetGroup(
+// id: json['id'],
+// name: json['name'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// };
+// }
+//
+// }
+//
+// class Manufacturer {
+// int id;
+// String name;
+//
+// Manufacturer({this.id, this.name});
+//
+// factory Manufacturer.fromJson(Map json) {
+// return Manufacturer(
+// id: json['id'],
+// name: json['name'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// };
+// }
+// }
+//
+// class Model {
+// int id;
+// String name;
+//
+// Model({this.id, this.name});
+//
+// factory Model.fromJson(Map json) {
+// return Model(
+// id: json['id'],
+// name: json['name'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// };
+// }
+// }
+//
+// class AssetNDModel {
+// int id;
+// String name;
+//
+// AssetNDModel({this.id, this.name});
+//
+// factory AssetNDModel.fromJson(Map json) {
+// return AssetNDModel(
+// id: json['id'],
+// name: json['name'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// };
+// }
+// }
+//
+// class Building {
+// int id;
+// String name;
+// int value;
+//
+// Building({this.id, this.name, this.value});
+//
+// factory Building.fromJson(Map json) {
+// return Building(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
+//
+// class Floor {
+// int id;
+// String name;
+// int value;
+//
+// Floor({this.id, this.name, this.value});
+//
+// factory Floor.fromJson(Map json) {
+// return Floor(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
+//
+// class Department {
+// int id;
+// String name;
+//
+// Department({this.id, this.name});
+//
+// factory Department.fromJson(Map json) {
+// return Department(
+// id: json['id'],
+// name: json['name'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// };
+// }
+// }
+//
+// class AssetType {
+// int id;
+// String name;
+// int value;
+//
+// AssetType({this.id, this.name, this.value});
+//
+// factory AssetType.fromJson(Map json) {
+// return AssetType(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
+//
+// class Status {
+// int id;
+// String name;
+// int value;
+//
+// Status({this.id, this.name, this.value});
+//
+// factory Status.fromJson(Map json) {
+// return Status(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
+//
+// class NextStep {
+// int id;
+// String name;
+// int value;
+//
+// NextStep({this.id, this.name, this.value});
+//
+// factory NextStep.fromJson(Map json) {
+// return NextStep(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
+
+
+
class EquipmentStatus {
int id;
@@ -694,11 +700,11 @@ class ProblemDescription {
class WorkOrderHistory {
int id;
- WorkOrderStatus workOrderStatus;
+ Lookup workOrderStatus;
dynamic activityStatus; // Since activityStatus is null, it's dynamic
String date;
HistoryUser user;
- Step step;
+ Lookup step;
dynamic fixRemotelyStartTime; // Since it's null, it's dynamic
dynamic fixRemotelyEndTime; // Since it's null, it's dynamic
dynamic fixRemotelyWorkingHours; // Since it's null, it's dynamic
@@ -722,11 +728,12 @@ class WorkOrderHistory {
factory WorkOrderHistory.fromJson(Map json) {
return WorkOrderHistory(
id: json['id'],
- workOrderStatus: WorkOrderStatus.fromJson(json['workorderStatus']),
+ //json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
+ workOrderStatus:json['workorderStatus']??Lookup.fromJson(json['workorderStatus']),
activityStatus: json['activityStatus'],
date: json['date'],
user: HistoryUser.fromJson(json['user']),
- step: Step.fromJson(json['step']),
+ step: json['step']??Lookup.fromJson(json['step']),
fixRemotelyStartTime: json['fixRemotlyStartTime'],
fixRemotelyEndTime: json['fixRemotlyEndTime'],
fixRemotelyWorkingHours: json['fixRemotlyWorkingHours'],
@@ -738,6 +745,7 @@ class WorkOrderHistory {
Map toJson() {
return {
'id': id,
+ // Lookup.fromJson(json['workorderStatus'])
'workorderStatus': workOrderStatus.toJson(),
'activityStatus': activityStatus,
'date': date,
@@ -752,33 +760,33 @@ class WorkOrderHistory {
}
}
-class WorkOrderStatus {
- int id;
- String name;
- int value;
-
- WorkOrderStatus({
- this.id,
- this.name,
- this.value,
- });
-
- factory WorkOrderStatus.fromJson(Map json) {
- return WorkOrderStatus(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
-
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
+// class WorkOrderStatus {
+// int id;
+// String name;
+// int value;
+//
+// WorkOrderStatus({
+// this.id,
+// this.name,
+// this.value,
+// });
+//
+// factory WorkOrderStatus.fromJson(Map json) {
+// return WorkOrderStatus(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+//
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
class HistoryUser {
String id;
@@ -804,31 +812,31 @@ class HistoryUser {
}
}
-class Step {
- int id;
- String name;
- int value;
-
- Step({
- this.id,
- this.name,
- this.value,
- });
-
- factory Step.fromJson(Map json) {
- return Step(
- id: json['id'],
- name: json['name'],
- value: json['value'],
- );
- }
-
- Map toJson() {
- return {
- 'id': id,
- 'name': name,
- 'value': value,
- };
- }
-}
+// class Step {
+// int id;
+// String name;
+// int value;
+//
+// Step({
+// this.id,
+// this.name,
+// this.value,
+// });
+//
+// factory Step.fromJson(Map json) {
+// return Step(
+// id: json['id'],
+// name: json['name'],
+// value: json['value'],
+// );
+// }
+//
+// Map toJson() {
+// return {
+// 'id': id,
+// 'name': name,
+// 'value': value,
+// };
+// }
+// }
diff --git a/lib/new_views/app_style/app_color.dart b/lib/new_views/app_style/app_color.dart
index 534cef25..1e57e0c8 100644
--- a/lib/new_views/app_style/app_color.dart
+++ b/lib/new_views/app_style/app_color.dart
@@ -50,6 +50,7 @@ class AppColor {
static const Color red40 = Color(0xffFFDBDC);
static const Color red50 = Color(0xffD02127);
static const Color red60 = Color(0xff8C050A);
+ static const Color red70 = Color(0xffF63939);
//green
static const Color green40 = Color(0xffBAFFE1);
diff --git a/lib/new_views/common_widgets/app_bottom_nav_bar.dart b/lib/new_views/common_widgets/app_bottom_nav_bar.dart
index a78839dd..13da57ae 100644
--- a/lib/new_views/common_widgets/app_bottom_nav_bar.dart
+++ b/lib/new_views/common_widgets/app_bottom_nav_bar.dart
@@ -26,7 +26,7 @@ class AppBottomNavigationBar extends StatelessWidget {
child: BottomNavigationBar(
items: [
navBarItem(context, index: 0, iconName: "overview", label: context.translation.overview),
- navBarItem(context, index: 1, iconName: "requests", label: context.translation.request),
+ navBarItem(context, index: 1, iconName: "request_icon", label: context.translation.request),
if (!isEngineer) navBarItem(context, index: 2, iconName: "add_icon", label: context.translation.calendar, showLabel: false),
navBarItem(context, index: !isEngineer ? 3 : 2, iconName: "assets", label: context.translation.assets),
navBarItem(context, index: !isEngineer ? 4 : 3, iconName: "contact", label: context.translation.contact),
diff --git a/lib/new_views/common_widgets/app_dashed_button.dart b/lib/new_views/common_widgets/app_dashed_button.dart
index 757d9d77..9fc2f841 100644
--- a/lib/new_views/common_widgets/app_dashed_button.dart
+++ b/lib/new_views/common_widgets/app_dashed_button.dart
@@ -11,9 +11,10 @@ class AppDashedButton extends StatelessWidget {
final String title;
final VoidCallback onPressed;
double height;
+ Color buttonColor;
Widget icon;
- AppDashedButton({@required this.title, @required this.onPressed, Key key,this.height,this.icon}) : super(key: key);
+ AppDashedButton({@required this.title, @required this.onPressed, Key key,this.height,this.icon,this.buttonColor}) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -25,7 +26,7 @@ class AppDashedButton extends StatelessWidget {
child: DottedBorder(
strokeWidth: 1,
padding: EdgeInsets.symmetric(vertical: 16.toScreenHeight, horizontal: 16.toScreenWidth),
- color: context.isDark ? AppColor.primary40 : AppColor.black20,
+ color: context.isDark ? AppColor.primary40 : buttonColor?? AppColor.black20,
dashPattern: const [4, 3],
radius: const Radius.circular(10),
borderType: BorderType.RRect,
@@ -35,10 +36,10 @@ class AppDashedButton extends StatelessWidget {
children: [
icon,
7.width,
- title.heading6(context).custom(color: context.isDark ? AppColor.primary40 : AppColor.black10).center,
+ title.heading6(context).custom(color: context.isDark ? AppColor.primary40 : buttonColor??AppColor.black10).center,
],
):
- title.heading6(context).custom(color: context.isDark ? AppColor.primary40 : AppColor.primary10).center,
+ title.heading6(context).custom(color: context.isDark ? AppColor.primary40 : buttonColor?? AppColor.primary10).center,
),
).onPress(onPressed);
}
diff --git a/lib/new_views/common_widgets/app_filled_button.dart b/lib/new_views/common_widgets/app_filled_button.dart
index a9d46b53..a1f8577f 100644
--- a/lib/new_views/common_widgets/app_filled_button.dart
+++ b/lib/new_views/common_widgets/app_filled_button.dart
@@ -11,13 +11,17 @@ class AppFilledButton extends StatelessWidget {
final Color buttonColor;
final Color textColor;
final bool showBorder;
+ final bool showIcon;
+ final Widget icon;
const AppFilledButton({
@required this.onPressed,
@required this.label,
this.maxWidth = false,
+ this.icon,
this.loading = false,
this.showBorder = false,
+ this.showIcon = false,
this.buttonColor,
this.textColor,
Key key,
@@ -43,7 +47,18 @@ class AppFilledButton extends StatelessWidget {
strokeWidth: 2,
),
)
- : label.heading6(context).custom(color: textColor ?? AppColor.background(context)),
+ : showIcon&&icon!=null?
+ Center(
+ child: Row(
+ mainAxisSize:MainAxisSize.min,
+ children: [
+ icon,
+ 8.width,
+ label.heading6(context).custom(color: textColor ?? AppColor.background(context))
+ ],
+ ),
+ ):
+ label.heading6(context).custom(color: textColor ?? AppColor.background(context)),
).onPress(onPressed);
}
}
diff --git a/lib/new_views/pages/land_page/land_page.dart b/lib/new_views/pages/land_page/land_page.dart
index 82967ba0..2fb2ad43 100644
--- a/lib/new_views/pages/land_page/land_page.dart
+++ b/lib/new_views/pages/land_page/land_page.dart
@@ -1,3 +1,4 @@
+import 'dart:developer';
import 'dart:io';
import 'package:flutter/material.dart';
diff --git a/lib/service_request_latest/request_detail_provider.dart b/lib/service_request_latest/request_detail_provider.dart
index 216efe9a..efd32140 100644
--- a/lib/service_request_latest/request_detail_provider.dart
+++ b/lib/service_request_latest/request_detail_provider.dart
@@ -1,25 +1,16 @@
+import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:flutter/material.dart';
-import 'package:fluttertoast/fluttertoast.dart';
-import 'package:http/http.dart';
import 'package:test_sa/controllers/api_routes/api_manager.dart';
import 'package:test_sa/controllers/api_routes/urls.dart';
-import 'package:test_sa/extensions/context_extension.dart';
-import 'package:test_sa/extensions/string_extensions.dart';
+import 'package:test_sa/models/helper_data_models/spare_part/activity_spare_part_model.dart';
import 'package:test_sa/models/helper_data_models/workorder/fix_remotely_model.dart';
+import 'package:test_sa/models/helper_data_models/workorder/mark_as_fixed_model.dart';
import 'package:test_sa/models/helper_data_models/workorder/need_visit_model.dart';
import 'package:test_sa/models/helper_data_models/workorder/nurse_action_model.dart';
import 'package:test_sa/models/new_models/dashboard_detail.dart';
import 'package:test_sa/models/new_models/workOrderDetail.dart';
-import 'package:test_sa/models/service_request/service_report.dart';
-import 'package:test_sa/models/service_request/service_request.dart';
-import 'package:test_sa/models/service_request/spare_parts.dart';
-import 'package:test_sa/models/service_request/supp_engineer_work_orders.dart';
-import 'package:test_sa/models/service_request/supplier_engineer_model.dart';
-import '../../../models/service_request/wo_call_request.dart';
-import '../../../models/user.dart';
-import '../../../new_views/common_widgets/app_lazy_loading.dart';
class RequestDetailProvider extends ChangeNotifier {
final pageItemNumber = 10;
@@ -28,6 +19,33 @@ class RequestDetailProvider extends ChangeNotifier {
stateCode = null;
}
+ DateTime timerStartTime = DateTime(0, 0, 0, 0, 0, 0); // Start from 00:00:00
+ Timer timer;
+ bool isTimerRunning = false;
+
+ void startTimer() {
+ if (isTimerRunning) return;
+ timer = Timer.periodic(const Duration(seconds: 1), (Timer t) {
+ timerStartTime = timerStartTime.add(const Duration(seconds: 1));
+ notifyListeners(); // Notify UI when time is updated
+ });
+ isTimerRunning = true;
+ notifyListeners(); // Notify UI when timer starts
+ }
+
+ void stopTimer() {
+ timer?.cancel();
+ isTimerRunning = false;
+ notifyListeners(); // Notify UI when timer stops
+ }
+
+ void resetTimer() {
+ timerStartTime = DateTime(0, 0, 0, 0, 0, 0); // Reset to 00:00:00
+ notifyListeners();
+ }
+
+ // Getter to get the current time
+ DateTime get currentTime => timerStartTime;
bool _isLoading = false;
@@ -41,6 +59,23 @@ class RequestDetailProvider extends ChangeNotifier {
WorkOrderDetail _currentWorkOrder;
FixRemotely _fixRemotelyModel;
NeedVisit _needVisitModel;
+ MarkAsFixed _markAsFixed;
+ ActivitySparePartModel _activitySparePartModel;
+
+ ActivitySparePartModel get activitySparePartModel => _activitySparePartModel;
+
+ set activitySparePartModel(ActivitySparePartModel value) {
+ _activitySparePartModel = value;
+ notifyListeners();
+ }
+
+ MarkAsFixed get markAsFixed => _markAsFixed;
+
+ set markAsFixed(MarkAsFixed value) {
+ _markAsFixed = value;
+ notifyListeners();
+ }
+
NurseActionModel _nurseActionModel;
@@ -83,8 +118,6 @@ class RequestDetailProvider extends ChangeNotifier {
_selectedTime = value;
notifyListeners();
} // list of user requests
-
- SparePartsWorkOrders _initialSelectedSparePart = SparePartsWorkOrders();
int _selectedListIndex = 0;
int get selectedListIndex => _selectedListIndex;
@@ -219,6 +252,30 @@ class RequestDetailProvider extends ChangeNotifier {
return CommonResponseModel();
}
}
+ //engineerMarkAsFixed......
+ Future engineerMarkAsFixed() async {
+ try {
+ isLoading = true;
+ final response = await ApiManager.instance.post(URLs.engineerMarkAsFixUrl,body: markAsFixed.toJson());
+ stateCode = response.statusCode;
+ if (response.statusCode >= 200 && response.statusCode < 300) {
+ CommonResponseModel commonResponseModel = CommonResponseModel.fromJson(json.decode(response.body));
+ print('response of Engineer mark as fixed ${commonResponseModel.toJson()}');
+ notifyListeners();
+ isLoading = false;
+ return commonResponseModel;
+ }
+ isLoading= false;
+ notifyListeners();
+ return CommonResponseModel();
+ }
+ catch (e) {
+ log("engineer accept [error] : $e");
+ isLoading = false;
+ notifyListeners();
+ return CommonResponseModel();
+ }
+ }
//assignEngineerToWorkOrder......
Future assignEngineerWorkOrder({@required String workOrderId,@required String engineerId}) async {
try {
@@ -297,74 +354,12 @@ class RequestDetailProvider extends ChangeNotifier {
}
- Future updateRequest({@required User user, @required ServiceRequest request}) async {
+ Future updateActivitySparePart({@required ActivitySparePartModel activitySparePartModel}) async {
isLoading = true;
- notifyListeners();
- Map serviceRequest = await getWorkOrderById(id: request.id) ?? "";
- final List callSiteContacts = (serviceRequest['callSiteContactPerson'] as List);
- final Map callSiteContactPerson = callSiteContacts.isEmpty ? {} : callSiteContacts[0];
- Response response;
try {
- if ((request.audio ?? "").isNotEmpty) {
- request.audio = request.audio.substring(request.audio.indexOf("=") + 1, request.audio.length);
- }
- } catch (ex) {}
-
- var body = {
- "id": request.id,
- "callNo": serviceRequest['callNo'],
- "callCreatedBy": serviceRequest['callCreatedBy'],
- "requestedDate": request.date ?? "",
- "requestedTime": request.date ?? "",
- "priority": request.priority?.toJson(),
- "defectType": request.defectType?.toJson(),
- "typeofRequest": request.type?.toJson(),
- "requestedThrough": request.requestedThrough?.toJson(),
- "voiceNote": request.audio,
- "assets": request.deviceId == null ? [] : [request.deviceId],
- "attachmentsCallRequest": (request.devicePhotos?.isNotEmpty ?? false) ? request.devicePhotos?.map((e) => {"name": e.getFileName})?.toList() : [],
- "assignedEmployee": {
- "id": request.engineerId,
- "name": request.engineerName,
- },
- "callSiteContactPerson": [
- {
- "id": callSiteContactPerson['id'] ?? 0,
- "employeeCode": callSiteContactPerson['employeeCode'],
- "name": callSiteContactPerson['name'] ?? user.userName,
- "telephone": callSiteContactPerson['telephone'] ?? user.phoneNumber,
- "job": callSiteContactPerson['job'],
- "email": callSiteContactPerson['email'] ?? user.email,
- "land": callSiteContactPerson['land'],
- "contactUserId": user.userID,
- },
- ],
- "callComments": request.callComments,
- "noofFollowup": 0,
- "status": request.statusId == null
- ? null
- : {
- "id": request.statusId,
- "name": request.statusLabel,
- "value": request.statusValue,
- },
- "callLastSituation": null,
- "firstAction": request.firstAction?.toJson(),
- "loanAvailablity": request.loanAvailability?.toJson(),
- "comments": request.comments,
- "firstActionDate": request.visitDate,
- "visitDate": request.visitDate,
- "startDate": request.startDate,
- "endDate": request.endDate,
- "workingHours": request.workingHours,
- "callReview": null,
- "reviewComment": null,
- //"reviewComment": request.reviewComment,
- };
- try {
- response = await ApiManager.instance.put(
- URLs.updateRequestDate,
- body: body,
+ final response = await ApiManager.instance.put(
+ URLs.updateActivitySparePartUrl,
+ body: activitySparePartModel.toJson(),
);
stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
@@ -380,71 +375,50 @@ class RequestDetailProvider extends ChangeNotifier {
return -1;
}
}
-
- Future createServiceReport(BuildContext context, {@required ServiceReport report, @required User user, @required ServiceRequest request}) async {
- Response response;
+ Future deleteActivitySparePart({@required int id,@required int workOrderId}) async {
+ isLoading = true;
+ var body = {
+ 'id':id,
+ 'workOrderId':workOrderId,
+ };
try {
- showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
- final body = report.toJson();
- final callRequest = CallRequest(id: num.tryParse(request?.id ?? "")).toJson();
- final contactPerson = [
- {
- "id": 0,
- // "employeeCode": "",
- "name": user.userName,
- "telephone": user.phoneNumber,
- // "job": "",
- "email": user.email,
- // "land": "",
- "contactUserId": user.userID,
- }
- ];
- body.update("contactPersonWorkOrders", (value) => contactPerson, ifAbsent: () => contactPerson);
- body.update("callRequest", (value) => callRequest, ifAbsent: () => callRequest);
- response = await ApiManager.instance.post(URLs.createServiceReport, body: body);
+ final response = await ApiManager.instance.post(
+ URLs.deleteActivitySparePartUrl,
+ body: body,
+ );
stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
- reset();
+ //map to the model...
notifyListeners();
- Fluttertoast.showToast(msg: context.translation.successfulRequestMessage);
- Navigator.of(context).pop();
- } else {
- Fluttertoast.showToast(msg: "${context.translation.failedToCompleteRequest}: ${json.decode(response.body)['message']}");
}
- Navigator.pop(context);
+ isLoading = false;
+ notifyListeners();
return response.statusCode;
} catch (error) {
- Navigator.pop(context);
- print(error);
+ isLoading = false;
+ notifyListeners();
return -1;
}
}
-
- Future addSupplierEngineer(SupplierEngineer supplierEngineer) async {
+ Future createActivitySparePart({@required ActivitySparePartModel activitySparePartModel}) async {
isLoading = true;
- notifyListeners();
- Response response;
- SuppEngineerWorkOrders res;
try {
- response = await ApiManager.instance.post(URLs.addSupplierEngineer, body: supplierEngineer.toJson());
+ final response = await ApiManager.instance.put(
+ URLs.createActivitySparePartUrl,
+ body: activitySparePartModel.toJson(),
+ );
stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
- res = SuppEngineerWorkOrders.fromJson(json.decode(response.body)["data"]);
+ // request.engineerName = employee.name;
+ notifyListeners();
}
isLoading = false;
notifyListeners();
- return res;
+ return response.statusCode;
} catch (error) {
isLoading = false;
notifyListeners();
- return res;
+ return -1;
}
}
-
- SparePartsWorkOrders get initialSelectedSparePart => _initialSelectedSparePart;
-
- set initialSelectedSparePart(SparePartsWorkOrders value) {
- _initialSelectedSparePart = value;
- notifyListeners();
- }
}
diff --git a/lib/service_request_latest/views/components/action_button/footer_action_button.dart b/lib/service_request_latest/views/components/action_button/footer_action_button.dart
new file mode 100644
index 00000000..09b6b349
--- /dev/null
+++ b/lib/service_request_latest/views/components/action_button/footer_action_button.dart
@@ -0,0 +1,165 @@
+import 'package:flutter/material.dart';
+import 'package:test_sa/extensions/context_extension.dart';
+import 'package:test_sa/extensions/int_extensions.dart';
+import 'package:test_sa/extensions/text_extensions.dart';
+import 'package:test_sa/extensions/widget_extensions.dart';
+import 'package:test_sa/new_views/app_style/app_color.dart';
+import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
+import 'package:test_sa/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart';
+
+class FooterActionButton {
+
+ static Widget footerContainer({@required Widget child}){
+ return Align(
+ alignment: Alignment.bottomCenter,
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth,vertical: 16.toScreenHeight),
+ color: AppColor.white10,
+ child: child,
+ ),
+ );
+ }
+
+ static Widget footerWidget({@required int status,@required BuildContext context}){
+ switch(status){
+ //accept reject...
+ case 1:
+ return footerContainer(
+ child:
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ AppFilledButton(
+ label: context.translation.reject,
+ maxWidth: true,
+ buttonColor: Colors.white54,
+ textColor: AppColor.red30,
+ showBorder: true,
+ onPressed: () async {
+ ServiceRequestBottomSheet.rejectRequestBottomSheet(context: context);
+ },
+ ).expanded,
+ const SizedBox(
+ width: 20,
+ ),
+ AppFilledButton(
+ label: context.translation.accept,
+ maxWidth: true,
+ buttonColor: AppColor.green70,
+ onPressed: () async {
+ },
+ ).expanded,
+ ],
+ )
+ );
+ break;
+ //need visit fixed remotely
+ case 2:
+ return footerContainer(
+ child:
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ AppFilledButton(
+ label: context.translation.needAVisit,
+ maxWidth: true,
+ buttonColor: AppColor.neutral50,
+ onPressed: () async {
+ ServiceRequestBottomSheet.initialVisitBottomSheet(context: context);
+ },
+ ).expanded,
+ const SizedBox(
+ width: 20,
+ ),
+ AppFilledButton(
+ label: context.translation.fixedRemotely,
+ maxWidth: true,
+ buttonColor: AppColor.green70,
+ onPressed: () async {
+ ServiceRequestBottomSheet.fixRemotelyBottomSheet(context: context);
+ },
+ ).expanded,
+ ],
+ )
+ );
+ break;
+ //verify Asset Details
+ case 3:
+ return footerContainer(
+ child:
+ AppFilledButton(
+ label: context.translation.verify_asset_details,
+ // maxWidth: true,
+ buttonColor: AppColor.primary10,
+ onPressed: () async {
+
+ },
+ )
+ );
+ break;
+ //Activities
+ case 4:
+ return footerContainer(
+ child:
+ AppFilledButton(
+ label: context.translation.activities,
+ // maxWidth: true,
+ buttonColor: AppColor.neutral50,
+ onPressed: () async {
+ ServiceRequestBottomSheet.activityTypeBottomSheet(context: context);
+ },
+ )
+ );
+ break;
+ //I have arrived...
+ case 5:
+ return footerContainer(
+ child:
+ AppFilledButton(
+ label: context.translation.iHaveArrived,
+ showIcon: true,
+ icon: 'arrived_icon'.toSvgAsset(),
+ buttonColor: AppColor.green70,
+ onPressed: () async {
+
+ },
+ )
+ );
+ break;
+ //Close..
+ case 6:
+ return footerContainer(
+ child:
+ AppFilledButton(
+ label: context.translation.close,
+ // maxWidth: true,
+ buttonColor: AppColor.primary10,
+ onPressed: () async {
+
+ },
+ )
+ );
+ break;
+ //for nurse to take action...
+ case 7:
+ return footerContainer(
+ child:
+ AppFilledButton(
+ label: context.translation.takeAction,
+ // maxWidth: true,
+ buttonColor: AppColor.primary10,
+ onPressed: () async {
+
+ },
+ )
+ );
+ break;
+
+ default:
+ return const SizedBox();
+ }
+
+ }
+}
diff --git a/lib/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart b/lib/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart
index 599854c6..3954fcf1 100644
--- a/lib/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart
+++ b/lib/service_request_latest/views/components/bottom_sheets/service_request_bottomsheet.dart
@@ -1,15 +1,14 @@
import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:test_sa/app_strings/app_asset.dart';
-import 'package:test_sa/controllers/providers/api/user_provider.dart';
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
-import 'package:test_sa/models/device/asset.dart';
import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/service_request/service_request.dart';
import 'package:test_sa/models/timer_model.dart';
@@ -18,215 +17,13 @@ import 'package:test_sa/providers/service_request_providers/first_action_provide
import 'package:test_sa/service_request_latest/views/forms/spare_part/spare_part_request.dart';
import 'package:test_sa/service_request_latest/views/components/verify_arrival_view.dart';
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
-import 'package:test_sa/views/widgets/date_and_time/time_picker.dart';
+import 'package:test_sa/views/widgets/e_signature/e_signature.dart';
import 'package:test_sa/views/widgets/timer/app_timer.dart';
import '../../../../controllers/providers/api/service_requests_provider.dart';
import '../../../../new_views/app_style/app_color.dart';
import '../../../../new_views/common_widgets/app_filled_button.dart';
import '../../../../new_views/common_widgets/app_text_form_field.dart';
-// class FixRemotlyBottomSheet extends StatelessWidget {
-//
-// FixRemotlyBottomSheet({Key key,}) : super(key: key);
-//
-// final GlobalKey _formKey = GlobalKey();
-//
-// @override
-// Widget build(BuildContext context) {
-// return Consumer(
-// builder: (context, serviceRequestProvider,child) {
-// return StatefulBuilder(
-// builder: (BuildContext context, StateSetter setState) {
-// return Container(
-// clipBehavior: Clip.antiAlias,
-// margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
-// decoration: BoxDecoration(
-// color: AppColor.background(context),
-// borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
-// ),
-// padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
-// child: Form(
-// key: _formKey,
-// child: SingleChildScrollView(
-// child: Column(
-// crossAxisAlignment: CrossAxisAlignment.start,
-// children: [
-// Center(
-// child: Container(
-// width: 40.toScreenWidth,
-// height: 5.toScreenHeight,
-// decoration: BoxDecoration(color: AppColor.neutral40, borderRadius: BorderRadius.circular(30)),
-// ),
-// ),
-// Align(
-// alignment: AlignmentDirectional.centerStart,
-// child: context.translation.fillDetails.heading5(context).custom(fontWeight: FontWeight.w500).paddingOnly(top: 16, bottom: 16),
-// ),
-//
-// 8.height,
-// ADatePicker(
-// label: context.translation.date,
-// height: 80.toScreenHeight,
-// backgroundColor: AppColor.neutral90,
-// date: DateTime.tryParse(serviceRequestProvider.serviceRequest.startDate ?? ""),
-// formatDateWithTime: true,
-// onDatePicker: (selectedDate) {
-// if (selectedDate != null) {
-// showTimePicker(
-// context: context,
-// initialTime: TimeOfDay.now(),
-// ).then((selectedTime) {
-// // Handle the selected date and time here.
-// if (selectedTime != null) {
-// DateTime selectedDateTime = DateTime(
-// selectedDate.year,
-// selectedDate.month,
-// selectedDate.day,
-// selectedTime.hour,
-// selectedTime.minute,
-// );
-// if (selectedDateTime != null) {
-// if (selectedDateTime.isBefore(DateTime.parse(serviceRequestProvider.serviceRequest.date))) {
-// "Visit Date time must be greater then request date".showToast;
-// return;
-// }
-//
-// setState(() {
-// serviceRequestProvider.serviceRequest.startDate = selectedDateTime?.toIso8601String();
-// });
-// }
-// }
-// });
-// }
-// },
-// ),
-// 8.height,
-// ATimePicker(
-// label: context.translation.startTime,
-// height: 80.toScreenHeight,
-// backgroundColor: AppColor.neutral90,
-// hint:context.translation.pickTime,
-// time: serviceRequestProvider.selectedTime,
-// onTimePicker: (selectedTime) {
-// //TODO handle selected time here.
-// if (selectedTime != null) {
-// setState(() {
-// serviceRequestProvider.selectedTime = selectedTime;
-// });
-// // DateTime selectedDateTime = DateTime(
-// // selectedDate.year,
-// // selectedDate.month,
-// // selectedDate.day,
-// // selectedTime.hour,
-// // selectedTime.minute,
-// // );
-// // if (selectedDateTime != null) {
-// // if (selectedDateTime.isBefore(DateTime.parse(serviceRequestProvider.serviceRequest.date))) {
-// // "Visit Date time must be greater then request date".showToast;
-// // return;
-// // }
-// //
-//
-// // }
-// }
-// },
-// ),
-// 8.height,
-// ATimePicker(
-// label: context.translation.endTime,
-// height: 80.toScreenHeight,
-// backgroundColor: AppColor.neutral90,
-// hint:context.translation.pickTime,
-// time: serviceRequestProvider.selectedTime,
-// onTimePicker: (selectedTime) {
-// //TODO handle selected time here.
-// if (selectedTime != null) {
-// setState(() {
-// serviceRequestProvider.selectedTime = selectedTime;
-// });
-// }
-// },
-// ),
-// 8.height,
-// Container(
-// width: double.infinity,
-// height: 80.toScreenHeight,
-// decoration: BoxDecoration(
-// borderRadius: BorderRadius.circular(10),
-// color:AppColor.neutral90,
-// boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
-// ),
-// padding: EdgeInsets.symmetric(horizontal: 20.toScreenWidth,vertical: 10.toScreenHeight),
-// child: Column(
-// crossAxisAlignment: CrossAxisAlignment.start,
-// mainAxisAlignment: MainAxisAlignment.start,
-// children: [
-// context.translation.workingHours.bodyText2(context),
-// //TODo calculate the hours and write here.
-// 'No of hours'.bodyText(context).custom(color:AppColor.balck10),
-// ],
-// ),
-//
-// ),
-// 8.height,
-// AppTextFormField(
-// labelText: context.translation.comments,
-// textInputType: TextInputType.multiline,
-// alignLabelWithHint: true,
-// backgroundColor: AppColor.neutral90,
-// onChange: (text) {
-// serviceRequestProvider.serviceRequest.comments = text;
-// },
-// onSaved: (text) {
-// serviceRequestProvider.serviceRequest.comments = text;
-// },
-// ),
-// 16.height,
-// Row(
-// mainAxisAlignment: MainAxisAlignment.spaceBetween,
-// children: [
-// SizedBox(
-// width: 200.toScreenHeight,
-// child: AppFilledButton(
-// label: context.translation.cancel,
-// loading: false,
-// buttonColor: Colors.transparent,
-// showBorder: true,
-// textColor: AppColor.balck10,
-// onPressed:
-// () async {
-// Navigator.pop(context);
-// // await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.serviceRequest);
-// // Navigator.pop(context, true);
-// },
-// ),
-// ),
-// SizedBox(
-// width: 200.toScreenHeight,
-// child: AppFilledButton(
-// label: context.translation.fixed,
-// buttonColor: AppColor.green70,
-// loading: false,
-// onPressed:(){
-//
-// },
-// ),
-// ),
-// ],
-// ),
-// 16.height,
-// ],
-// ),
-// ),
-// ),
-// );
-// }
-// );
-// }
-// );
-// }
-// }
-
class ServiceRequestBottomSheet {
static Future fixRemotelyBottomSheet({@required BuildContext context}) {
final GlobalKey _formKey = GlobalKey();
@@ -606,7 +403,6 @@ class ServiceRequestBottomSheet {
final List