fix DA-151

merge-requests/265/head
Elham Rababah 4 years ago
parent a7ca7fb271
commit 4e4e6a3600

@ -92,7 +92,10 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getMasterLookup(MasterKeysService masterKeys) async {
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async {
if(isBusyLocal){
setState(ViewState.Busy);
}else
setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys);
if (_SOAPService.hasError) {

@ -272,36 +272,31 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
onModelReady: (model) async {
if (model.historyFamilyList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryFamily);
setState(() {
}
});
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
},
builder: (_, model, w) => AppScaffold(
// baseViewModel: model,
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 10,
),
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
if(activePriority ==1) {
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
}
if(activePriority ==2) {
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
}
}),
SizedBox(
height: 20,

Loading…
Cancel
Save