signature fixes

design_3.0_demo_module
Sikander Saleem 3 years ago
parent 8ada0dd0af
commit b8051a40fe

@ -12,7 +12,7 @@ class URLs {
set host(String value) => _host = value; set host(String value) => _host = value;
static String getFileUrl(String file) => file == null || file.isEmpty ? null : "$_host/attachment/$file"; static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/attachment/$file");
// API Routes // API Routes
static get login => "$_baseUrl/MobileAuth/LoginIntegration"; // post static get login => "$_baseUrl/MobileAuth/LoginIntegration"; // post
@ -36,8 +36,11 @@ class URLs {
static get getRepairLocation => "$_baseUrl/Lookups/GetLookup?lookupEnum=504"; static get getRepairLocation => "$_baseUrl/Lookups/GetLookup?lookupEnum=504";
static get equipmentStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=601"; static get equipmentStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=601";
static get getDateOperators => "$_baseUrl/Lookups/GetLookup?lookupEnum=200"; static get getDateOperators => "$_baseUrl/Lookups/GetLookup?lookupEnum=200";
static get getMaintenanceSituation => "$_baseUrl/Lookups/GetLookup?lookupEnum=502"; static get getMaintenanceSituation => "$_baseUrl/Lookups/GetLookup?lookupEnum=502";
static get getAllUsers => "http://109.123.243.118:5000/api/Account/GetAllUsers"; static get getAllUsers => "http://109.123.243.118:5000/api/Account/GetAllUsers";
static get getPreventiveMaintenanceVisits => "$_baseUrl/return/user/calibrations"; // get static get getPreventiveMaintenanceVisits => "$_baseUrl/return/user/calibrations"; // get

@ -181,7 +181,7 @@ class DeviceTransferProvider extends ChangeNotifier {
"senderStartDate": newModel.timer?.startAt?.toIso8601String(), "senderStartDate": newModel.timer?.startAt?.toIso8601String(),
"senderEndDate": newModel.timer?.endAt?.toIso8601String(), "senderEndDate": newModel.timer?.endAt?.toIso8601String(),
"senderTravelingHours": newModel.travelingHours, "senderTravelingHours": newModel.travelingHours,
"senderAttachmentName": "${newModel.signature}.png", "senderAttachmentName": newModel?.signature ?? "",
"destSiteId": oldModel.receiver.client.id, "destSiteId": oldModel.receiver.client.id,
"destDepartmentId": oldModel.receiver.department.id, "destDepartmentId": oldModel.receiver.department.id,
"receiverAssignedEmployeeId": oldModel.receiver.userId, "receiverAssignedEmployeeId": oldModel.receiver.userId,
@ -191,7 +191,7 @@ class DeviceTransferProvider extends ChangeNotifier {
"receiverStartDate": oldModel.receiver.timer?.startAt?.toIso8601String(), "receiverStartDate": oldModel.receiver.timer?.startAt?.toIso8601String(),
"receiverEndDate": oldModel.receiver.timer?.endAt?.toIso8601String(), "receiverEndDate": oldModel.receiver.timer?.endAt?.toIso8601String(),
"receiverTravelingHours": oldModel.receiver.travelingHours, "receiverTravelingHours": oldModel.receiver.travelingHours,
"receiverAttachmentName": "${oldModel.receiver.signature}.png", "receiverAttachmentName": oldModel.receiver?.signature ?? "",
}); });
} else { } else {
body.addAll({ body.addAll({
@ -204,7 +204,7 @@ class DeviceTransferProvider extends ChangeNotifier {
"senderStartDate": oldModel.sender.timer?.startAt?.toIso8601String(), "senderStartDate": oldModel.sender.timer?.startAt?.toIso8601String(),
"senderEndDate": oldModel.sender.timer?.endAt?.toIso8601String(), "senderEndDate": oldModel.sender.timer?.endAt?.toIso8601String(),
"senderTravelingHours": oldModel.sender.travelingHours, "senderTravelingHours": oldModel.sender.travelingHours,
"senderAttachmentName": "${oldModel.sender.signature}.png", "senderAttachmentName": oldModel.sender?.signature ?? "",
"destSiteId": newModel.client.id, "destSiteId": newModel.client.id,
"destDepartmentId": newModel.department.id, "destDepartmentId": newModel.department.id,
"receiverAssignedEmployeeId": newModel.userId, "receiverAssignedEmployeeId": newModel.userId,
@ -214,11 +214,11 @@ class DeviceTransferProvider extends ChangeNotifier {
"receiverStartDate": newModel.timer?.startAt?.toIso8601String(), "receiverStartDate": newModel.timer?.startAt?.toIso8601String(),
"receiverEndDate": newModel.timer?.endAt?.toIso8601String(), "receiverEndDate": newModel.timer?.endAt?.toIso8601String(),
"receiverTravelingHours": newModel.travelingHours, "receiverTravelingHours": newModel.travelingHours,
"receiverAttachmentName": "${newModel.signature}.png", "receiverAttachmentName": newModel?.signature ?? "",
}); });
} }
body.addAll(newModel.toJson(isSender)); //body.addAll(newModel.toJson(isSender));
print(body); print(body);
Response response; Response response;
try { try {

@ -202,7 +202,9 @@ class _UpdateDeviceTransferState extends State<UpdateDeviceTransfer> {
onSaved: (signature) { onSaved: (signature) {
_signature = signature; _signature = signature;
if (signature == null || signature.isEmpty) return; if (signature == null || signature.isEmpty) return;
_formModel.signature = base64Encode(signature); _formModel.signature =
"${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
// base64Encode(signature);
}, },
), ),
Padding( Padding(

@ -194,8 +194,8 @@ class RequestDetailsPage extends StatelessWidget {
info: serviceRequest.deviceNumber, info: serviceRequest.deviceNumber,
), ),
RequestInfoRow( RequestInfoRow(
title: _subtitle.deviceSN, title: _subtitle.assetName,
info: serviceRequest.deviceSerialNumber, info: serviceRequest.deviceEnName,
), ),
RequestInfoRow( RequestInfoRow(
title: _subtitle.deviceModel, title: _subtitle.deviceModel,

@ -18,6 +18,7 @@ class DeviceTransferInfoSection extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
info.userName = Provider.of<UserProvider>(context).user.username; info.userName = Provider.of<UserProvider>(context).user.username;
final subtitle = AppLocalization.of(context).subtitle; final subtitle = AppLocalization.of(context).subtitle;
print("url:${info.signature}");
return Column( return Column(
children: [ children: [
RequestInfoRow( RequestInfoRow(

Loading…
Cancel
Save