|
|
|
|
@ -44,7 +44,8 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
TextEditingController frequencyController = TextEditingController();
|
|
|
|
|
GetMedicationResponseModel? _selectedMedication;
|
|
|
|
|
|
|
|
|
|
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
|
|
|
|
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
|
|
|
|
|
|
|
|
|
bool isFormSubmitted = false;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -59,7 +60,7 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBar: BottomSheetTitle(
|
|
|
|
|
title: TranslationBase.of(context).addMedication,
|
|
|
|
|
title: TranslationBase.of(context).addMedication!,
|
|
|
|
|
),
|
|
|
|
|
body: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
@ -103,8 +104,8 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
.textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.searchMedicineNameHere,
|
|
|
|
|
null,
|
|
|
|
|
.searchMedicineNameHere!,
|
|
|
|
|
'',
|
|
|
|
|
true,
|
|
|
|
|
suffixIcon:
|
|
|
|
|
Icons.search),
|
|
|
|
|
@ -119,22 +120,22 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
suggestion) =>
|
|
|
|
|
new Padding(
|
|
|
|
|
child: AppText(suggestion
|
|
|
|
|
.description +
|
|
|
|
|
.description! +
|
|
|
|
|
'/' +
|
|
|
|
|
suggestion
|
|
|
|
|
.genericName),
|
|
|
|
|
suggestion!
|
|
|
|
|
.genericName!),
|
|
|
|
|
padding: EdgeInsets.all(
|
|
|
|
|
8.0)),
|
|
|
|
|
itemSorter: (a, b) => 1,
|
|
|
|
|
itemFilter: (suggestion,
|
|
|
|
|
input) =>
|
|
|
|
|
suggestion.genericName.toLowerCase().startsWith(
|
|
|
|
|
suggestion.genericName!.toLowerCase().startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.description
|
|
|
|
|
suggestion.description!
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(input
|
|
|
|
|
.toLowerCase()) ||
|
|
|
|
|
suggestion.keywords
|
|
|
|
|
suggestion.keywords!
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(input
|
|
|
|
|
.toLowerCase()),
|
|
|
|
|
@ -145,9 +146,9 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
Helpers.getTextFieldHeight(),
|
|
|
|
|
hintText: _selectedMedication !=
|
|
|
|
|
null
|
|
|
|
|
? _selectedMedication
|
|
|
|
|
.description +
|
|
|
|
|
(' (${_selectedMedication.genericName} )')
|
|
|
|
|
? _selectedMedication!
|
|
|
|
|
.description! +
|
|
|
|
|
(' (${_selectedMedication!.genericName!} )')
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.searchMedicineNameHere,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
@ -157,7 +158,7 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.grey.shade600,
|
|
|
|
|
)),
|
|
|
|
|
), onPressed: () { },),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -174,8 +175,8 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
.width *
|
|
|
|
|
0.7,
|
|
|
|
|
child: AppText(
|
|
|
|
|
_selectedMedication.description +
|
|
|
|
|
(' (${_selectedMedication.genericName} )'),
|
|
|
|
|
_selectedMedication!.description! +
|
|
|
|
|
(' (${_selectedMedication!.genericName!} )'),
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
@ -386,7 +387,7 @@ class _AddMedicationState extends State<AddMedication> {
|
|
|
|
|
_selectedMedicationFrequency != null) {
|
|
|
|
|
widget.medicationController.text = widget
|
|
|
|
|
.medicationController.text +
|
|
|
|
|
'${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
|
|
|
|
|
'${_selectedMedication!.description!} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|