Merge branch 'fix-issues' into 'development'

fix bugs

See merge request Cloud_Solution/doctor_app_flutter!292
merge-requests/293/merge
Mohammad Aljammal 4 years ago
commit 127b5eb4bd

@ -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,7 +537,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( //model.patientAssessmentList.forEach((element) { }).
Column(
children: model.patientAssessmentList
.map((element) {
return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: indicationList != null onTap: indicationList != null
@ -544,36 +551,43 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
list: indicationList, list: indicationList,
attributeName: 'name', attributeName: 'name',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
indication = selectedValue; indication =
selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
TranslationBase.of(context) textFieldSelectorDecoration(
.indication, element.icdCode10ID
.toString(),
indication != null indication != null
? indication['name'] ? indication['name']
: null, : null,
true), true),
enabled: false, 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,8 +305,10 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
15.0, 14.0,
), ),
Expanded(
child:
AppText( AppText(
model.procedureList[0].entityList[index].orderType == model.procedureList[0].entityList[index].orderType ==
1 1
@ -310,6 +319,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
color: Color( color: Color(
0xFFB9382C), 0xFFB9382C),
), ),
),
], ],
), ),
Row( Row(
@ -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,12 +86,19 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
(BuildContext context, ProcedureViewModel model, Widget child) => (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.95, height: MediaQuery.of(context).size.height * 1.20,
child: Form( child: Form(
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), horizontal: 20.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -108,16 +115,20 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
onTap: model.categoryList != null && onTap: model.categoryList != null &&
model.categoryList.length > 0 model.categoryList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog =
ListSelectDialog(
list: model.categoryList, list: model.categoryList,
attributeName: 'categoryName', attributeName: 'categoryName',
attributeValueId: 'categoryId', attributeValueId: 'categoryId',
okText: TranslationBase.of(context).ok, okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
selectedCategory = selectedValue; selectedCategory =
selectedValue;
model.getProcedureCategory( model.getProcedureCategory(
categoryName: selectedCategory[ categoryName:
selectedCategory[
'categoryName']); 'categoryName']);
}); });
}, },
@ -134,7 +145,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).procedureCategorise, TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null selectedCategory != null
? selectedCategory['categoryName'] ? selectedCategory['categoryName']
: null, : null,
@ -152,8 +164,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: masterList: widget
widget.model.categoriesList[0].entityList, .model.categoriesList[0].entityList,
removeHistory: (item) { removeHistory: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -175,7 +187,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Container( Container(
child: Row( child: Row(
children: [ children: [
AppText(TranslationBase.of(context).orderType), AppText(
TranslationBase.of(context).orderType),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
value: 0, value: 0,
@ -205,19 +218,22 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
hintText: widget.remarks, hintText: widget.remarks,
fontSize: 15.0,
controller: widget.remarksController, controller: widget.remarksController,
maxLines: 5, maxLines: 3,
minLines: 3, minLines: 2,
), ),
), ),
SizedBox( SizedBox(
height: 50.0, height: 50.0,
), ),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
@ -234,7 +250,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
entityList: entityList, entityList: entityList,
patient: widget.patient, patient: widget.patient,
model: widget.model, model: widget.model,
remarks: widget.remarksController.text); remarks:
widget.remarksController.text);
// authorizationForm(context); // authorizationForm(context);
}, },
), ),
@ -245,6 +262,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
), ),
), ),
)), )),
);
}),
), ),
); );
}); });

@ -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;
@ -246,7 +247,6 @@ class _TextFieldsState extends State<TextFields> {
} }
} }
widget.onChanged(value); widget.onChanged(value);
}, },
focusNode: _focusNode, focusNode: _focusNode,
@ -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:
(widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.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