|
|
|
@ -62,6 +62,7 @@ class _PartNoButtonState extends State<PartNoButton> {
|
|
|
|
title: context.translation.partNo,
|
|
|
|
title: context.translation.partNo,
|
|
|
|
staticData: widget.spareParts,
|
|
|
|
staticData: widget.spareParts,
|
|
|
|
initialValue: current?.sparePart,
|
|
|
|
initialValue: current?.sparePart,
|
|
|
|
|
|
|
|
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral30,
|
|
|
|
// initialValue: (_serviceReport.sparePartsWorkOrders?.isNotEmpty ?? false) ? _serviceReport.sparePartsWorkOrders.first.sparePart : null,
|
|
|
|
// initialValue: (_serviceReport.sparePartsWorkOrders?.isNotEmpty ?? false) ? _serviceReport.sparePartsWorkOrders.first.sparePart : null,
|
|
|
|
onSelect: (part) {
|
|
|
|
onSelect: (part) {
|
|
|
|
current = SparePartsWorkOrders(id: 0, sparePart: part, qty: 0);
|
|
|
|
current = SparePartsWorkOrders(id: 0, sparePart: part, qty: 0);
|
|
|
|
@ -73,6 +74,7 @@ class _PartNoButtonState extends State<PartNoButton> {
|
|
|
|
controller: widget.controller,
|
|
|
|
controller: widget.controller,
|
|
|
|
labelText: context.translation.quantity,
|
|
|
|
labelText: context.translation.quantity,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
|
|
|
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral30,
|
|
|
|
enable: current != null,
|
|
|
|
enable: current != null,
|
|
|
|
validator: (value) => value == null || value.isEmpty
|
|
|
|
validator: (value) => value == null || value.isEmpty
|
|
|
|
? context.translation.requiredField
|
|
|
|
? context.translation.requiredField
|
|
|
|
@ -117,6 +119,7 @@ class _PartNoButtonState extends State<PartNoButton> {
|
|
|
|
32.width,
|
|
|
|
32.width,
|
|
|
|
"trash".toSvgAsset().onPress(() {
|
|
|
|
"trash".toSvgAsset().onPress(() {
|
|
|
|
list.remove(list[index]);
|
|
|
|
list.remove(list[index]);
|
|
|
|
|
|
|
|
if (widget.onAdd != null) widget.onAdd(list);
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|