refine your search message
This commit is contained in:
@@ -25,7 +25,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||||||
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();
|
||||||
|
bool hasSearchedBefore = false;
|
||||||
String userSearch = "";
|
String userSearch = "";
|
||||||
String errorCode = "";
|
String errorCode = "";
|
||||||
String errorBody = "";
|
String errorBody = "";
|
||||||
@@ -50,6 +50,7 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||||||
if (searchController.text != "") {
|
if (searchController.text != "") {
|
||||||
setState(() {
|
setState(() {
|
||||||
userSearch = searchController.text;
|
userSearch = searchController.text;
|
||||||
|
hasSearchedBefore = true;
|
||||||
userSearchResults = fetchUsers(userSearch);
|
userSearchResults = fetchUsers(userSearch);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -62,21 +63,18 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||||||
arguments: widget.arguments,
|
arguments: widget.arguments,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Padding(
|
if (hasSearchedBefore && userSearch.isNotEmpty) {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
return Column(
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 50),
|
const SizedBox(height: 50),
|
||||||
Icon(
|
Icon(
|
||||||
MihIcons.personalProfile,
|
MihIcons.iDontKnow,
|
||||||
size: 165,
|
size: 165,
|
||||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Search for a Member of Mzansi to add to your team",
|
"Let's Try Refining Your Search",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
overflow: TextOverflow.visible,
|
overflow: TextOverflow.visible,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -85,38 +83,65 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
|
|||||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
],
|
||||||
Center(
|
);
|
||||||
child: RichText(
|
} else {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 50),
|
||||||
|
Icon(
|
||||||
|
MihIcons.personalProfile,
|
||||||
|
size: 165,
|
||||||
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
"Search for a Member of Mzansi to add to your team",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
text: TextSpan(
|
overflow: TextOverflow.visible,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.bold,
|
||||||
color:
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: "You can search using their Username or Email"),
|
|
||||||
// WidgetSpan(
|
|
||||||
// alignment: PlaceholderAlignment.middle,
|
|
||||||
// child: Icon(
|
|
||||||
// Icons.menu,
|
|
||||||
// size: 20,
|
|
||||||
// color: MzansiInnovationHub.of(context)!
|
|
||||||
// .theme
|
|
||||||
// .secondaryColor(),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// TextSpan(text: " to add your first loyalty card"),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
],
|
Center(
|
||||||
),
|
child: RichText(
|
||||||
);
|
textAlign: TextAlign.center,
|
||||||
|
text: TextSpan(
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color:
|
||||||
|
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text: "You can search using their Username or Email"),
|
||||||
|
// WidgetSpan(
|
||||||
|
// alignment: PlaceholderAlignment.middle,
|
||||||
|
// child: Icon(
|
||||||
|
// Icons.menu,
|
||||||
|
// size: 20,
|
||||||
|
// color: MzansiInnovationHub.of(context)!
|
||||||
|
// .theme
|
||||||
|
// .secondaryColor(),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// TextSpan(text: " to add your first loyalty card"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
// return Center(
|
// return Center(
|
||||||
// child: Text(
|
// child: Text(
|
||||||
// "Enter Username or Email to search",
|
// "Enter Username or Email to search",
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
|||||||
TextEditingController _mihPatientSearchController = TextEditingController();
|
TextEditingController _mihPatientSearchController = TextEditingController();
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
final FocusNode _searchFocusNode = FocusNode();
|
final FocusNode _searchFocusNode = FocusNode();
|
||||||
|
bool hasSearchedBefore = false;
|
||||||
String _mihPatientSearchString = "";
|
String _mihPatientSearchString = "";
|
||||||
String baseUrl = AppEnviroment.baseApiUrl;
|
String baseUrl = AppEnviroment.baseApiUrl;
|
||||||
late Future<List<Patient>> _mihPatientSearchResults;
|
late Future<List<Patient>> _mihPatientSearchResults;
|
||||||
@@ -126,18 +127,26 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
|||||||
personalSelected: widget.personalSelected,
|
personalSelected: widget.personalSelected,
|
||||||
);
|
);
|
||||||
} else if (patientsList.isEmpty && searchString != "") {
|
} else if (patientsList.isEmpty && searchString != "") {
|
||||||
return Padding(
|
return Column(
|
||||||
padding: const EdgeInsets.only(top: 35.0),
|
children: [
|
||||||
child: Center(
|
const SizedBox(height: 50),
|
||||||
child: Text(
|
Icon(
|
||||||
"No ID or Medical Aid No. matches a Patient",
|
MihIcons.iDontKnow,
|
||||||
style: TextStyle(
|
size: 165,
|
||||||
fontSize: 25,
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
color:
|
|
||||||
MzansiInnovationHub.of(context)!.theme.messageTextColor()),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
),
|
||||||
),
|
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 {
|
} else {
|
||||||
return Padding(
|
return Padding(
|
||||||
@@ -218,6 +227,7 @@ class _MihPatientSearchState extends State<MihPatientSearch> {
|
|||||||
_mihPatientSearchString = _mihPatientSearchController.text;
|
_mihPatientSearchString = _mihPatientSearchController.text;
|
||||||
_mihPatientSearchResults =
|
_mihPatientSearchResults =
|
||||||
MIHApiCalls.fetchPatients(_mihPatientSearchString);
|
MIHApiCalls.fetchPatients(_mihPatientSearchString);
|
||||||
|
hasSearchedBefore = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||||||
late Future<List<PatientAccess>> _myPatientList;
|
late Future<List<PatientAccess>> _myPatientList;
|
||||||
TextEditingController _myPatientSearchController = TextEditingController();
|
TextEditingController _myPatientSearchController = TextEditingController();
|
||||||
final FocusNode _searchFocusNode = FocusNode();
|
final FocusNode _searchFocusNode = FocusNode();
|
||||||
|
bool hasSearchedBefore = false;
|
||||||
String _myPatientIdSearchString = "";
|
String _myPatientIdSearchString = "";
|
||||||
String baseUrl = AppEnviroment.baseApiUrl;
|
String baseUrl = AppEnviroment.baseApiUrl;
|
||||||
|
|
||||||
@@ -114,21 +115,18 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||||||
businessUser: widget.businessUser,
|
businessUser: widget.businessUser,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Padding(
|
if (hasSearchedBefore && _myPatientIdSearchString.isNotEmpty) {
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
return Column(
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 50),
|
const SizedBox(height: 50),
|
||||||
Icon(
|
Icon(
|
||||||
MihIcons.patientProfile,
|
MihIcons.iDontKnow,
|
||||||
size: 165,
|
size: 165,
|
||||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"You dont have access to any Patients Profile",
|
"Let's Try Refining Your Search",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
overflow: TextOverflow.visible,
|
overflow: TextOverflow.visible,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -137,39 +135,66 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||||||
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
],
|
||||||
Center(
|
);
|
||||||
child: RichText(
|
} else {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 50),
|
||||||
|
Icon(
|
||||||
|
MihIcons.patientProfile,
|
||||||
|
size: 165,
|
||||||
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
"You dont have access to any Patients Profile",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
text: TextSpan(
|
overflow: TextOverflow.visible,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.bold,
|
||||||
color:
|
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
TextSpan(text: "Press "),
|
|
||||||
WidgetSpan(
|
|
||||||
alignment: PlaceholderAlignment.middle,
|
|
||||||
child: Icon(
|
|
||||||
Icons.search,
|
|
||||||
size: 20,
|
|
||||||
color: MzansiInnovationHub.of(context)!
|
|
||||||
.theme
|
|
||||||
.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text:
|
|
||||||
" to use Patient Search to request access to their profile."),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
],
|
Center(
|
||||||
),
|
child: RichText(
|
||||||
);
|
textAlign: TextAlign.center,
|
||||||
|
text: TextSpan(
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
color:
|
||||||
|
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
TextSpan(text: "Press "),
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: Icon(
|
||||||
|
Icons.search,
|
||||||
|
size: 20,
|
||||||
|
color: MzansiInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
" to use Patient Search to request access to their profile."),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
// return Padding(
|
// return Padding(
|
||||||
// padding: const EdgeInsets.only(top: 35.0),
|
// padding: const EdgeInsets.only(top: 35.0),
|
||||||
// child: Center(
|
// child: Center(
|
||||||
@@ -199,6 +224,7 @@ class _MyPatientListState extends State<MyPatientList> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_myPatientList = MIHApiCalls.getPatientAccessListOfBusiness(
|
_myPatientList = MIHApiCalls.getPatientAccessListOfBusiness(
|
||||||
widget.business!.business_id);
|
widget.business!.business_id);
|
||||||
|
hasSearchedBefore = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user