refine your search message

This commit is contained in:
2025-08-07 12:24:34 +02:00
parent 0da4df8a93
commit 9eee91bdb1
3 changed files with 146 additions and 85 deletions

View File

@@ -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,21 +63,18 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
arguments: widget.arguments,
);
}
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
if (hasSearchedBefore && userSearch.isNotEmpty) {
return Column(
children: [
const SizedBox(height: 50),
Icon(
MihIcons.personalProfile,
MihIcons.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"Search for a Member of Mzansi to add to your team",
"Let's Try Refining Your Search",
textAlign: TextAlign.center,
overflow: TextOverflow.visible,
style: TextStyle(
@@ -85,38 +83,65 @@ class _MihBusinessUserSearchState extends State<MihBusinessUserSearch> {
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,
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"),
],
overflow: TextOverflow.visible,
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
),
),
],
),
);
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(
// child: Text(
// "Enter Username or Email to search",