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