no items display
This commit is contained in:
@@ -63,6 +63,9 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
|
|||||||
controller: mzansiSearchController,
|
controller: mzansiSearchController,
|
||||||
hintText: "Search Mzansi",
|
hintText: "Search Mzansi",
|
||||||
prefixIcon: Icons.search,
|
prefixIcon: Icons.search,
|
||||||
|
prefixAltIcon: userSearch
|
||||||
|
? MihIcons.personalProfile
|
||||||
|
: MihIcons.businessProfile,
|
||||||
suffixTools: [
|
suffixTools: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
@@ -143,7 +146,8 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
|
|||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
return const Mihloadingcircle();
|
return const Mihloadingcircle();
|
||||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||||
snapshot.hasData) {
|
snapshot.hasData &&
|
||||||
|
snapshot.requireData!.isNotEmpty) {
|
||||||
// return Text("Pulled Data successfully");
|
// return Text("Pulled Data successfully");
|
||||||
snapshot.requireData!
|
snapshot.requireData!
|
||||||
.sort((a, b) => a.username.compareTo(b.username));
|
.sort((a, b) => a.username.compareTo(b.username));
|
||||||
@@ -183,6 +187,33 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||||
|
snapshot.hasData &&
|
||||||
|
snapshot.requireData!.isEmpty) {
|
||||||
|
// return Text("Pulled Data successfully");
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 50),
|
||||||
|
Icon(
|
||||||
|
MihIcons.iDontKnow,
|
||||||
|
size: 165,
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.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:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -203,7 +234,8 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
|
|||||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
return const Mihloadingcircle();
|
return const Mihloadingcircle();
|
||||||
} else if (snapshot.connectionState == ConnectionState.done &&
|
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||||
snapshot.hasData) {
|
snapshot.hasData &&
|
||||||
|
snapshot.requireData!.isNotEmpty) {
|
||||||
// return Text("Pulled Data successfully");
|
// return Text("Pulled Data successfully");
|
||||||
snapshot.requireData!.sort((a, b) => a.Name.compareTo(b.Name));
|
snapshot.requireData!.sort((a, b) => a.Name.compareTo(b.Name));
|
||||||
return Column(
|
return Column(
|
||||||
@@ -219,6 +251,33 @@ class _MihSearchMzansiState extends State<MihSearchMzansi> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
} else if (snapshot.connectionState == ConnectionState.done &&
|
||||||
|
snapshot.hasData &&
|
||||||
|
snapshot.requireData!.isEmpty) {
|
||||||
|
// return Text("Pulled Data successfully");
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 50),
|
||||||
|
Icon(
|
||||||
|
MihIcons.iDontKnow,
|
||||||
|
size: 165,
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.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:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
} else if (!snapshot.hasData) {
|
} else if (!snapshot.hasData) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
Reference in New Issue
Block a user