|
|
|
|
@ -13,8 +13,9 @@ class ServiceReportFaultDescription extends StatelessWidget {
|
|
|
|
|
final String requestId;
|
|
|
|
|
final Function(FaultDescription) onSelect;
|
|
|
|
|
final FaultDescription initialValue;
|
|
|
|
|
final bool enabled;
|
|
|
|
|
|
|
|
|
|
const ServiceReportFaultDescription({Key key, this.requestId, this.onSelect, this.initialValue}) : super(key: key);
|
|
|
|
|
const ServiceReportFaultDescription({Key key, this.requestId, this.onSelect, this.initialValue, this.enabled = true}) : super(key: key);
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
SettingProvider settingProvider = Provider.of<SettingProvider>(context);
|
|
|
|
|
@ -28,9 +29,9 @@ class ServiceReportFaultDescription extends StatelessWidget {
|
|
|
|
|
menuProvider.reset();
|
|
|
|
|
await menuProvider.getCallRequestForWorkOrder(user: userProvider.user, host: settingProvider.host, requestId: requestId);
|
|
|
|
|
},
|
|
|
|
|
child: (menuProvider.items?.isEmpty ?? true)
|
|
|
|
|
? const ATextFormField(
|
|
|
|
|
initialValue: "",
|
|
|
|
|
child: ((menuProvider.items?.isEmpty ?? true) || (!enabled))
|
|
|
|
|
? ATextFormField(
|
|
|
|
|
initialValue: (!enabled) ? initialValue?.defectName ?? "" : "",
|
|
|
|
|
enable: false,
|
|
|
|
|
)
|
|
|
|
|
: FaultDescriptionMenu(
|
|
|
|
|
|