|
|
|
@ -151,13 +151,13 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
|
|
|
|
_gasRefillProvider = Provider.of<GasRefillProvider>(context, listen: false);
|
|
|
|
_gasRefillProvider = Provider.of<GasRefillProvider>(context, listen: false);
|
|
|
|
_gasRefillProvider.reset();
|
|
|
|
_gasRefillProvider.reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (widget.gasRefillModel != null && _firstTime) {
|
|
|
|
if (_firstTime) {
|
|
|
|
|
|
|
|
if (widget.gasRefillModel != null) {
|
|
|
|
_formModel = widget.gasRefillModel;
|
|
|
|
_formModel = widget.gasRefillModel;
|
|
|
|
_formModel.status = const Lookup(value: 0);
|
|
|
|
_formModel.status = const Lookup(value: 0);
|
|
|
|
HospitalsProvider().getHospitalsListByVal(searchVal: widget.gasRefillModel.clientName).then((value) {
|
|
|
|
}
|
|
|
|
_gasRefillProvider.hospital = value?.firstWhere((element) => element.name == widget.gasRefillModel.clientName, orElse: () => null);
|
|
|
|
HospitalsProvider().getHospitalsListByVal(searchVal: _userProvider.user?.clientName).then((value) {
|
|
|
|
print(_gasRefillProvider.hospital?.buildings?.length);
|
|
|
|
_gasRefillProvider.hospital = value?.firstWhere((element) => element.name == _userProvider.user?.clientName, orElse: () => null);
|
|
|
|
print(widget.gasRefillModel?.building?.name);
|
|
|
|
|
|
|
|
_gasRefillProvider.building = _gasRefillProvider.hospital?.buildings?.firstWhere((element) => element.name == widget.gasRefillModel?.building?.name, orElse: () => null);
|
|
|
|
_gasRefillProvider.building = _gasRefillProvider.hospital?.buildings?.firstWhere((element) => element.name == widget.gasRefillModel?.building?.name, orElse: () => null);
|
|
|
|
_gasRefillProvider.floor = _gasRefillProvider.building?.floors?.firstWhere((element) => element.name == widget.gasRefillModel?.floor?.name, orElse: () => null);
|
|
|
|
_gasRefillProvider.floor = _gasRefillProvider.building?.floors?.firstWhere((element) => element.name == widget.gasRefillModel?.floor?.name, orElse: () => null);
|
|
|
|
_gasRefillProvider.department = _gasRefillProvider.floor?.departments?.firstWhere((element) => element.name == widget.gasRefillModel?.department?.departmentName, orElse: () => null);
|
|
|
|
_gasRefillProvider.department = _gasRefillProvider.floor?.departments?.firstWhere((element) => element.name == widget.gasRefillModel?.department?.departmentName, orElse: () => null);
|
|
|
|
@ -232,6 +232,7 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
|
|
|
|
height: 4,
|
|
|
|
height: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HospitalAutoCompleteField(
|
|
|
|
HospitalAutoCompleteField(
|
|
|
|
|
|
|
|
enabled: false,
|
|
|
|
initialValue: _gasRefillProvider.hospital?.name,
|
|
|
|
initialValue: _gasRefillProvider.hospital?.name,
|
|
|
|
// onSave: (value){
|
|
|
|
// onSave: (value){
|
|
|
|
// _search.hospital = value;
|
|
|
|
// _search.hospital = value;
|
|
|
|
|