merge-requests/292/head
hussam al-habibeh 5 years ago
parent d78aa2321d
commit 6dd1d9ef90

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
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/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -17,6 +18,7 @@ class LookupService extends BaseService {
List<dynamic> medicationFrequencyList = []; List<dynamic> medicationFrequencyList = [];
List<dynamic> medicationDoseTimeList = []; List<dynamic> medicationDoseTimeList = [];
List<dynamic> medicationIndicationsList = []; List<dynamic> medicationIndicationsList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
List<MasterKeyModel> get historyFamilyList => _historyFamilyList; List<MasterKeyModel> get historyFamilyList => _historyFamilyList;
List<MasterKeyModel> _historyFamilyList = []; List<MasterKeyModel> _historyFamilyList = [];

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.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/doctor/request_schedule.dart'; import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart'; import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart'; import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart';
@ -10,6 +12,8 @@ class MedicineService extends BaseService {
get pharmacyItemsList => _pharmacyItemsList; get pharmacyItemsList => _pharmacyItemsList;
get pharmaciesList => _pharmaciesList; get pharmaciesList => _pharmaciesList;
List<GetAssessmentResModel> patientAssessmentList = [];
PharmaciesItemsRequestModel _itemsRequestModel = PharmaciesItemsRequestModel _itemsRequestModel =
PharmaciesItemsRequestModel(); PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();

@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.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/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_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/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
@ -30,6 +32,21 @@ class PrescriptionService extends LookupService {
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel(); PostPrescriptionReqModel();
Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false;
await baseAppClient.post(GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getAssessmentReqModel.toJson());
}
Future getPrescription({int mrn}) async { Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn);

@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart
import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -28,6 +30,8 @@ class MedicineViewModel extends BaseViewModel {
_prescriptionService.medicationIndicationsList; _prescriptionService.medicationIndicationsList;
get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList;
List<GetAssessmentResModel> get patientAssessmentList =>
_prescriptionService.patientAssessmentList;
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList; _prescriptionService.allMedicationList;
@ -52,6 +56,17 @@ class MedicineViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async {
setState(ViewState.Busy);
await _prescriptionService.getPatientAssessment(getAssessmentReqModel);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationStrength() async { Future getMedicationStrength() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService await _prescriptionService

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_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/SOAP/GetAssessmentReqModel.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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart';
@ -180,6 +181,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patient.patientMRN,
episodeID: widget.patient.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: widget.patient.appointmentNo);
await model.getMedicationList(); await model.getMedicationList();
await model.getMedicationStrength(); await model.getMedicationStrength();
await model.getMedicationDuration(); await model.getMedicationDuration();
@ -187,8 +194,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel);
}, },
builder: (BuildContext context, MedicineViewModel model, Widget child) => builder: (
BuildContext context,
MedicineViewModel model,
Widget child,
) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
@ -298,22 +310,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
AppText('Order Type'), AppText('Order Type'),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
value: 0, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value);
}, },
), ),
Text('Regular'), Text('Regular'),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text('Urgent'),
], ],
), ),
), ),
@ -534,46 +537,57 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( //model.patientAssessmentList.forEach((element) { }).
height: screenSize.height * 0.070, Column(
child: InkWell( children: model.patientAssessmentList
onTap: indicationList != null .map((element) {
? () { return Container(
ListSelectDialog dialog = height: screenSize.height * 0.070,
ListSelectDialog( child: InkWell(
list: indicationList, onTap: indicationList != null
attributeName: 'name', ? () {
attributeValueId: 'id', ListSelectDialog dialog =
okText: ListSelectDialog(
TranslationBase.of(context) list: indicationList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(
context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
indication = selectedValue; indication =
}); selectedValue;
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder:
}, (BuildContext context) {
); return dialog;
} },
: null, );
child: TextField( }
decoration: textFieldSelectorDecoration( : null,
TranslationBase.of(context) child: TextField(
.indication, decoration:
indication != null textFieldSelectorDecoration(
? indication['name'] element.icdCode10ID
: null, .toString(),
true), indication != null
enabled: false, ? indication['name']
), : null,
), true),
enabled: true,
readOnly: true,
),
),
);
}).toList(),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,

@ -181,6 +181,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
(index) => Container( (index) => Container(
child: Column( child: Column(
children: [ children: [
SizedBox(
height: MediaQuery.of(
context)
.size
.height *
0.022,
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
@ -193,7 +200,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.23, 0.24,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -232,7 +239,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.3019, 0.3499,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -328,7 +335,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
], ],
), ),
SizedBox( SizedBox(
height: 3.0, height: 10.0,
), ),
Row( Row(
children: [ children: [
@ -351,7 +358,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
], ],
), ),
SizedBox( SizedBox(
height: 18.0, height: 20.0,
), ),
Row( Row(
children: [ children: [
@ -385,10 +392,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
30, 30,
child: child:
AppText( AppText(
model model.prescriptionList[0].entityList[index].remarks == null
.prescriptionList[0] ? ""
.entityList[index] : model.prescriptionList[0].entityList[index].remarks,
.remarks,
fontSize: fontSize:
11.5, 11.5,
), ),
@ -400,13 +406,6 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
height: 10.0, height: 10.0,
), ),
Divider(
height: 0,
thickness:
1.0,
color: Colors
.grey,
),
// SizedBox( // SizedBox(
// height: 40, // height: 40,
// ), // ),
@ -418,7 +417,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.05, 0.08,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -484,6 +483,11 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
], ],
), ),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
),
], ],
), ),
), ),

@ -128,13 +128,16 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
Container( Container(
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.500, 0.4900,
height:
MediaQuery.of(context).size.height *
0.55,
child: TextFields( child: TextFields(
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(4) LengthLimitingTextInputFormatter(4)
], ],
hintText: TranslationBase.of(context) hintText: widget.doseStreangth,
.strength, fontSize: 15.0,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
onChanged: (String value) { onChanged: (String value) {

@ -195,6 +195,13 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
(index) => Container( (index) => Container(
child: Column( child: Column(
children: [ children: [
SizedBox(
height:
MediaQuery.of(context)
.size
.height *
0.022,
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
@ -298,17 +305,20 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
15.0, 14.0,
), ),
AppText( Expanded(
model.procedureList[0].entityList[index].orderType == child:
1 AppText(
? 'Regular' model.procedureList[0].entityList[index].orderType ==
: 'Urgent', 1
fontSize: ? 'Regular'
13.0, : 'Urgent',
color: Color( fontSize:
0xFFB9382C), 13.0,
color: Color(
0xFFB9382C),
),
), ),
], ],
), ),
@ -391,7 +401,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
height: MediaQuery.of(context) height: MediaQuery.of(context)
.size .size
.height * .height *
0.052, 0.047,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
@ -413,12 +423,6 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
height: 20.0, height: 20.0,
), ),
Divider(
height: 1.0,
thickness: 1.0,
color:
Colors.grey,
)
// SizedBox( // SizedBox(
// height: 40, // height: 40,
// ), // ),
@ -468,9 +472,14 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
) )
], ],
), ),
) ),
], ],
), ),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
], ],
), ),
), ),

@ -86,165 +86,184 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
(BuildContext context, ProcedureViewModel model, Widget child) => (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Container( child: DraggableScrollableSheet(
height: MediaQuery.of(context).size.height * 0.95, minChildSize: 0.90,
child: Form( initialChildSize: 0.95,
child: Padding( maxChildSize: 1.0,
padding: builder:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), (BuildContext context, ScrollController scrollController) {
child: Column( return SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ height: MediaQuery.of(context).size.height * 1.20,
AppText( child: Form(
widget.procedureName.toUpperCase(), child: Padding(
fontWeight: FontWeight.w700, padding: EdgeInsets.symmetric(
), horizontal: 20.0, vertical: 10.0),
SizedBox( child: Column(
height: 30.0, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
Container( AppText(
height: screenSize.height * 0.070, widget.procedureName.toUpperCase(),
child: InkWell( fontWeight: FontWeight.w700,
onTap: model.categoryList != null && ),
model.categoryList.length > 0 SizedBox(
? () { height: 30.0,
ListSelectDialog dialog = ListSelectDialog( ),
list: model.categoryList, Container(
attributeName: 'categoryName', height: screenSize.height * 0.070,
attributeValueId: 'categoryId', child: InkWell(
okText: TranslationBase.of(context).ok, onTap: model.categoryList != null &&
okFunction: (selectedValue) { model.categoryList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.categoryList,
attributeName: 'categoryName',
attributeValueId: 'categoryId',
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedCategory =
selectedValue;
model.getProcedureCategory(
categoryName:
selectedCategory[
'categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
),
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList: widget
.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() { setState(() {
selectedCategory = selectedValue; entityList.remove(item);
model.getProcedureCategory(
categoryName: selectedCategory[
'categoryName']);
}); });
}, },
); addHistory: (history) {
showDialog( setState(() {
barrierDismissible: false, entityList.add(history);
context: context, });
builder: (BuildContext context) {
return dialog;
}, },
); addSelectedHistories: () {
//model.getProcedureCategory(); //TODO build your fun herr
} // widget.addSelectedHistories();
: null, },
child: TextField( isEntityListSelected: (master) =>
decoration: textFieldSelectorDecoration( isEntityListSelected(master),
TranslationBase.of(context).procedureCategorise, ),
selectedCategory != null ),
? selectedCategory['categoryName'] Container(
: null, child: Row(
true, children: [
suffixIcon: Icon( AppText(
Icons.search, TranslationBase.of(context).orderType),
color: Colors.black, Radio(
)), activeColor: Color(0xFFB9382C),
enabled: false, value: 0,
), groupValue: selectedType,
), onChanged: (value) {
), setSelectedType(value);
if (widget.model.categoriesList.length != 0) },
NetworkBaseView( ),
baseViewModel: model, Text(TranslationBase.of(context).urgent),
child: EntityListCheckboxSearchWidget( Radio(
model: widget.model, activeColor: Color(0xFFB9382C),
masterList: groupValue: selectedType,
widget.model.categoriesList[0].entityList, value: 1,
removeHistory: (item) { onChanged: (value) {
setState(() { setSelectedType(value);
entityList.remove(item); },
}); ),
}, Text(TranslationBase.of(context).regular),
addHistory: (history) { ],
setState(() { ),
entityList.add(history); ),
}); SizedBox(
}, height: 12.0,
addSelectedHistories: () { ),
//TODO build your fun herr Container(
// widget.addSelectedHistories(); decoration: BoxDecoration(
}, borderRadius:
isEntityListSelected: (master) => BorderRadius.all(Radius.circular(6.0)),
isEntityListSelected(master), border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
fontSize: 15.0,
controller: widget.remarksController,
maxLines: 3,
minLines: 2,
),
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
orderType: selectedType.toString(),
categorieId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks:
widget.remarksController.text);
// authorizationForm(context);
},
),
],
),
),
],
), ),
), ),
Container( )),
child: Row( );
children: [ }),
AppText(TranslationBase.of(context).orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
],
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
controller: widget.remarksController,
maxLines: 5,
minLines: 3,
),
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
orderType: selectedType.toString(),
categorieId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks: widget.remarksController.text);
// authorizationForm(context);
},
),
],
),
),
],
),
),
)),
), ),
); );
}); });

@ -76,7 +76,8 @@ class TextFields extends StatefulWidget {
this.hintColor, this.hintColor,
this.hasBorder = true, this.hasBorder = true,
this.onTapTextFields, this.onTapTextFields,
this.hasLabelText = false, this.showLabelText= false}) this.hasLabelText = false,
this.showLabelText = false})
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -233,22 +234,21 @@ class _TextFieldsState extends State<TextFields> {
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, maxLengthEnforced: widget.maxLengthEnforced,
initialValue: widget.initialValue, initialValue: widget.initialValue,
onChanged: (value){ onChanged: (value) {
if(widget.showLabelText) { if (widget.showLabelText) {
if((value== null || value =='' )) { if ((value == null || value == '')) {
setState(() { setState(() {
widget.hasLabelText = false; widget.hasLabelText = false;
}); });
}else{ } else {
setState(() { setState(() {
widget.hasLabelText = true; widget.hasLabelText = true;
}); });
} }
} }
widget.onChanged(value); widget.onChanged(value);
} , },
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
controller: widget.controller, controller: widget.controller,
@ -258,10 +258,8 @@ class _TextFieldsState extends State<TextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context) style: Theme.of(context).textTheme.bodyText1.copyWith(
.textTheme fontSize: widget.fontSize, fontWeight: widget.fontWeight),
.bodyText1
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly, WhitelistingTextInputFormatter.digitsOnly,
@ -271,33 +269,27 @@ class _TextFieldsState extends State<TextFields> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hasLabelText ? widget.hintText : null, labelText: widget.hasLabelText ? widget.hintText : null,
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme color: widget.hintColor ?? Theme.of(context).hintColor,
.of(context)
.hintColor,
), ),
counterText: "", counterText: "",
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme color: widget.hintColor ?? Theme.of(context).hintColor,
.of(context)
.hintColor,
), ),
contentPadding: widget.padding != null contentPadding: widget.padding != null
? widget.padding ? widget.padding
: EdgeInsets.symmetric( : EdgeInsets.symmetric(
vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, vertical:
horizontal: 16.0), (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.0),
filled: true, filled: true,
fillColor: widget.bare fillColor: widget.bare
? Colors.transparent ? Colors.transparent
: Theme : Theme.of(context).backgroundColor,
.of(context)
.backgroundColor,
suffixIcon: _buildSuffixIcon(), suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.prefixIcon, prefixIcon: widget.prefixIcon,
errorStyle: TextStyle( errorStyle: TextStyle(
@ -305,48 +297,53 @@ class _TextFieldsState extends State<TextFields> {
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
height: widget.borderOnlyError ? 0.0 : null), height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Theme ? BorderSide(
.of(context) color: Theme.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0) : BorderSide( width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0),
),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Theme ? BorderSide(
.of(context) color: Theme.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0) : BorderSide( width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Colors.grey, width: 1.0) : BorderSide( ? BorderSide(color: Colors.grey, width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0),
),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Colors.grey, width: 1.0) : BorderSide( ? BorderSide(color: Colors.grey, width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Colors.grey, width: 1.0) : BorderSide( ? BorderSide(color: Colors.grey, width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0),
), ),
), ),
), ),
], ],
), ),
)); ));
} }
} }

Loading…
Cancel
Save