From be6a418bb63a00b28925c07d597b2e9fa224b058 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 12 Jul 2023 10:22:28 +0300 Subject: [PATCH] sender & receiver transfer edit login update & fixes --- assets/subtitles/ar_subtitle.json | 23 +++------ assets/subtitles/en_subtitle.json | 23 +++------ lib/models/subtitle.dart | 6 +-- .../device_transfer_details.dart | 51 ++++++++++--------- .../report/create_service_report.dart | 2 +- .../requests/report/edit_service_report.dart | 2 +- .../pages/user/requests/request_details.dart | 2 +- 7 files changed, 49 insertions(+), 60 deletions(-) diff --git a/assets/subtitles/ar_subtitle.json b/assets/subtitles/ar_subtitle.json index e08d914f..16cad068 100644 --- a/assets/subtitles/ar_subtitle.json +++ b/assets/subtitles/ar_subtitle.json @@ -3,8 +3,6 @@ "failed_request_message": "الفشل في إكمال الطلب", "successful_request_message": "تم إكمال الطلب بنجاح", "request_lock_message": "انتظر حتى إكمال الطلب", - - "cancel": "إلغاء", "confirm": "تاكيد", "done": "تم", @@ -13,7 +11,6 @@ "sign_out": "تسجيل الخروج", "logout_alert": "هل انت متاكد من رغبتك في تسجيل الخروج؟", "language": "اللغة", - "name": "الاسم", "email": "البريد الالكتروني", "phone_number": "رقم الهاتف", @@ -29,7 +26,6 @@ "confirm_password_validate_message": "كلمة المرور و تاكيد كلمة المرور غير متطابقان", "phone_number_validate_message": "رقم الهاتف غير صالح", "terms_and_conditions_validate_message": "موافقة علي الشروط والاحكام مطاوبة", - "update": "تحديث", "step": "خطوة", "forget_password_with_mark": "نسيت كلمة المرور؟", @@ -59,7 +55,6 @@ "title_not_found": "لا يوجد عنوان", "title_validate_message": "العنوان مطلوب", "url_not_found": "لا يوجد رابط", - "date": "تاريخ", "status": "الحالة", "code": "كود", @@ -134,7 +129,6 @@ "visitDate": "تاريخ الزيارة", "whatsApp": "واتساب", "workPerformed": "العمل انجز", - "actualDate": "تاريخ الفعلي", "expectDate": "التاريخ المتوقع", "images": "الصور", @@ -164,7 +158,6 @@ "requiredImage": "الصورة مطلوبة", "taskStatus": "حالة الطلب", "activationAlert": "الحساب قيد المراجعة يرجى الانتظار حتى يتم تفعيله", - "attachImage": "ارفق صورة", "callLastSituation": "اخر موقف للطلب", "customer": "العميل", @@ -195,14 +188,14 @@ "site": "الموقع", "maintenanceSituation": "موقع الصيانه", "currentSituation": "الموقع الحالي", - "comment" : "تعليق", - "updateServiceRequest" : "تعديل طلب الخدمة", - "repairLocation" : "موقع الإصلاح", - "travelingExpense" : "مصاريف التنقل", - "startDate" : "وقت البدء", - "requestedQuantity" : "الكمية المطلوبة", - "deliveredQuantity" : "الكمية المسلّمة", - "endDate" : "وقت الانتهاء", + "comment": "تعليق", + "updateServiceRequest": "تعديل طلب الخدمة", + "repairLocation": "موقع الإصلاح", + "travelingExpense": "مصاريف التنقل", + "startDate": "وقت البدء", + "requestedQuantity": "الكمية المطلوبة", + "deliveredQuantity": "الكمية المسلّمة", + "endDate": "وقت الانتهاء", "destinationSite": "موقع الوجهه", "building": "بناء", "floor": "طابق", diff --git a/assets/subtitles/en_subtitle.json b/assets/subtitles/en_subtitle.json index 44e03fa6..d1412bf5 100644 --- a/assets/subtitles/en_subtitle.json +++ b/assets/subtitles/en_subtitle.json @@ -3,7 +3,6 @@ "failed_request_message": "Failed to complete request", "successful_request_message": "Request complete successfully", "request_lock_message": "Wait until your request complete", - "cancel": "Cancel", "confirm": "Confirm", "done": "Done", @@ -12,7 +11,6 @@ "sign_out": "Sign Out", "logout_alert": "Are you sure you want to Sign Out?", "language": "English", - "name": "Name", "email": "Email", "phone_number": "Phone Number", @@ -28,7 +26,6 @@ "confirm_password_validate_message": "Password and confirm password not match", "phone_number_validate_message": "Not valid phone number", "terms_and_conditions_validate_message": "Accept terms and conditions is required", - "update": "Update", "step": "Step", "forget_password_with_mark": "Forget Password?", @@ -58,7 +55,6 @@ "title_not_found": "Title not found", "title_validate_message": "Title Can't be empty", "url_not_found": "URL not found", - "date": "Date", "status": "Status", "code": "Code", @@ -133,7 +129,6 @@ "visitDate": "Visit Date", "whatsApp": "WhatsApp", "workPerformed": "Work Performed", - "actualDate": "Actual Date", "expectDate": "Expect Date", "images": "Images", @@ -163,7 +158,6 @@ "requiredImage": "Image Required", "taskStatus": "Task Status", "activationAlert": "Account under reviewing please wait until be activated", - "attachImage": "Attach Image", "callLastSituation": "Call's Last Situation", "customer": "Customer", @@ -180,7 +174,7 @@ "reportType": "Report Type", "callId": "Call Id", "requiredWord": "required", - "AssetType": "asset type", + "AssetType": "Asset Type", "workPreformed": "Work Preformed", "orderWorkNumber": "Order Work Number", "assignedEmployee": "Assigned Employee", @@ -190,19 +184,18 @@ "site": "Site", "maintenanceSituation": "Maintenance Situation", "currentSituation": "Current Situation", - "alert": "Alert", "duplicateAlert": "Duplicate Alert", "duplicateAlertMessage": "Are you sure you want to duplicate request?", "duplicateRequest": "Duplicate Request", - "comment" : "Comment", - "updateServiceRequest" : "Update Service Request", - "repairLocation" : "Repair Location", + "comment": "Comment", + "updateServiceRequest": "Update Service Request", + "repairLocation": "Repair Location", "travelingExpense": "Traveling Expense", - "startDate" : "Start Date", - "requestedQuantity" : "Requested Quantity", - "deliveredQuantity" : "Delivered Quantity", - "endDate" : "End Date", + "startDate": "Start Date", + "requestedQuantity": "Requested Quantity", + "deliveredQuantity": "Delivered Quantity", + "endDate": "End Date", "destinationSite": "Destination Site", "building": "Building", "floor": "Floor", diff --git a/lib/models/subtitle.dart b/lib/models/subtitle.dart index 09f6a4de..4007a7cb 100644 --- a/lib/models/subtitle.dart +++ b/lib/models/subtitle.dart @@ -196,7 +196,7 @@ class Subtitle { String customer; String reportType; String requiredWord; - String AssetType; + String assetType; String reportStatus; String callLastSituation; String invoiceNumber; @@ -421,7 +421,7 @@ class Subtitle { @required this.reasons, @required this.reportStatus, @required this.reportType, - @required this.AssetType, + @required this.assetType, @required this.workPreformed, @required this.alert, @required this.duplicateAlert, @@ -625,7 +625,7 @@ class Subtitle { reportType: parsedJson["reportType"], callId: parsedJson["callId"], requiredWord: parsedJson["requiredWord"], - AssetType: parsedJson["serviceType"], + assetType: parsedJson["AssetType"], workPreformed: parsedJson["workPreformed"], alert: parsedJson["alert"], duplicateAlert: parsedJson["duplicateAlert"], diff --git a/lib/views/pages/device_transfer/device_transfer_details.dart b/lib/views/pages/device_transfer/device_transfer_details.dart index 74ff48e7..75892db3 100644 --- a/lib/views/pages/device_transfer/device_transfer_details.dart +++ b/lib/views/pages/device_transfer/device_transfer_details.dart @@ -18,6 +18,7 @@ import 'package:test_sa/views/widgets/requests/info_row.dart'; class DeviceTransferDetails extends StatefulWidget { final DeviceTransfer model; + const DeviceTransferDetails({Key key, this.model}) : super(key: key); @override @@ -47,8 +48,8 @@ class _DeviceTransferDetailsState extends State { _userProvider = Provider.of(context); _settingProvider = Provider.of(context); _deviceTransferProvider = Provider.of(context); - _isSender = _userProvider.user.id == widget.model.sender?.userId; - _isReceiver = _userProvider.user.id == widget.model.receiver?.userId; + _isSender = _userProvider.user.userID == widget.model.sender?.userId; + _isReceiver = _userProvider.user.userID == widget.model.receiver?.userId; return Scaffold( key: _scaffoldKey, body: SafeArea( @@ -131,17 +132,18 @@ class _DeviceTransferDetailsState extends State { Expanded( child: Text("Sender", style: Theme.of(context).textTheme.headline6), ), - if (_isSender || true) - ASmallButton( - text: _subtitle.edit, - onPressed: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (_) => UpdateDeviceTransfer( - model: widget.model, - isSender: true, - ))); - }, - ), + ASmallButton( + text: _subtitle.edit, + onPressed: (_isSender || false) + ? () { + Navigator.of(context).push(MaterialPageRoute( + builder: (_) => UpdateDeviceTransfer( + model: widget.model, + isSender: true, + ))); + } + : null, + ), ], ), const SizedBox(height: 12), @@ -154,17 +156,18 @@ class _DeviceTransferDetailsState extends State { Expanded( child: Text("Receiver", style: Theme.of(context).textTheme.headline6), ), - if (_isReceiver || true) - ASmallButton( - text: _subtitle.edit, - onPressed: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (_) => UpdateDeviceTransfer( - model: widget.model, - isSender: false, - ))); - }, - ), + ASmallButton( + text: _subtitle.edit, + onPressed: (_isReceiver || false) + ? () { + Navigator.of(context).push(MaterialPageRoute( + builder: (_) => UpdateDeviceTransfer( + model: widget.model, + isSender: false, + ))); + } + : null, + ), ], ), const SizedBox(height: 12), diff --git a/lib/views/pages/user/requests/report/create_service_report.dart b/lib/views/pages/user/requests/report/create_service_report.dart index b8fa12e9..8ff8b431 100644 --- a/lib/views/pages/user/requests/report/create_service_report.dart +++ b/lib/views/pages/user/requests/report/create_service_report.dart @@ -281,7 +281,7 @@ class _CreateServiceReportState extends State with TickerPr const SizedBox( height: 8, ), - ASubTitle(_subtitle.AssetType), + ASubTitle(_subtitle.assetType ??""), _validate && _serviceReport.assetType == null ? ASubTitle( _subtitle.requiredWord, 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 7cd53f7a..5cba224b 100644 --- a/lib/views/pages/user/requests/report/edit_service_report.dart +++ b/lib/views/pages/user/requests/report/edit_service_report.dart @@ -278,7 +278,7 @@ class _EditServiceReportState extends State with TickerProvid ), ), const SizedBox(height: 8), - ASubTitle(_subtitle.AssetType), + ASubTitle(_subtitle.assetType), _validate && _serviceReport.assetType == null ? ASubTitle( _subtitle.requiredWord, diff --git a/lib/views/pages/user/requests/request_details.dart b/lib/views/pages/user/requests/request_details.dart index 18b4700f..61e835b2 100644 --- a/lib/views/pages/user/requests/request_details.dart +++ b/lib/views/pages/user/requests/request_details.dart @@ -397,7 +397,7 @@ class RequestDetailsPage extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(32), child: AButton( - text: "Create Report", + text: "Create Work Order", onPressed: () { Navigator.of(context).push(MaterialPageRoute(builder: (_) => CreateServiceReport(request: serviceRequest))); },