|
|
|
|
@ -86,7 +86,7 @@ class _CreateNewRequestState extends State<CreateNewRequest> with TickerProvider
|
|
|
|
|
|
|
|
|
|
Future<void> getInitialData() async {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
|
if(Provider.of<SettingProvider>(context, listen: false).showPriority) {
|
|
|
|
|
if (Provider.of<SettingProvider>(context, listen: false).showPriority) {
|
|
|
|
|
await Provider.of<PriorityProvider>(context, listen: false).getDate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -125,45 +125,45 @@ class _CreateNewRequestState extends State<CreateNewRequest> with TickerProvider
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Card(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
scanAssetButton(),
|
|
|
|
|
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 (Provider.of<SettingProvider>(context, listen: false).showPriority) ...[
|
|
|
|
|
16.height,
|
|
|
|
|
highPriorityWidget(),
|
|
|
|
|
],
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
scanAssetButton(),
|
|
|
|
|
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 (Provider.of<SettingProvider>(context, listen: false).showPriority) ...[
|
|
|
|
|
16.height,
|
|
|
|
|
assetStatusWidget(context),
|
|
|
|
|
24.height,
|
|
|
|
|
MultiFilesPicker(
|
|
|
|
|
label: context.translation.attachImage,
|
|
|
|
|
files: _deviceImages,
|
|
|
|
|
buttonColor: AppColor.black10,
|
|
|
|
|
onlyImages: false,
|
|
|
|
|
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
highPriorityWidget(),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(start: 13, end: 13, top: 15, bottom: 16),
|
|
|
|
|
).paddingAll(16),
|
|
|
|
|
16.height,
|
|
|
|
|
assetStatusWidget(context),
|
|
|
|
|
24.height,
|
|
|
|
|
MultiFilesPicker(
|
|
|
|
|
label: context.translation.attachImage,
|
|
|
|
|
files: _deviceImages,
|
|
|
|
|
buttonColor: AppColor.black10,
|
|
|
|
|
onlyImages: false,
|
|
|
|
|
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(0).toShadowContainer(context),
|
|
|
|
|
16.height,
|
|
|
|
|
commentWidget(serviceRequest: _serviceRequest),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -293,7 +293,7 @@ class _CreateNewRequestState extends State<CreateNewRequest> with TickerProvider
|
|
|
|
|
serviceRequest?.audio = audio;
|
|
|
|
|
},
|
|
|
|
|
enabled: serviceRequest == null ? true : false,
|
|
|
|
|
).paddingOnly(start: 16, end: 16, bottom: 16);
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool checkPendingRequest = false;
|
|
|
|
|
|