|
|
|
|
@ -129,27 +129,27 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
|
|
|
|
|
backgroundColor: AppColor.white936,
|
|
|
|
|
onPick: (asset) async {
|
|
|
|
|
_pickedAsset = asset;
|
|
|
|
|
await checkAssetForPendingServiceRequest(asset.id!.toInt());
|
|
|
|
|
if (_pickedAsset != null && pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) {
|
|
|
|
|
showPendingRequestBottomSheet();
|
|
|
|
|
}
|
|
|
|
|
// await checkAssetForPendingServiceRequest(asset.id!.toInt());
|
|
|
|
|
// if (_pickedAsset != null && pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) {
|
|
|
|
|
// showPendingRequestBottomSheet();
|
|
|
|
|
// }
|
|
|
|
|
setState(() {});
|
|
|
|
|
}),
|
|
|
|
|
if (pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(Icons.warning, color: Color(0xffEE404C), size: 14),
|
|
|
|
|
8.width,
|
|
|
|
|
Text(
|
|
|
|
|
"This asset already have ${pendingAssetServiceRequest!.details!.length} request pending",
|
|
|
|
|
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xff7D859A), decoration: TextDecoration.underline),
|
|
|
|
|
).expanded,
|
|
|
|
|
],
|
|
|
|
|
).onPress(() {
|
|
|
|
|
showPendingRequests();
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
// if (pendingAssetServiceRequest != null && pendingAssetServiceRequest!.details!.isNotEmpty) ...[
|
|
|
|
|
// 8.height,
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// const Icon(Icons.warning, color: Color(0xffEE404C), size: 14),
|
|
|
|
|
// 8.width,
|
|
|
|
|
// Text(
|
|
|
|
|
// "This asset already have ${pendingAssetServiceRequest!.details!.length} request pending",
|
|
|
|
|
// style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500, color: Color(0xff7D859A), decoration: TextDecoration.underline),
|
|
|
|
|
// ).expanded,
|
|
|
|
|
// ],
|
|
|
|
|
// ).onPress(() {
|
|
|
|
|
// showPendingRequests();
|
|
|
|
|
// }),
|
|
|
|
|
// ],
|
|
|
|
|
21.height,
|
|
|
|
|
requestTypeWidget(context),
|
|
|
|
|
12.height,
|
|
|
|
|
@ -177,6 +177,7 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
|
|
|
|
|
title: context.translation.building,
|
|
|
|
|
initialValue: _assetDestination.building,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
enabled: _assetDestination.site?.buildings?.isNotEmpty ?? false,
|
|
|
|
|
staticData: _assetDestination.site?.buildings ?? [],
|
|
|
|
|
@ -197,6 +198,7 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
|
|
|
|
|
context: context,
|
|
|
|
|
title: context.translation.floor,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
initialValue: _assetDestination.floor,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
enabled: _assetDestination.building?.floors?.isNotEmpty ?? false,
|
|
|
|
|
@ -212,6 +214,7 @@ class _CreateAssetTransferRequestState extends State<CreateAssetTransferRequest>
|
|
|
|
|
context: context,
|
|
|
|
|
title: context.translation.department,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
showAsBottomSheet: true,
|
|
|
|
|
initialValue: _assetDestination.department,
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
enabled: _assetDestination.floor?.departments?.isNotEmpty ?? false,
|
|
|
|
|
|