remove double enter trigger

This commit is contained in:
2025-06-02 11:02:30 +02:00
parent d53e45d2e9
commit d0ebb5989e
2 changed files with 27 additions and 51 deletions

View File

@@ -66,7 +66,6 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
final ValueNotifier<String> medAid = ValueNotifier(""); final ValueNotifier<String> medAid = ValueNotifier("");
List<ICD10Code> icd10codeList = []; List<ICD10Code> icd10codeList = [];
final FocusNode _searchFocusNode = FocusNode(); final FocusNode _searchFocusNode = FocusNode();
final FocusNode _focusNode = FocusNode();
void icd10SearchWindow(List<ICD10Code> codeList) { void icd10SearchWindow(List<ICD10Code> codeList) {
showDialog( showDialog(
@@ -189,19 +188,7 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
}, },
), ),
//const SizedBox(height: 10), //const SizedBox(height: 10),
KeyboardListener( MihSearchBar(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) async {
if (event is KeyDownEvent &&
event.logicalKey == LogicalKeyboardKey.enter) {
MIHIcd10CodeApis.getIcd10Codes(_icd10CodeController.text, context)
.then((result) {
icd10SearchWindow(result);
});
}
},
child: MihSearchBar(
controller: _icd10CodeController, controller: _icd10CodeController,
hintText: "ICD-10 Code & Description", hintText: "ICD-10 Code & Description",
prefixIcon: Icons.search, prefixIcon: Icons.search,
@@ -218,7 +205,6 @@ class _ClaimStatementWindowState extends State<ClaimStatementWindow> {
}, },
searchFocusNode: _searchFocusNode, searchFocusNode: _searchFocusNode,
), ),
),
const SizedBox(height: 10), const SizedBox(height: 10),
MIHTextField( MIHTextField(
controller: _amountController, controller: _amountController,

View File

@@ -353,16 +353,7 @@ class _PrescripInputState extends State<PrescripInput> {
children: [ children: [
//const SizedBox(height: 25.0), //const SizedBox(height: 25.0),
KeyboardListener( MihSearchBar(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) async {
if (event is KeyDownEvent &&
event.logicalKey == LogicalKeyboardKey.enter) {
getMedsPopUp(widget.medicineController);
}
},
child: MihSearchBar(
controller: widget.medicineController, controller: widget.medicineController,
hintText: "Search Medicine", hintText: "Search Medicine",
prefixIcon: Icons.search, prefixIcon: Icons.search,
@@ -376,7 +367,6 @@ class _PrescripInputState extends State<PrescripInput> {
}, },
searchFocusNode: _searchFocusNode, searchFocusNode: _searchFocusNode,
), ),
),
const SizedBox(height: 10.0), const SizedBox(height: 10.0),
MIHDropdownField( MIHDropdownField(