project refactoring

app_translation
hussam al-habibeh 5 years ago
parent 9457e04825
commit bc340693ba

@ -1,12 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';

@ -71,10 +71,11 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} }
getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel,
{bool isLocalBusy = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _outPatientService.getPatientFileInformation( await _outPatientService
patientSearchRequestModel); .getPatientFileInformation(patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {
error = _outPatientService.error; error = _outPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -84,11 +85,12 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} }
getPatientBasedOnDate(
{item,
getPatientBasedOnDate ( PatientSearchRequestModel patientSearchRequestModel,
{item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, PatientType selectedPatientType,
bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async { bool isSearchWithKeyInfo,
OutPatientFilterType outPatientFilterType}) async {
String dateTo; String dateTo;
String dateFrom; String dateFrom;
if (OutPatientFilterType.Previous == outPatientFilterType) { if (OutPatientFilterType.Previous == outPatientFilterType) {
@ -128,11 +130,8 @@ class PatientSearchViewModel extends BaseViewModel {
currentModel.to = dateTo; currentModel.to = dateTo;
await getOutPatient(currentModel, isLocalBusy: true); await getOutPatient(currentModel, isLocalBusy: true);
filterData = _outPatientService.patientList; filterData = _outPatientService.patientList;
} }
PatientInPatientService _inPatientService = PatientInPatientService _inPatientService =
locator<PatientInPatientService>(); locator<PatientInPatientService>();
@ -163,12 +162,11 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
filteredInPatientItems.clear(); filteredInPatientItems.clear();
if (inPatientList.length > 0) if (inPatientList.length > 0) filteredInPatientItems.addAll(inPatientList);
filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
void clearPatientList(){ void clearPatientList() {
_inPatientService.inPatientList = []; _inPatientService.inPatientList = [];
_inPatientService.myInPatientList = []; _inPatientService.myInPatientList = [];
} }
@ -197,6 +195,4 @@ class PatientSearchViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
} }
} }

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/soap/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';

@ -1,16 +1,18 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';

@ -3,7 +3,8 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
@ -503,7 +504,9 @@ class _HomeScreenState extends State<HomeScreen> {
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
"My\n"+TranslationBase.of(context).inPatient, "My\n" +
TranslationBase.of(context)
.inPatient,
color: Colors.white, color: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,

@ -16,8 +16,8 @@ class PatientInPatientScreen extends StatefulWidget {
_PatientInPatientScreenState createState() => _PatientInPatientScreenState(); _PatientInPatientScreenState createState() => _PatientInPatientScreenState();
} }
class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
@ -85,7 +85,8 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), preferredSize: Size.fromHeight(
MediaQuery.of(context).size.height * 0.070),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -103,12 +104,18 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
indicatorWeight: 1.0, indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), labelPadding: EdgeInsets.only(
top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 0,
tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), TranslationBase.of(context).inPatientAll,
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), counter: model.inPatientList.length),
tabWidget(
screenSize, _activeTab == 1, "My InPatients",
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),
], ],
), ),
), ),
@ -137,15 +144,13 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
); );
} }
Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){ Widget tabWidget(Size screenSize, bool isActive, String title,
{int counter = -1}) {
return Center( return Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
isActive isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: 4,
borderWidth: 0), borderWidth: 0),
@ -164,9 +169,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
width: 15, width: 15,
height: 15, height: 15,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isActive color: isActive ? Colors.white : Color(0xFFD02127),
? Colors.white
: Color(0xFFD02127),
shape: BoxShape.circle, shape: BoxShape.circle,
), ),
child: Center( child: Center(

@ -1,9 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_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';
@ -42,7 +43,6 @@ class OutPatientsScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
OutPatientsScreen( OutPatientsScreen(
{this.patientSearchForm, {this.patientSearchForm,
this.selectedType, this.selectedType,
@ -53,7 +53,9 @@ class OutPatientsScreen extends StatefulWidget {
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); this.isInpatient = false,
this.searchKey,
this.isSearchAndOut = false});
@override @override
_OutPatientsScreenState createState() => _OutPatientsScreenState(); _OutPatientsScreenState createState() => _OutPatientsScreenState();
@ -82,20 +84,11 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
_times = [ _times = [
TranslationBase TranslationBase.of(context).previous,
.of(context) TranslationBase.of(context).today,
.previous, TranslationBase.of(context).nextWeek,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.nextWeek,
]; ];
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context)
.size;
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
@ -106,7 +99,6 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader( appBar: PatientSearchHeader(
title: "My Out patient", title: "My Out patient",
), ),
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
@ -114,46 +106,51 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils decoration: TextFieldsUtils.containerBorderDecoration(
.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC),
Color(0Xffffffff), borderRadius: 4, borderWidth: 0),
Color(0xFFCCCCCC),
borderRadius: 4,
borderWidth: 0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _times.map((item) { children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item bool _isActive =
? true _times[_activeLocation] == item ? true : false;
: false;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
setState(() { setState(() {
_activeLocation = _times.indexOf(item); _activeLocation = _times.indexOf(item);
outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; outPatientFilterType = _activeLocation == 0
_controller.text=""; ? OutPatientFilterType.Previous
: _activeLocation == 1
? OutPatientFilterType.Today
: OutPatientFilterType.NextWeek;
_controller.text = "";
}); });
model.searchData(""); model.searchData("");
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item, await model.getPatientBasedOnDate(
item: item,
selectedPatientType: widget.selectedPatientType, selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget patientSearchRequestModel:
.patientSearchRequestModel, widget.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); isSearchWithKeyInfo: widget.isSearchWithKeyInfo,
outPatientFilterType: outPatientFilterType);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
child: Center( child: Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration:
TextFieldsUtils.containerBorderDecoration(
_isActive _isActive
? Color(0xFFD02127 /*B8382B*/) ? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA), : Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), _isActive
? Color(0xFFD02127)
: Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: 4,
borderWidth: 0), borderWidth: 0),
child: Center( child: Center(
@ -163,18 +160,22 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
AppText( AppText(
item, item,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E), color: _isActive
? Colors.white
: Color(0xFF2B353E),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
_isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( _isActive &&
_activeLocation != 0 &&
model.state == ViewState.Idle
? Container(
padding: EdgeInsets.all(2), padding: EdgeInsets.all(2),
margin: EdgeInsets.symmetric(horizontal: 5), margin: EdgeInsets.symmetric(
decoration: horizontal: 5),
new BoxDecoration( decoration: new BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: borderRadius:
BorderRadius.circular( BorderRadius.circular(50),
50),
), ),
constraints: BoxConstraints( constraints: BoxConstraints(
minWidth: 20, minWidth: 20,
@ -184,12 +185,11 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
model.filterData.length.toString(), model.filterData.length.toString(),
style: new TextStyle( style: new TextStyle(
color: Colors.red, color: Colors.red,
fontSize: 10 fontSize: 10),
), textAlign: TextAlign.center,
textAlign:
TextAlign.center,
), ),
):Container(), )
: Container(),
], ],
), ),
), ),
@ -205,49 +205,49 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, top: 10),
left: 10, top: 10),
child: AppText( child: AppText(
TranslationBase.of( TranslationBase.of(context).searchPatientName,
context)
.searchPatientName,
fontSize: 13, fontSize: 13,
)), )),
AppTextFormField( AppTextFormField(
// focusNode: focusProject, // focusNode: focusProject,
controller: _controller, controller: _controller,
borderColor: Colors.white borderColor: Colors.white,
,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(
_activeLocation !=0 _activeLocation != 0
? DoctorApp.filter_1 ? DoctorApp.filter_1
: FontAwesomeIcons.slidersH, : FontAwesomeIcons.slidersH,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: padding: EdgeInsets.only(bottom: 30),
EdgeInsets.only( onPressed: _activeLocation != 0
bottom: 30), ? null
onPressed: _activeLocation !=0 ? null : () { : () {
Navigator.push(context, MaterialPageRoute( Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,))); FilterDatePage(
outPatientFilterType:
outPatientFilterType,
patientSearchViewModel:
model,
)));
}, },
), ),
onChanged: (String str) { onChanged: (String str) {
model.searchData(str); model.searchData(str);
}), }),
@ -255,7 +255,6 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
Expanded( Expanded(
child: Container( child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
@ -270,15 +269,19 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
shrinkWrap: true, shrinkWrap: true,
itemCount: model.filterData.length, itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43)) if (_activeLocation != 0 ||
return (model.filterData[index].patientStatusType !=
Padding( null &&
model.filterData[index]
.patientStatusType ==
43))
return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.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 // TODO change the parameter to daynamic
@ -305,8 +308,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
})), })),
), ),
], ],
) )),
),
); );
} }
} }

@ -31,10 +31,8 @@ class PatientsSearchResultScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
PatientsSearchResultScreen( PatientsSearchResultScreen(
{ {this.selectedPatientType,
this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
@ -52,7 +50,6 @@ class _PatientsSearchResultScreenState
int clinicId; int clinicId;
AuthViewModel authProvider; AuthViewModel authProvider;
String patientType; String patientType;
String patientTypeTitle; String patientTypeTitle;
var selectedFilter = 1; var selectedFilter = 1;
@ -63,18 +60,17 @@ class _PatientsSearchResultScreenState
PatientModel patient; PatientModel patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { if (!widget.isSearchWithKeyInfo &&
widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel); await model.getOutPatient(widget.patientSearchRequestModel);
} else { } else {
await model.getPatientFileInformation(widget.patientSearchRequestModel); await model
.getPatientFileInformation(widget.patientSearchRequestModel);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -91,24 +87,19 @@ class _PatientsSearchResultScreenState
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(Radius.circular(6.0)),
Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 10, top: 10),
left: 10, top: 10),
child: AppText( child: AppText(
TranslationBase.of( TranslationBase.of(context).searchPatientName,
context)
.searchPatientName,
fontSize: 13, fontSize: 13,
)), )),
AppTextFormField( AppTextFormField(
@ -121,9 +112,7 @@ class _PatientsSearchResultScreenState
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: padding: EdgeInsets.only(bottom: 30),
EdgeInsets.only(
bottom: 30),
), ),
onChanged: (String str) { onChanged: (String str) {
model.searchData(str); model.searchData(str);
@ -152,7 +141,7 @@ class _PatientsSearchResultScreenState
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 // TODO change the parameter to daynamic
@ -168,7 +157,8 @@ class _PatientsSearchResultScreenState
"isSearch": widget.isSearch, "isSearch": widget.isSearch,
"isInpatient": widget.isInpatient, "isInpatient": widget.isInpatient,
"arrivalType": "7", "arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut, "isSearchAndOut":
widget.isSearchAndOut,
}); });
}, },
// isFromSearch: widget.isSearch, // isFromSearch: widget.isSearch,
@ -177,8 +167,7 @@ class _PatientsSearchResultScreenState
})), })),
), ),
], ],
) )),
),
); );
} }
} }

@ -32,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget {
_AddReplayOnReferralPatientState(); _AddReplayOnReferralPatientState();
} }
class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> { class _AddReplayOnReferralPatientState
extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
@ -45,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient>
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -108,7 +107,7 @@ class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient>
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty? 130:70, height: replayOnReferralController.text.isNotEmpty ? 130 : 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -1,7 +1,7 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_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/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';

@ -2,9 +2,10 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_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';

@ -1,8 +1,9 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -50,7 +52,7 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(!projectsProvider.isArabic) if (!projectsProvider.isArabic)
AppText( AppText(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -193,7 +195,8 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils DateUtils.getDayMonthYearDateFormatted(
DateUtils
.convertStringToDate( .convertStringToDate(
item.startDate)), item.startDate)),
fontWeight: fontWeight:
@ -212,7 +215,9 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted(DateUtils DateUtils
.getDayMonthYearDateFormatted(
DateUtils
.convertStringToDate( .convertStringToDate(
item.endDate, item.endDate,
)), )),

Loading…
Cancel
Save