From 2c09cdb7e4ecf00be9a4e286276f28fc97524191 Mon Sep 17 00:00:00 2001 From: nextwo <1234> Date: Sun, 14 May 2023 12:04:24 +0300 Subject: [PATCH] FIX BUGS --- lib/controllers/providers/api/device_transfer_provider.dart | 4 ++-- lib/views/pages/user/land_page.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/controllers/providers/api/device_transfer_provider.dart b/lib/controllers/providers/api/device_transfer_provider.dart index 1d2dc0b7..f5db6caa 100644 --- a/lib/controllers/providers/api/device_transfer_provider.dart +++ b/lib/controllers/providers/api/device_transfer_provider.dart @@ -169,7 +169,7 @@ class DeviceTransferProvider extends ChangeNotifier{ "senderComment": newModel.comment, "senderWorkingHours": newModel.workingHours, "senderTravelingHours": newModel.travelingHours, - "senderAttachmentName": "${DateTime.now().toIso8601String()}.png|${newModel.signature}", + "senderAttachmentName": "${newModel.signature}.png", } ); }else{ @@ -196,7 +196,7 @@ class DeviceTransferProvider extends ChangeNotifier{ ); print(response.body); - print("${DateTime.now().toIso8601String()}.png|${newModel.signature}"); + print("${newModel.signature}.png"); // response = await post( // Uri.parse("$host${URLs.updateDeviceTransfer}/$requestId"), // body: body, diff --git a/lib/views/pages/user/land_page.dart b/lib/views/pages/user/land_page.dart index 41c4826c..7235ed4c 100644 --- a/lib/views/pages/user/land_page.dart +++ b/lib/views/pages/user/land_page.dart @@ -153,7 +153,7 @@ class _LandPageState extends State { mainAxisSpacing: 12, childAspectRatio: 1, children: [ - if (_userProvider.user.type == UsersTypes.normal_user) + if (_userProvider?.user?.type == UsersTypes.normal_user) LandPageItem( text: _subtitle.newServiceRequest, icon: FontAwesomeIcons.tools, @@ -184,7 +184,7 @@ class _LandPageState extends State { // Navigator.of(context).pushNamed(PreventiveMaintenanceVisitsPage.id); // }, // ), - if (_userProvider.user.type != UsersTypes.engineer) + if (_userProvider?.user != null && _userProvider?.user?.type != UsersTypes.engineer) LandPageItem( text: "Request Gas Refill", icon: FontAwesomeIcons.truckFast,