|
|
|
|
@ -15,11 +15,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
@ -75,22 +75,29 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
|
|
|
|
|
}
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{IconData icon}) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown ,
|
|
|
|
|
|
|
|
|
|
{IconData icon, String validationError}) {
|
|
|
|
|
return new InputDecoration(
|
|
|
|
|
fillColor: Colors.white,
|
|
|
|
|
|
|
|
|
|
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
|
|
|
|
borderSide: BorderSide(color: (validationError != null
|
|
|
|
|
? Colors.red.shade700
|
|
|
|
|
:Color(0xFFEFEFEF)) , width: 2.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
|
|
|
|
borderSide: BorderSide(color: (validationError != null
|
|
|
|
|
? Colors.red.shade700
|
|
|
|
|
: Color(0xFFEFEFEF)), width: 2.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0),
|
|
|
|
|
borderSide: BorderSide(color: (validationError != null
|
|
|
|
|
? Colors.red.shade700
|
|
|
|
|
: Color(0xFFEFEFEF)), width: 2.5),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
hintText: selectedText != null ? selectedText : hintText,
|
|
|
|
|
@ -164,47 +171,64 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
child: widget
|
|
|
|
|
.mySelectedAssessment.selectedICD ==
|
|
|
|
|
null
|
|
|
|
|
? AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.nameOrICD,
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD !=
|
|
|
|
|
null
|
|
|
|
|
? widget.mySelectedAssessment
|
|
|
|
|
.selectedICD.nameEn
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
icon: Icons.keyboard_arrow_down),
|
|
|
|
|
itemSubmitted: (item) => setState(() {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD = item;
|
|
|
|
|
icdNameController.text = '${item.code.trim()}/${item.description}';
|
|
|
|
|
}),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions: model.listOfICD10,
|
|
|
|
|
itemBuilder: (context, suggestion) =>
|
|
|
|
|
new Padding(
|
|
|
|
|
child: Texts(suggestion
|
|
|
|
|
.description +
|
|
|
|
|
" / " +
|
|
|
|
|
suggestion.code.toString()),
|
|
|
|
|
padding: EdgeInsets.all(8.0)),
|
|
|
|
|
itemSorter: (a, b) => 1,
|
|
|
|
|
itemFilter: (suggestion, input) =>
|
|
|
|
|
suggestion.description
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
? Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
AutoCompleteTextField<MasterKeyModel>(
|
|
|
|
|
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.nameOrICD,
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD !=
|
|
|
|
|
null
|
|
|
|
|
? widget.mySelectedAssessment
|
|
|
|
|
.selectedICD.nameEn
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
icon: Icons.search,
|
|
|
|
|
validationError: isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment.selectedICD == null?TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage:null
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
itemSubmitted: (item) => setState(() {
|
|
|
|
|
widget.mySelectedAssessment
|
|
|
|
|
.selectedICD = item;
|
|
|
|
|
icdNameController.text = '${item.code.trim()}/${item.description}';
|
|
|
|
|
}),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions: model.listOfICD10,
|
|
|
|
|
itemBuilder: (context, suggestion) =>
|
|
|
|
|
new Padding(
|
|
|
|
|
child: Texts(suggestion
|
|
|
|
|
.description +
|
|
|
|
|
" / " +
|
|
|
|
|
suggestion.code.toString()),
|
|
|
|
|
padding: EdgeInsets.all(8.0)),
|
|
|
|
|
itemSorter: (a, b) => 1,
|
|
|
|
|
itemFilter: (suggestion, input) =>
|
|
|
|
|
suggestion.description
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.code
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()),
|
|
|
|
|
)
|
|
|
|
|
suggestion.description
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.code
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()),
|
|
|
|
|
),
|
|
|
|
|
if (isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment.selectedICD == null)
|
|
|
|
|
TextFieldsError(error:TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.emptyMessage ,)
|
|
|
|
|
],
|
|
|
|
|
),)
|
|
|
|
|
: AppTextFieldCustom(
|
|
|
|
|
onClick: model.listOfICD10 != null
|
|
|
|
|
? () {
|
|
|
|
|
@ -220,20 +244,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: icdNameController,
|
|
|
|
|
// hasBorder: true,
|
|
|
|
|
// validationError: isFormSubmitted &&
|
|
|
|
|
// widget.mySelectedAssessment
|
|
|
|
|
// .selectedICD == null?TranslationBase
|
|
|
|
|
// .of(context)
|
|
|
|
|
// .emptyMessage:null,
|
|
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (isFormSubmitted &&
|
|
|
|
|
widget.mySelectedAssessment.selectedICD == null)
|
|
|
|
|
CustomValidationError(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 7,
|
|
|
|
|
),
|
|
|
|
|
|