Compare commits

..

2 Commits

@ -73,14 +73,14 @@ class _DashboardViewState extends State<DashboardView> {
// await requestDetailProvider.engineerRejectWorkOrder(id: '3', feedBack: 'Abcdef'); // await requestDetailProvider.engineerRejectWorkOrder(id: '3', feedBack: 'Abcdef');
// await dashBoardProvider.getDashBoardCount(usersType: user.type!); // await dashBoardProvider.getDashBoardCount(usersType: user.type!);
// await getAllRequests(); // await getAllRequests();
if (isFCM) { // if (isFCM) {
FirebaseNotificationManger.initialized(context); // FirebaseNotificationManger.initialized(context);
NotificationManger.initialisation((notificationDetails) { // NotificationManger.initialisation((notificationDetails) {
FirebaseNotificationManger.handleMessage(context, json.decode(notificationDetails.payload!)); // FirebaseNotificationManger.handleMessage(context, json.decode(notificationDetails.payload!));
}, (id, title, body, payload) async {}); // }, (id, title, body, payload) async {});
//
isFCM = false; // isFCM = false;
} // }
}); });
} }

@ -12,6 +12,7 @@ class User {
List<String>? departmentName; List<String>? departmentName;
String? message; String? message;
String? username; String? username;
String? employeeId;
String? userID; String? userID;
String? email; String? email;
String? password; String? password;
@ -53,6 +54,7 @@ class User {
this.departmentName, this.departmentName,
this.message, this.message,
this.username, this.username,
this.employeeId,
this.userID, this.userID,
this.email, this.email,
this.password, this.password,
@ -148,6 +150,7 @@ class User {
map['message'] = message; map['message'] = message;
map['username'] = username; map['username'] = username;
map['userID'] = userID; map['userID'] = userID;
map['employeeId'] = employeeId;
map['email'] = email; map['email'] = email;
map['password'] = password; map['password'] = password;
map['token'] = token; map['token'] = token;
@ -209,6 +212,7 @@ class User {
message = json['message']; message = json['message'];
username = json['username']; username = json['username'];
userID = json['userID']; userID = json['userID'];
employeeId = json['employeeId'];
email = json['email']; email = json['email'];
password = json['password']; password = json['password'];
token = json['token']; token = json['token'];

@ -106,7 +106,7 @@ class _ServiceRequestDetailMainState extends State<ServiceRequestDetailMain> {
isReadOnly: _requestProvider.isReadOnlyRequest, isReadOnly: _requestProvider.isReadOnlyRequest,
requestId: widget.requestId.toInt(), requestId: widget.requestId.toInt(),
assigneeEmployeeNumber: provider.currentWorkOrder?.data?.assignedEmployee!.employeeId!, assigneeEmployeeNumber: provider.currentWorkOrder?.data?.assignedEmployee!.employeeId!,
myLoginUserID: context.userProvider.user!.username!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!,
contactEmployeeINumber: provider.currentWorkOrder?.data?.workOrderContactPerson.first.employeeId, contactEmployeeINumber: provider.currentWorkOrder?.data?.workOrderContactPerson.first.employeeId,
); );
} }

@ -80,11 +80,11 @@ class _TaskRequestDetailsViewState extends State<TaskRequestDetailsView> {
(_taskReqModel.taskJobContactPersons?.isNotEmpty ?? false)) { (_taskReqModel.taskJobContactPersons?.isNotEmpty ?? false)) {
return ChatWidget( return ChatWidget(
moduleId: widget.moduleId, moduleId: widget.moduleId,
isShow: context.settingProvider.isUserFlowMedical&& _taskReqModel.taskJobStatus!.value! != 1, isShow: context.settingProvider.isUserFlowMedical && _taskReqModel.taskJobStatus!.value! != 1,
isReadOnly: _taskReqModel.taskJobStatus!.value! != 2, isReadOnly: _taskReqModel.taskJobStatus!.value! != 2,
requestId: widget.taskId.toInt(), requestId: widget.taskId.toInt(),
assigneeEmployeeNumber: _taskReqModel.assignedEngineer?.employeeId!, assigneeEmployeeNumber: _taskReqModel.assignedEngineer?.employeeId!,
myLoginUserID: context.userProvider.user!.username!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!,
contactEmployeeINumber: _taskReqModel.taskJobContactPersons!.first.user?.employeeId, contactEmployeeINumber: _taskReqModel.taskJobContactPersons!.first.user?.employeeId,
); );
} else } else

@ -1,8 +1,11 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:test_sa/controllers/notification/firebase_notification_manger.dart';
import 'package:test_sa/controllers/notification/notification_manger.dart';
import 'package:test_sa/controllers/providers/api/user_provider.dart'; import 'package:test_sa/controllers/providers/api/user_provider.dart';
import 'package:test_sa/controllers/providers/settings/app_settings.dart'; import 'package:test_sa/controllers/providers/settings/app_settings.dart';
import 'package:test_sa/dashboard_latest/dashboard_view.dart'; import 'package:test_sa/dashboard_latest/dashboard_view.dart';
@ -42,7 +45,7 @@ class _LandPageState extends State<LandPage> {
bool showAppbar = true; bool showAppbar = true;
late List<Widget> _pages; late List<Widget> _pages;
UserProvider? _userProvider; UserProvider? _userProvider;
bool isFCM = true;
@override @override
void initState() { void initState() {
_pages = <Widget>[]; _pages = <Widget>[];
@ -123,7 +126,14 @@ class _LandPageState extends State<LandPage> {
// if (_userProvider!.user!.type != UsersTypes.engineer) const CalendarPage(), // if (_userProvider!.user!.type != UsersTypes.engineer) const CalendarPage(),
const MyAssetsPage(fromBottomBar: true), const MyAssetsPage(fromBottomBar: true),
]; ];
if (isFCM) {
FirebaseNotificationManger.initialized(context);
NotificationManger.initialisation((notificationDetails) {
FirebaseNotificationManger.handleMessage(context, json.decode(notificationDetails.payload!));
}, (id, title, body, payload) async {});
isFCM = false;
}
checkLocalAuth(); checkLocalAuth();
} }

@ -227,7 +227,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
isReadOnly: _model!.senderMachineStatusValue! != 1, isReadOnly: _model!.senderMachineStatusValue! != 1,
requestId: widget.model.id!.toInt(), requestId: widget.model.id!.toInt(),
assigneeEmployeeNumber: _model!.senderAssignedEmployeeNumber, assigneeEmployeeNumber: _model!.senderAssignedEmployeeNumber,
myLoginUserID: context.userProvider.user!.username!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!,
contactEmployeeINumber: _model!.assetTransferContactPersons!.first.employeeNumber, contactEmployeeINumber: _model!.assetTransferContactPersons!.first.employeeNumber,
), ),
if ((_userProvider!.user?.type == UsersTypes.engineer)) if ((_userProvider!.user?.type == UsersTypes.engineer))
@ -288,7 +288,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
isReadOnly: (isSender ? _deviceTransfer.senderMachineStatusValue! : _deviceTransfer.receiverMachineStatusValue) != 1, isReadOnly: (isSender ? _deviceTransfer.senderMachineStatusValue! : _deviceTransfer.receiverMachineStatusValue) != 1,
requestId: widget.model.id!.toInt(), requestId: widget.model.id!.toInt(),
assigneeEmployeeNumber: isSender ? _deviceTransfer.senderAssignedEmployeeNumber! : _deviceTransfer.receiverAssignedEmployeeNumber!, assigneeEmployeeNumber: isSender ? _deviceTransfer.senderAssignedEmployeeNumber! : _deviceTransfer.receiverAssignedEmployeeNumber!,
myLoginUserID: context.userProvider.user!.username!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!,
contactEmployeeINumber: _deviceTransfer.assetTransferContactPersons!.first.employeeNumber, contactEmployeeINumber: _deviceTransfer.assetTransferContactPersons!.first.employeeNumber,
), ),
if ((_userProvider!.user?.type == UsersTypes.engineer)) if ((_userProvider!.user?.type == UsersTypes.engineer))

@ -72,7 +72,7 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
isReadOnly: _gasRefillModel.status!.value! != 1, isReadOnly: _gasRefillModel.status!.value! != 1,
requestId: widget.model.id!.toInt(), requestId: widget.model.id!.toInt(),
assigneeEmployeeNumber: _gasRefillModel.assignedEmployee?.employeeId!, assigneeEmployeeNumber: _gasRefillModel.assignedEmployee?.employeeId!,
myLoginUserID: context.userProvider.user!.username!, myLoginUserID: context.userProvider.user!.employeeId ?? context.userProvider.user!.username!,
contactEmployeeINumber: _gasRefillModel.gasRefillContactPerson!.first.employeeCode!, contactEmployeeINumber: _gasRefillModel.gasRefillContactPerson!.first.employeeCode!,
); );
}) })

Loading…
Cancel
Save