remove duplicate enter trigger
This commit is contained in:
@@ -46,7 +46,6 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
late final AnimationController _marqueeController;
|
||||
late final ScrollController _scrollController;
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
final String maintenanceMsg =
|
||||
"\tHeads up! We're doing maintenance on Thur, 15 May 2025 at 10 PM (CAT). MIH may be unavailable briefly.";
|
||||
|
||||
@@ -204,22 +203,6 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
|
||||
Widget getBody(double width, double height) {
|
||||
return MihSingleChildScroll(
|
||||
child: KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) async {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-ai',
|
||||
arguments: MzansiAiArguments(
|
||||
widget.signedInUser,
|
||||
searchController.text.isEmpty ? null : searchController.text,
|
||||
),
|
||||
);
|
||||
searchController.clear();
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
@@ -232,8 +215,7 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
prefixAltIcon: MihIcons.mzansiAi,
|
||||
fillColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
hintColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
hintColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onPrefixIconTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-ai',
|
||||
@@ -306,7 +288,6 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
late final AnimationController _marqueeController;
|
||||
late final ScrollController _scrollController;
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
final String maintenanceMsg =
|
||||
"\tHeads up! We're doing maintenance on Thur, 15 May 2025 at 10 PM (CAT). MIH may be unavailable briefly.";
|
||||
|
||||
@@ -247,22 +246,6 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
|
||||
Widget getBody(double width, double height) {
|
||||
return MihSingleChildScroll(
|
||||
child: KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) async {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-ai',
|
||||
arguments: MzansiAiArguments(
|
||||
widget.signedInUser,
|
||||
searchController.text.isEmpty ? null : searchController.text,
|
||||
),
|
||||
);
|
||||
searchController.clear();
|
||||
}
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
@@ -275,8 +258,7 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
prefixAltIcon: MihIcons.mzansiAi,
|
||||
fillColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
hintColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
hintColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onPrefixIconTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/mzansi-ai',
|
||||
@@ -350,7 +332,6 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ class MihBusinessUserSearch extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
late Future<List<AppUser>> userSearchResults;
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
@@ -101,15 +100,6 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
||||
|
||||
Widget getBody(double width) {
|
||||
return MihSingleChildScroll(
|
||||
child: KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) async {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
submitUserForm();
|
||||
}
|
||||
},
|
||||
child: Column(mainAxisSize: MainAxisSize.max, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: width / 20),
|
||||
@@ -117,8 +107,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
||||
controller: searchController,
|
||||
hintText: "Search Users",
|
||||
prefixIcon: Icons.search,
|
||||
fillColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
hintColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onPrefixIconTap: () {
|
||||
submitUserForm();
|
||||
@@ -156,9 +145,8 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
||||
"$errorCode: Error pulling Patients Data\n/patients/search/$userSearch\n$errorBody",
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor()),
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor()),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
);
|
||||
@@ -166,7 +154,6 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
||||
},
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,19 +42,6 @@ class _MyPatientListState extends State<MyPatientList> {
|
||||
|
||||
Widget myPatientListTool(double width) {
|
||||
return MihSingleChildScroll(
|
||||
child: KeyboardListener(
|
||||
focusNode: _focusNode,
|
||||
autofocus: true,
|
||||
onKeyEvent: (event) async {
|
||||
if (event is KeyDownEvent &&
|
||||
event.logicalKey == LogicalKeyboardKey.enter) {
|
||||
setState(() {
|
||||
_myPatientIdSearchString = _myPatientSearchController.text;
|
||||
_myPatientList = MIHApiCalls.getPatientAccessListOfBusiness(
|
||||
widget.business!.business_id);
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Column(mainAxisSize: MainAxisSize.max, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: width / 20),
|
||||
@@ -62,8 +49,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
||||
controller: _myPatientSearchController,
|
||||
hintText: "Search Patient ID",
|
||||
prefixIcon: Icons.search,
|
||||
fillColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
fillColor: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
hintColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
onPrefixIconTap: () {
|
||||
setState(() {
|
||||
@@ -107,9 +93,8 @@ class _MyPatientListState extends State<MyPatientList> {
|
||||
"Error pulling Patient Access Data\n$baseUrl/access-requests/business/patient/${widget.business!.business_id}",
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.errorColor()),
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.errorColor()),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
);
|
||||
@@ -117,7 +102,6 @@ class _MyPatientListState extends State<MyPatientList> {
|
||||
},
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user