gub fixes

merge-requests/267/head
Sultan Khan 5 years ago
parent 40cfad7f7b
commit 896078507f

@ -96,8 +96,9 @@ class BaseAppClient {
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
await helpers.logout(); onFailure(getError(parsed), statusCode);
helpers.showErrorToast('Your session expired Please login agian'); //await helpers.logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else if (parsed['MessageStatus'] == 1) { } else if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated']) if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);

@ -101,7 +101,60 @@ class PrescriptionService extends BaseService {
List<PrescriptionModel> prescription) async { List<PrescriptionModel> prescription) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {
"Prescription": { "Prescription": {
"objPatientInfo": {"Gender": patient.gender, "Age": patient.age}, "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"},
"objVitalSign": {"Height": "180", "Weight": "37"},
"objPrescriptionItems": [
{
"DrugId": "83-20-00-30-20-03-03",
"DrugName": "WARFARIN 1 MG TAB 28'S (N)",
"Dose": "1",
"DoseType": "04",
"Unit": "actuation(s)",
"FrequencyType": "1/3/Day",
"Duration": "3/Day",
"IsScreen": "true"
},
{
"DrugId": "64-20-00-10-00-03-15",
"DrugName": "PANADOL 500 MG TAB 24'S(DIS)",
"Dose": "1",
"DoseType": "04",
"Unit": "MG",
"FrequencyType": "3/1/Day",
"Duration": "4/Day",
"RouteID": "24",
"IsScreen": "true"
}
],
"objAllergies": {
"Allergy": {
"objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"}
}
},
"objDiagnosis": {
"Diagnosis": {
"objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"}
}
},
"IsDoctor": "false",
"IsPharmacist": "false"
},
"IPAdress": "10.10.10.10",
"Channel": 9,
"LanguageID": 2,
"VersionID": 5.3,
"SessionID": "BlUSkYymTt",
"IsLoginForDoctorApp": true,
"PatientOutSA": 0,
"TokenID": "@dm!n",
"OutSA": true
};
Map<String, dynamic> requestN = {
"Prescription": {
"objPatientInfo": {
"Gender": patient.gender == 1 ? 'Male' : 'Female',
"Age": patient.age
},
"objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg},
"objPrescriptionItems": prescription[0].entityList, "objPrescriptionItems": prescription[0].entityList,
"objAllergies": allergy, "objAllergies": allergy,

@ -714,9 +714,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
title: TranslationBase.of(context) title: TranslationBase.of(context)
.addMedication, .addMedication,
onPressed: () { onPressed: () {
formKey.currentState.save(); // formKey.currentState.save();
Navigator.pop(context); // Navigator.pop(context);
openDrugToDrug(); // openDrugToDrug();
if (strength == null || if (strength == null ||
route == null || route == null ||
frequency == null || frequency == null ||

@ -71,6 +71,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
void initState() { void initState() {
super.initState(); super.initState();
_loggedUserFuture = getSharedPref(); _loggedUserFuture = getSharedPref();
_getAvailableBiometrics();
} }
Future<void> getSharedPref() async { Future<void> getSharedPref() async {
@ -499,7 +500,8 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authenticateUser(3, BiometricType.fingerprint.index, authProv) authenticateUser(3, BiometricType.fingerprint.index, authProv)
}, },
child: RoundedContainer( child: RoundedContainer(
backgroundColor: BiometricType.fingerprint.index == 1 backgroundColor:
checkIfBiometricAvailable(BiometricType.fingerprint)
? Colors.white ? Colors.white
: Colors.white.withOpacity(.7), : Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
@ -566,9 +568,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}) })
}, },
child: RoundedContainer( child: RoundedContainer(
backgroundColor: BiometricType.fingerprint.index == 1 backgroundColor: Colors.white,
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
@ -756,11 +756,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
getDocProfiles(clinic, authProv); getDocProfiles(clinic, authProv);
} }
} else { } else {
//changeLoadingStata(false); Navigator.pop(context);
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
//changeLoadingStata(false); Navigator.pop(context);
helpers.showErrorToast(err); helpers.showErrorToast(err);
}); });
} }

@ -52,7 +52,7 @@ class SMSOTP {
String errorMsg; String errorMsg;
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
String displayTime = ''; String displayTime = '';
bool isClosed = false;
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
return showDialog( return showDialog(
context: context, context: context,
@ -65,6 +65,7 @@ class SMSOTP {
IconButton( IconButton(
icon: Icon(Icons.close), icon: Icon(Icons.close),
onPressed: () { onPressed: () {
this.isClosed = true;
Navigator.pop(context); Navigator.pop(context);
this.onFailure(); this.onFailure();
}, },
@ -307,7 +308,7 @@ class SMSOTP {
timer = Future.delayed(Duration(seconds: 1), () { timer = Future.delayed(Duration(seconds: 1), () {
if (this.remainingTime > 0) { if (this.remainingTime > 0) {
startTimer(setState); if (isClosed == false) startTimer(setState);
} else { } else {
Navigator.pop(context); Navigator.pop(context);
} }

Loading…
Cancel
Save