diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 0c361003..e77431aa 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.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:flutter/cupertino.dart'; @@ -17,6 +18,7 @@ class LookupService extends BaseService { List medicationFrequencyList = []; List medicationDoseTimeList = []; List medicationIndicationsList = []; + List patientAssessmentList = []; List get historyFamilyList => _historyFamilyList; List _historyFamilyList = []; diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/medicine_service.dart index f205dab1..44b380d6 100644 --- a/lib/core/service/medicine_service.dart +++ b/lib/core/service/medicine_service.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/config.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/pharmacies/pharmacies_List_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 pharmaciesList => _pharmaciesList; + List patientAssessmentList = []; + PharmaciesItemsRequestModel _itemsRequestModel = PharmaciesItemsRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index b7f9e80e..4258ee81 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -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/lookup-service.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/patient/patiant_info_model.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(); + 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 { _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 5b7c2f6a..f57de2b3 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -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/medicine_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 'base_view_model.dart'; @@ -28,6 +30,8 @@ class MedicineViewModel extends BaseViewModel { _prescriptionService.medicationIndicationsList; get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; + List get patientAssessmentList => + _prescriptionService.patientAssessmentList; List get allMedicationList => _prescriptionService.allMedicationList; @@ -52,6 +56,17 @@ class MedicineViewModel extends BaseViewModel { 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 { setState(ViewState.Busy); await _prescriptionService diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a8279634..b079a661 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -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/viewModel/medicine_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; @@ -180,6 +181,12 @@ class _PrescriptionFormWidgetState extends State { return BaseView( 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.getMedicationStrength(); await model.getMedicationDuration(); @@ -187,8 +194,13 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationFrequency(); await model.getMedicationDoseTime(); await model.getMedicationIndications(); + await model.getPatientAssessment(getAssessmentReqModel); }, - builder: (BuildContext context, MedicineViewModel model, Widget child) => + builder: ( + BuildContext context, + MedicineViewModel model, + Widget child, + ) => NetworkBaseView( baseViewModel: model, child: DraggableScrollableSheet( @@ -298,22 +310,13 @@ class _PrescriptionFormWidgetState extends State { AppText('Order Type'), Radio( activeColor: Color(0xFFB9382C), - value: 0, + value: 1, groupValue: selectedType, onChanged: (value) { setSelectedType(value); }, ), Text('Regular'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('Urgent'), ], ), ), @@ -534,46 +537,57 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) + //model.patientAssessmentList.forEach((element) { }). + Column( + children: model.patientAssessmentList + .map((element) { + return Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of( + context) .ok, - okFunction: (selectedValue) { - setState(() { - indication = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .indication, - indication != null - ? indication['name'] - : null, - true), - enabled: false, - ), - ), + okFunction: (selectedValue) { + setState(() { + indication = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + element.icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ); + }).toList(), ), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index c7c4c60e..1588c4c4 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -181,6 +181,13 @@ class _NewPrescriptionScreenState extends State { (index) => Container( child: Column( children: [ + SizedBox( + height: MediaQuery.of( + context) + .size + .height * + 0.022, + ), Row( mainAxisAlignment: MainAxisAlignment @@ -193,7 +200,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.23, + 0.24, width: MediaQuery.of( context) .size @@ -232,7 +239,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.3019, + 0.3499, width: MediaQuery.of( context) .size @@ -328,7 +335,7 @@ class _NewPrescriptionScreenState extends State { ], ), SizedBox( - height: 3.0, + height: 10.0, ), Row( children: [ @@ -351,7 +358,7 @@ class _NewPrescriptionScreenState extends State { ], ), SizedBox( - height: 18.0, + height: 20.0, ), Row( children: [ @@ -385,10 +392,9 @@ class _NewPrescriptionScreenState extends State { 30, child: AppText( - model - .prescriptionList[0] - .entityList[index] - .remarks, + model.prescriptionList[0].entityList[index].remarks == null + ? "" + : model.prescriptionList[0].entityList[index].remarks, fontSize: 11.5, ), @@ -400,13 +406,6 @@ class _NewPrescriptionScreenState extends State { height: 10.0, ), - Divider( - height: 0, - thickness: - 1.0, - color: Colors - .grey, - ), // SizedBox( // height: 40, // ), @@ -418,7 +417,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.05, + 0.08, width: MediaQuery.of( context) .size @@ -484,6 +483,11 @@ class _NewPrescriptionScreenState extends State { ), ], ), + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, + ), ], ), ), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 5c7c6e76..68a7e739 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -128,13 +128,16 @@ class _UpdatePrescriptionFormState extends State { Container( width: MediaQuery.of(context).size.width * - 0.500, + 0.4900, + height: + MediaQuery.of(context).size.height * + 0.55, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter(4) ], - hintText: TranslationBase.of(context) - .strength, + hintText: widget.doseStreangth, + fontSize: 15.0, controller: strengthController, keyboardType: TextInputType.number, onChanged: (String value) { diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index ca126609..bb897351 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -195,6 +195,13 @@ class _ProcedureScreenState extends State { (index) => Container( child: Column( children: [ + SizedBox( + height: + MediaQuery.of(context) + .size + .height * + 0.022, + ), Row( mainAxisAlignment: MainAxisAlignment @@ -298,17 +305,20 @@ class _ProcedureScreenState extends State { FontWeight .w700, fontSize: - 15.0, + 14.0, ), - AppText( - model.procedureList[0].entityList[index].orderType == - 1 - ? 'Regular' - : 'Urgent', - fontSize: - 13.0, - color: Color( - 0xFFB9382C), + Expanded( + child: + AppText( + model.procedureList[0].entityList[index].orderType == + 1 + ? 'Regular' + : 'Urgent', + fontSize: + 13.0, + color: Color( + 0xFFB9382C), + ), ), ], ), @@ -391,7 +401,7 @@ class _ProcedureScreenState extends State { height: MediaQuery.of(context) .size .height * - 0.052, + 0.047, width: MediaQuery.of(context) .size .width * @@ -413,12 +423,6 @@ class _ProcedureScreenState extends State { height: 20.0, ), - Divider( - height: 1.0, - thickness: 1.0, - color: - Colors.grey, - ) // SizedBox( // height: 40, // ), @@ -468,9 +472,14 @@ class _ProcedureScreenState extends State { ) ], ), - ) + ), ], ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), ], ), ), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 8ed40dc3..c1dc31f3 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -86,165 +86,184 @@ class _UpdateProcedureWidgetState extends State { (BuildContext context, ProcedureViewModel model, Widget child) => NetworkBaseView( baseViewModel: model, - child: Container( - height: MediaQuery.of(context).size.height * 0.95, - child: Form( - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.categoryList != null && + 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(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: selectedCategory[ - 'categoryName']); + entityList.remove(item); }); }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; + addHistory: (history) { + setState(() { + entityList.add(history); + }); }, - ); - //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(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ), + ), + 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, + 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: [ + 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: [ - 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); - }, - ), - ], - ), - ), - ], - ), - ), - )), + )), + ); + }), ), ); }); diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 8563bb41..d2807a26 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -76,7 +76,8 @@ class TextFields extends StatefulWidget { this.hintColor, this.hasBorder = true, this.onTapTextFields, - this.hasLabelText = false, this.showLabelText= false}) + this.hasLabelText = false, + this.showLabelText = false}) : super(key: key); final String hintText; @@ -233,22 +234,21 @@ class _TextFieldsState extends State { maxLines: widget.maxLines ?? 1, maxLengthEnforced: widget.maxLengthEnforced, initialValue: widget.initialValue, - onChanged: (value){ - if(widget.showLabelText) { - if((value== null || value =='' )) { + onChanged: (value) { + if (widget.showLabelText) { + if ((value == null || value == '')) { setState(() { widget.hasLabelText = false; }); - }else{ + } else { setState(() { widget.hasLabelText = true; }); } } - widget.onChanged(value); - } , + }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -258,10 +258,8 @@ class _TextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.bodyText1.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -271,33 +269,27 @@ class _TextFieldsState extends State { decoration: InputDecoration( labelText: widget.hasLabelText ? widget.hintText : null, labelStyle: TextStyle( - fontSize: widget.fontSize, fontWeight: widget.fontWeight, - color: widget.hintColor ?? Theme - .of(context) - .hintColor, + color: widget.hintColor ?? Theme.of(context).hintColor, ), counterText: "", hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, - color: widget.hintColor ?? Theme - .of(context) - .hintColor, + color: widget.hintColor ?? Theme.of(context).hintColor, ), contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric( - vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + vertical: + (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, + horizontal: 16.0), filled: true, fillColor: widget.bare ? Colors.transparent - : Theme - .of(context) - .backgroundColor, + : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( @@ -305,48 +297,53 @@ class _TextFieldsState extends State { fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Theme - .of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), + borderSide: widget.hasBorder + ? BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0), + ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Theme - .of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), + borderSide: widget.hasBorder + ? BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Colors.grey, width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), + borderSide: widget.hasBorder + ? BorderSide(color: Colors.grey, width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0), + ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Colors.grey, width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)), + borderSide: widget.hasBorder + ? BorderSide(color: Colors.grey, width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Colors.grey, width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0), + borderSide: widget.hasBorder + ? BorderSide(color: Colors.grey, width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0), ), ), ), ], ), - )); } }