Null Safety Fixes

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent 3b2ee0ef65
commit e1604b09f8

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart';
@ -185,7 +183,6 @@ class LabsService extends BaseService {
await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) {
print(jsonEncode(lab));
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
});
}, onFailure: (String error, int statusCode) {

@ -140,8 +140,9 @@ class SOAPViewModel extends BaseViewModel {
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else
} else {
setState(ViewState.Busy);
}
await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -255,9 +256,7 @@ class SOAPViewModel extends BaseViewModel {
return allergiesString;
}
Future getPatientPhysicalExam(
PatiantInformtion patientInfo,
) async {
Future getPatientPhysicalExam(PatiantInformtion patientInfo, {required bool allowSetState}) async {
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(),
@ -271,13 +270,12 @@ class SOAPViewModel extends BaseViewModel {
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!);
else
getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy);
if (allowSetState) setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
if (allowSetState) setState(ViewState.Error);
} else if (allowSetState) setState(ViewState.Idle);
}
Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async {

@ -80,7 +80,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4),
),
authenticationViewModel.user != null && isMoreOption == false
authenticationViewModel.user != null && authenticationViewModel.user!.logInTypeID != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
@ -238,7 +238,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null && isMoreOption == false
authenticationViewModel.user != null && authenticationViewModel.user!.logInTypeID != null && isMoreOption == false
? Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Expanded(
@ -416,7 +416,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
sendActivationCode(AuthMethodTypes authMethodType) async {
if (authenticationViewModel.user != null) {
if (authenticationViewModel.user != null && authenticationViewModel.user!.logInTypeID != null) {
sendActivationCodeVerificationScreen(authMethodType);
} else {
sendActivationCodeByOtpNotificationType(authMethodType);

@ -26,8 +26,7 @@ class LabResultHistoryChartAndDetails extends StatelessWidget {
children: <Widget>[
Container(
margin: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(12)),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)),
child: LineChartCurvedLabHistory(
title: name,
labResultHistory: labResultHistory,
@ -36,8 +35,7 @@ class LabResultHistoryChartAndDetails extends StatelessWidget {
Container(
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(12)),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

@ -60,7 +60,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
model.setObjectiveCallBack(this);
mySelectedExamination.clear();
model.isAddExamInProgress = true;
await model.getPatientPhysicalExam(widget.patientInfo);
await model.getPatientPhysicalExam(widget.patientInfo, allowSetState: false);
if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);

@ -272,6 +272,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
@override
Function nextFunction(model) {
return addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList);
addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList);
return () {};
}
}

@ -26,7 +26,7 @@ class NewPrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0);
model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,

Loading…
Cancel
Save