refine your search message
This commit is contained in:
parent
0da4df8a93
commit
9eee91bdb1
3 changed files with 146 additions and 85 deletions
|
|
@ -25,7 +25,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||
final TextEditingController searchController = TextEditingController();
|
||||
late Future<List<AppUser>> userSearchResults;
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
|
||||
bool hasSearchedBefore = false;
|
||||
String userSearch = "";
|
||||
String errorCode = "";
|
||||
String errorBody = "";
|
||||
|
|
@ -50,6 +50,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||
if (searchController.text != "") {
|
||||
setState(() {
|
||||
userSearch = searchController.text;
|
||||
hasSearchedBefore = true;
|
||||
userSearchResults = fetchUsers(userSearch);
|
||||
});
|
||||
}
|
||||
|
|
@ -62,6 +63,29 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||
arguments: widget.arguments,
|
||||
);
|
||||
}
|
||||
if (hasSearchedBefore && userSearch.isNotEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 50),
|
||||
Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: 165,
|
||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Let's Try Refining Your Search",
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.visible,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Column(
|
||||
|
|
@ -117,6 +141,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
// return Center(
|
||||
// child: Text(
|
||||
// "Enter Username or Email to search",
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
|||
TextEditingController _mihPatientSearchController = TextEditingController();
|
||||
final FocusNode _focusNode = FocusNode();
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
bool hasSearchedBefore = false;
|
||||
String _mihPatientSearchString = "";
|
||||
String baseUrl = AppEnviroment.baseApiUrl;
|
||||
late Future<List<Patient>> _mihPatientSearchResults;
|
||||
|
|
@ -126,18 +127,26 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
|||
personalSelected: widget.personalSelected,
|
||||
);
|
||||
} else if (patientsList.isEmpty && searchString != "") {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 35.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"No ID or Medical Aid No. matches a Patient",
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 50),
|
||||
Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: 165,
|
||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Let's Try Refining Your Search",
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.visible,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
color:
|
||||
MzansiInnovationHub.of(context)!.theme.messageTextColor()),
|
||||
textAlign: TextAlign.center,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Padding(
|
||||
|
|
@ -218,6 +227,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
|||
_mihPatientSearchString = _mihPatientSearchController.text;
|
||||
_mihPatientSearchResults =
|
||||
MIHApiCalls.fetchPatients(_mihPatientSearchString);
|
||||
hasSearchedBefore = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||
late Future<List<PatientAccess>> _myPatientList;
|
||||
TextEditingController _myPatientSearchController = TextEditingController();
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
bool hasSearchedBefore = false;
|
||||
String _myPatientIdSearchString = "";
|
||||
String baseUrl = AppEnviroment.baseApiUrl;
|
||||
|
||||
|
|
@ -114,6 +115,29 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||
businessUser: widget.businessUser,
|
||||
);
|
||||
}
|
||||
if (hasSearchedBefore && _myPatientIdSearchString.isNotEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 50),
|
||||
Icon(
|
||||
MihIcons.iDontKnow,
|
||||
size: 165,
|
||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Let's Try Refining Your Search",
|
||||
textAlign: TextAlign.center,
|
||||
overflow: TextOverflow.visible,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Column(
|
||||
|
|
@ -170,6 +194,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
// return Padding(
|
||||
// padding: const EdgeInsets.only(top: 35.0),
|
||||
// child: Center(
|
||||
|
|
@ -199,6 +224,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||
setState(() {
|
||||
_myPatientList = MIHApiCalls.getPatientAccessListOfBusiness(
|
||||
widget.business!.business_id);
|
||||
hasSearchedBefore = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue