Null Safety

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent cb01308f96
commit e524151da9

@ -329,13 +329,13 @@ class BaseAppClient {
String getError(parsed) { String getError(parsed) {
//TODO change this fun //TODO change this fun
String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; String? error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) { if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) {
error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; error = error! + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n";
} }
} }
} }

@ -11,7 +11,7 @@ const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://webservices.hmg.com/'; //const BASE_URL = 'https://webservices.hmg.com/';
// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL
@ -275,7 +275,6 @@ const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetST
const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser"; const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser";
var selectedPatientType = 1; var selectedPatientType = 1;

@ -4,8 +4,7 @@ class ProcedureValadteModel {
dynamic statusMessage; dynamic statusMessage;
dynamic success; dynamic success;
ProcedureValadteModel( ProcedureValadteModel({this.entityList, this.rowcount, this.statusMessage, this.success});
{this.entityList, this.rowcount, this.statusMessage, this.success});
ProcedureValadteModel.fromJson(Map<String, dynamic> json) { ProcedureValadteModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) { if (json['entityList'] != null) {
@ -20,7 +19,7 @@ class ProcedureValadteModel {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = Map<String, dynamic>();
if (this.entityList != null) { if (this.entityList != null) {
data['entityList'] = this.entityList!.map((v) => v.toJson()).toList(); data['entityList'] = this.entityList!.map((v) => v.toJson()).toList();
} }
@ -43,7 +42,7 @@ class EntityList {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = Map<String, dynamic>();
data['procedureId'] = this.procedureId; data['procedureId'] = this.procedureId;
data['warringMessages'] = this.warringMessages; data['warringMessages'] = this.warringMessages;
return data; return data;

@ -13,37 +13,32 @@ import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class ProcedureService extends BaseService { class ProcedureService extends BaseService {
List<GetOrderedProcedureModel> _procedureList =[]; List<GetOrderedProcedureModel> _procedureList = [];
List<GetOrderedProcedureModel> get procedureList => _procedureList; List<GetOrderedProcedureModel> get procedureList => _procedureList;
List<ProcedureValadteModel> _valadteProcedureList =[]; List<ProcedureValadteModel> _valadteProcedureList = [];
List<ProcedureValadteModel> get valadteProcedureList => _valadteProcedureList; List<ProcedureValadteModel> get valadteProcedureList => _valadteProcedureList;
List<CategoriseProcedureModel> _categoriesList =[]; List<CategoriseProcedureModel> _categoriesList = [];
List<CategoriseProcedureModel> get categoriesList => _categoriesList; List<CategoriseProcedureModel> get categoriesList => _categoriesList;
List<Procedures> procedureslist =[]; List<Procedures> procedureslist = [];
List<dynamic> categoryList = []; List<dynamic> categoryList = [];
// List<ProcedureTempleteModel> _templateList =[]; // List<ProcedureTempleteModel> _templateList =[];
// List<ProcedureTempleteModel> get templateList => _templateList; // List<ProcedureTempleteModel> get templateList => _templateList;
List<ProcedureTempleteDetailsModel> templateList =[]; List<ProcedureTempleteDetailsModel> templateList = [];
List<ProcedureTempleteDetailsModel> _templateDetailsList =[]; List<ProcedureTempleteDetailsModel> _templateDetailsList = [];
List<ProcedureTempleteDetailsModel> get templateDetailsList => List<ProcedureTempleteDetailsModel> get templateDetailsList => _templateDetailsList;
_templateDetailsList;
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel();
GetOrderedProcedureRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel();
ProcedureTempleteRequestModel(); ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel();
);
GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel(
clinicId: 0, clinicId: 0,
@ -52,8 +47,7 @@ class ProcedureService extends BaseService {
patientMRN: 0, patientMRN: 0,
); );
Future getProcedureTemplate( Future getProcedureTemplate({int? doctorId, int? projectId, int? clinicId, String? categoryID, bool? isLocalBusy}) async {
{int? doctorId, int? projectId, int? clinicId, String? categoryID, bool? isLocalBusy}) async {
_procedureTempleteRequestModel = ProcedureTempleteRequestModel( _procedureTempleteRequestModel = ProcedureTempleteRequestModel(
// tokenID: "@dm!n", // tokenID: "@dm!n",
patientID: 0, patientID: 0,
@ -62,12 +56,10 @@ class ProcedureService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/, await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
templateList.clear(); templateList.clear();
response['DAPP_TemplateGetList'].forEach((template) { response['DAPP_TemplateGetList'].forEach((template) {
ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template);
ProcedureTempleteDetailsModel.fromJson(template);
if (categoryID != null) { if (categoryID != null) {
if (categoryID == templateElement.categoryID) { if (categoryID == templateElement.categoryID) {
templateList.add(templateElement); templateList.add(templateElement);
@ -85,21 +77,16 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteRequestModel.toJson()); }, body: _procedureTempleteRequestModel.toJson());
} }
Future getProcedureTemplateDetails( Future getProcedureTemplateDetails({int? doctorId, int? projectId, int? clinicId, int? templateId}) async {
{int? doctorId, int? projectId, int? clinicId, int? templateId}) async { _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
_procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel(
templateID: templateId, searchType: 1, patientID: 0);
hasError = false; hasError = false;
//insuranceApprovalInPatient.clear(); //insuranceApprovalInPatient.clear();
_templateDetailsList.clear(); _templateDetailsList.clear();
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
//prescriptionsList.clear(); //prescriptionsList.clear();
response['HIS_ProcedureTemplateDetailsList'].forEach((template) { response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
_templateDetailsList _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
.add(ProcedureTempleteDetailsModel.fromJson(template));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -113,10 +100,8 @@ class ProcedureService extends BaseService {
); );
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST, await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
_procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -126,8 +111,7 @@ class ProcedureService extends BaseService {
Future getCategory() async { Future getCategory() async {
hasError = false; hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE, await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
categoryList = []; categoryList = [];
categoryList = response['listProcedureCategories']['entityList']; categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -136,8 +120,7 @@ class ProcedureService extends BaseService {
}, body: Map()); }, body: Map());
} }
Future getProcedureCategory( Future getProcedureCategory({String? categoryName, String? categoryID, patientId}) async {
{String? categoryName, String? categoryID, patientId}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: ["$categoryName"], search: ["$categoryName"],
patientMRN: patientId, patientMRN: patientId,
@ -148,10 +131,8 @@ class ProcedureService extends BaseService {
); );
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
_categoriesList
.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -161,8 +142,7 @@ class ProcedureService extends BaseService {
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(POST_PROCEDURE_LIST, await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -170,12 +150,10 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson()); }, body: postProcedureReqModel.toJson());
} }
Future updateProcedure( Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async {
UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE, await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("ACCEPTED"); print("ACCEPTED");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -183,14 +161,13 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
Future validationProcedure( Future validationProcedure(ProcedureValidationRequestModel validationProcedureRequestModel) async {
ProcedureValidationRequestModel validationProcedureRequestModel) async {
hasError = false; hasError = false;
_valadteProcedureList.clear(); _valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION, await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_valadteProcedureList.add( _valadteProcedureList.add(
ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); ProcedureValadteModel.fromJson(response['ValidateProcedureList']),
);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -63,8 +63,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
List<String> _times = []; List<String> _times = [];
int _activeLocation = 1; int _activeLocation = 1;
String? patientType; String patientType = '';
String? patientTypeTitle; String patientTypeTitlem = '';
var selectedFilter = 1; var selectedFilter = 1;
String arrivalType = ''; String arrivalType = '';
late ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
@ -216,12 +216,11 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
child: PatientCard( child: PatientCard(
patientInfo: model.filterData[index], patientInfo: model.filterData[index],
patientType: patientType!, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isFromSearch: widget.isSearchAndOut, isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
onTap: () { onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index], "patient": model.filterData[index],
"patientType": "1", "patientType": "1",

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
@ -13,9 +13,9 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../widgets/shared/errors/error_message.dart'; import '../../../../widgets/shared/errors/error_message.dart';
class LabsHomePage extends StatefulWidget { class LabsHomePage extends StatefulWidget {
@ -67,16 +67,12 @@ class _LabsHomePageState extends State<LabsHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if ((model.patientLabOrdersList.isNotEmpty && if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43))
patient!.patientStatusType != 43)|| (patient!.patientStatusType != null &&
patient!.patientStatusType == 43))
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).lab, title: TranslationBase.of(context).lab,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
if ((patient!.patientStatusType != null && if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null))
patient!.patientStatusType == 43) ||
(isFromLiveCare! && patient!.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -115,44 +111,26 @@ class _LabsHomePageState extends State<LabsHomePage> {
child: Container( child: Container(
width: 20, width: 20,
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.patientLabOrdersList[index] color: model.patientLabOrdersList[index].isLiveCareAppointment!
.isLiveCareAppointment!
? Colors.red[900] ? Colors.red[900]
: !model.patientLabOrdersList[index] : !model.patientLabOrdersList[index].isInOutPatient!
.isInOutPatient!
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
? Radius.circular(0) bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
: Radius.circular(8), topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomLeft: projectViewModel.isArabic bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0)),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.patientLabOrdersList[index] model.patientLabOrdersList[index].isLiveCareAppointment!
.isLiveCareAppointment! ? TranslationBase.of(context).liveCare.toUpperCase()
? TranslationBase.of(context) : !model.patientLabOrdersList[index].isInOutPatient!
.liveCare ? TranslationBase.of(context).inPatientLabel.toUpperCase()
.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(),
: !model.patientLabOrdersList[index]
.isInOutPatient!
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -164,31 +142,26 @@ class _LabsHomePageState extends State<LabsHomePage> {
margin: EdgeInsets.only(left: 20), margin: EdgeInsets.only(left: 20),
child: DoctorCard( child: DoctorCard(
isNoMargin: true, isNoMargin: true,
onTap: () => Navigator.push( onTap: () {
context, Navigator.push(
FadePage( context,
page: LaboratoryResultPage( FadePage(
patientLabOrders: page: LaboratoryResultPage(
model.patientLabOrdersList[index], patientLabOrders: model.patientLabOrdersList[index],
patient: patient!, patient: patient!,
isInpatient: isInpatient!, isInpatient: isInpatient!,
arrivalType: arrivalType!, arrivalType: arrivalType!,
patientType: patientType!, patientType: patientType!,
),
), ),
), );
), },
doctorName: doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName!),
Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName!), invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
invoiceNO: profileUrl: model.patientLabOrdersList[index].doctorImageURL!,
' ${model.patientLabOrdersList[index].invoiceNo}', branch: model.patientLabOrdersList[index].projectName!,
profileUrl: model clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription!),
.patientLabOrdersList[index].doctorImageURL!, appointmentDate: model.patientLabOrdersList[index].createdOn!,
branch:
model.patientLabOrdersList[index].projectName!,
clinic:
Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription!),
appointmentDate:
model.patientLabOrdersList[index].createdOn!,
orderNo: model.patientLabOrdersList[index].orderNo!, orderNo: model.patientLabOrdersList[index].orderNo!,
isShowTime: false, isShowTime: false,
), ),
@ -197,8 +170,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
), ),
), ),
if (model.patientLabOrdersList.isEmpty && if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43)
patient!.patientStatusType != 43)
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,

@ -152,6 +152,11 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
}); });
}, },
addSelectedHistories: () {}, addSelectedHistories: () {},
selectedType: (val) {
print("------------");
print(val);
selectedType = val;
},
isEntityListSelected: (master) => widget.model.isEntityListSelected(master, entityList), isEntityListSelected: (master) => widget.model.isEntityListSelected(master, entityList),
)), )),
SizedBox( SizedBox(
@ -184,14 +189,18 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
return; return;
} }
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.preparePostProcedure( await widget.model
orderType: selectedType.toString(), .preparePostProcedure(
orderType: selectedType,
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
remarks: remarksController.text, remarks: remarksController.text,
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
isLocalBusy: true, isLocalBusy: true,
); )
GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
}), }),

@ -18,6 +18,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final Function(EntityList) addProcedure; final Function(EntityList) addProcedure;
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList; final List<EntityList> masterList;
Function(String val) selectedType;
EntityListCheckboxSearchWidget({ EntityListCheckboxSearchWidget({
Key? key, Key? key,
@ -27,6 +28,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
required this.masterList, required this.masterList,
required this.addProcedure, required this.addProcedure,
required this.isEntityListSelected, required this.isEntityListSelected,
required this.selectedType,
}) : super(key: key); }) : super(key: key);
@override @override
@ -34,13 +36,14 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
} }
class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearchWidget> { class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearchWidget> {
String selectedType = '0'; String? selectedType;
int typeUrgent = 0; int typeUrgent = 0;
int typeRegular = 0; int typeRegular = 0;
setSelectedType(String val) { setSelectedType(String val) {
setState(() { setState(() {
selectedType = val; selectedType = val;
widget.selectedType(val);
}); });
} }

@ -6,7 +6,7 @@ import 'package:hexcolor/hexcolor.dart';
import '../../config/config.dart'; import '../../config/config.dart';
class CustomBottomSheetContainer extends StatelessWidget { class CustomBottomSheetContainer extends StatelessWidget {
final Function onTap; final Function() onTap;
final String label; final String label;
double headerHeight = SizeConfig.heightMultiplier! * 12; double headerHeight = SizeConfig.heightMultiplier! * 12;
@ -28,15 +28,14 @@ class CustomBottomSheetContainer extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2)),
top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2)),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: .80, widthFactor: .80,
child: Center( child: Center(
child: AppButton( child: AppButton(
title: label, title: label,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
onPressed: onTap(), onPressed: onTap,
), ),
), ),
), ),

@ -9,13 +9,13 @@ class AddNewOrder extends StatelessWidget {
required this.label, required this.label,
}) : super(key: key); }) : super(key: key);
final Function onTap; final Function() onTap;
final String label; final String label;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: onTap(), onTap: onTap,
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).size.height * 0.18,

@ -5,12 +5,9 @@ import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart';
class DoctorCard extends StatelessWidget { class DoctorCard extends StatelessWidget {
final String? doctorName; final String? doctorName;
final String? branch; final String? branch;
@ -18,7 +15,7 @@ class DoctorCard extends StatelessWidget {
final String? profileUrl; final String? profileUrl;
final String? invoiceNO; final String? invoiceNO;
final String? orderNo; final String? orderNo;
final Function? onTap; final Function()? onTap;
final bool isPrescriptions; final bool isPrescriptions;
final String? clinic; final String? clinic;
final bool isShowEye; final bool isShowEye;
@ -56,7 +53,7 @@ class DoctorCard extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: InkWell( child: InkWell(
onTap: (isShowEye) ? onTap!() : null, onTap: (isShowEye) ? onTap : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -108,41 +105,36 @@ class DoctorCard extends StatelessWidget {
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, if (orderNo != null && !isPrescriptions)
children: <Widget>[ CustomRow(
if (orderNo != null && !isPrescriptions) label: TranslationBase.of(context).orderNo,
CustomRow( value: orderNo!,
label: TranslationBase.of(context).orderNo , valueSize: 13,
value: orderNo!, labelSize: 13,
valueSize: 13, ),
labelSize: 13, if (invoiceNO != null && !isPrescriptions)
), CustomRow(
if (invoiceNO != null && !isPrescriptions) label: TranslationBase.of(context).invoiceNo,
CustomRow( value: invoiceNO!,
label: TranslationBase.of(context).invoiceNo , valueSize: 13,
value: invoiceNO!, labelSize: 13,
valueSize: 13, ),
labelSize: 13, if (clinic != null)
), CustomRow(
if (clinic != null) label: TranslationBase.of(context).clinic + ": ",
CustomRow( value: clinic!,
label: TranslationBase.of(context).clinic + valueSize: 13,
": ", labelSize: 13,
),
value: clinic!, if (branch != null)
valueSize: 13, CustomRow(
labelSize: 13, label: TranslationBase.of(context).branch + ": ",
), value: branch!,
if (branch != null) valueSize: 13,
CustomRow( labelSize: 13,
label: TranslationBase.of(context).branch + ),
": ", ]),
value: branch!,
valueSize: 13,
labelSize: 13,
),
]),
), ),
), ),
if (isShowEye) if (isShowEye)

@ -89,14 +89,14 @@ class TextFields extends StatefulWidget {
final Color? suffixIconColor; final Color? suffixIconColor;
final Icon? prefixIcon; final Icon? prefixIcon;
final VoidCallback? onTap; final VoidCallback? onTap;
final Function? onTapTextFields; final Function()? onTapTextFields;
final TextEditingController? controller; final TextEditingController? controller;
final TextInputType? keyboardType; final TextInputType? keyboardType;
final FormFieldValidator? validator; final FormFieldValidator? validator;
final Function? onSaved; final Function(String? val)? onSaved;
final Function? onSuffixTap; final Function()? onSuffixTap;
final Function? onChanged; final Function(String val)? onChanged;
final Function? onSubmit; final Function()? onSubmit;
final bool? readOnly; final bool? readOnly;
final int? maxLength; final int? maxLength;
final int? minLines; final int? minLines;
@ -179,7 +179,7 @@ class _TextFieldsState extends State<TextFields> {
break; break;
default: default:
if (widget.suffixIcon != null) if (widget.suffixIcon != null)
return InkWell(onTap: widget.onSuffixTap!(), child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500]));
else else
return SizedBox(); return SizedBox();
} }
@ -211,7 +211,7 @@ class _TextFieldsState extends State<TextFields> {
child: Column( child: Column(
children: [ children: [
TextFormField( TextFormField(
onTap: widget.onTapTextFields!(), onTap: widget.onTapTextFields,
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
// autovalidate: widget.autoValidate, // autovalidate: widget.autoValidate,
@ -250,7 +250,7 @@ class _TextFieldsState extends State<TextFields> {
obscureText: widget.type == "password" && !view ? true : false, obscureText: widget.type == "password" && !view ? true : false,
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved!(), onSaved: widget.onSaved,
style: Theme.of(context).textTheme.bodyText1!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), style: Theme.of(context).textTheme.bodyText1!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[

@ -8,24 +8,24 @@ class CustomRow extends StatelessWidget {
Key? key, Key? key,
this.label = '', this.label = '',
this.value = '', this.value = '',
this.labelSize = 0, this.labelSize,
this.valueSize = 0, this.valueSize,
this.width = 0, this.width = 0,
this.isCopyable = true, this.isCopyable = true,
this.isExpanded = true, this.isExpanded = true,
this.labelColor = Colors.white, this.labelColor,
this.valueColor = Colors.white, this.valueColor,
}) : super(key: key); }) : super(key: key);
final String label; final String label;
final String value; final String value;
final double labelSize; final double? labelSize;
final double valueSize; final double? valueSize;
final double width; final double width;
final bool isCopyable; final bool isCopyable;
final bool isExpanded; final bool isExpanded;
final Color labelColor; final Color? labelColor;
final Color valueColor; final Color? valueColor;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,8 +34,7 @@ class CustomRow extends StatelessWidget {
children: [ children: [
AppText( AppText(
label, label,
fontSize: fontSize: labelSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.7,
labelSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.7,
color: labelColor ?? Color(0xFF575757), color: labelColor ?? Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.4, letterSpacing: -0.4,
@ -47,8 +46,7 @@ class CustomRow extends StatelessWidget {
flex: isExpanded ? 1 : 0, flex: isExpanded ? 1 : 0,
child: AppText( child: AppText(
value, value,
fontSize: fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: valueColor ?? Color(0xFF2B353E), color: valueColor ?? Color(0xFF2B353E),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48, letterSpacing: -0.48,

Loading…
Cancel
Save