|
|
|
|
@ -61,56 +61,55 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
if (widget.isEdit) ...[
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Spare Part Cost",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: requestDetailProvider.workOrderCostModel?.sparePartCost?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
requestDetailProvider.engineerUpdateWorkOrderHelperModel?.callResponse = value;
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Labour Cost",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: requestDetailProvider.workOrderCostModel?.labourCost?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
requestDetailProvider.engineerUpdateWorkOrderHelperModel?.descriptionOfFinding = value;
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Travel Cost",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: requestDetailProvider.workOrderCostModel?.travelCost?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
requestDetailProvider.engineerUpdateWorkOrderHelperModel?.actionTaken = value;
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context).paddingAll(16),
|
|
|
|
|
).expanded,
|
|
|
|
|
] else ...[
|
|
|
|
|
assetStatusWidget(context: context, workOrderData: requestDetailProvider.engineerUpdateWorkOrderHelperModel!).toShadowContainer(context).paddingAll(16),
|
|
|
|
|
],
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Spare Part Cost",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: requestDetailProvider.workOrderCostModel?.sparePartCost?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
requestDetailProvider.workOrderCostModel?.sparePartCost = num.parse(value);
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Labour Cost",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: requestDetailProvider.workOrderCostModel?.labourCost?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
requestDetailProvider.workOrderCostModel?.labourCost = num.parse(value);
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Travel Cost",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: requestDetailProvider.workOrderCostModel?.travelCost?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
requestDetailProvider.workOrderCostModel?.travelCost = num.parse(value);
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context).paddingAll(16),
|
|
|
|
|
).expanded,
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
|
|
|
|
|
color: AppColor.white10,
|
|
|
|
|
@ -120,7 +119,7 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (validateForm(requestDetailProvider: requestDetailProvider)) {
|
|
|
|
|
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
|
await requestDetailProvider.engineerUpdateWorkOrder();
|
|
|
|
|
await requestDetailProvider.engineerUpdateCost();
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
|