display message when no packages found
This commit is contained in:
@@ -259,20 +259,49 @@ class _MihBusinessHomeState extends State<MihBusinessHome>
|
|||||||
.contains(searchController.text.toLowerCase()))
|
.contains(searchController.text.toLowerCase()))
|
||||||
.map((package) => package.values.first)
|
.map((package) => package.values.first)
|
||||||
.toList();
|
.toList();
|
||||||
return GridView.builder(
|
if (filteredPackages.isNotEmpty) {
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
return GridView.builder(
|
||||||
shrinkWrap: true,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
padding: getPadding(width, height),
|
shrinkWrap: true,
|
||||||
// shrinkWrap: true,
|
padding: getPadding(width, height),
|
||||||
itemCount: filteredPackages.length,
|
// shrinkWrap: true,
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
itemCount: filteredPackages.length,
|
||||||
maxCrossAxisExtent: packageSize,
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
crossAxisSpacing: 5,
|
maxCrossAxisExtent: packageSize,
|
||||||
),
|
crossAxisSpacing: 5,
|
||||||
itemBuilder: (context, index) {
|
),
|
||||||
return filteredPackages[index];
|
itemBuilder: (context, index) {
|
||||||
},
|
return filteredPackages[index];
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
MihIcons.mzansiAi,
|
||||||
|
size: 165,
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
"Mzansi AI is here to help you!",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
overflow: TextOverflow.visible,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -302,21 +302,50 @@ class _MihPersonalHomeState extends State<MihPersonalHome>
|
|||||||
.contains(searchController.text.toLowerCase()))
|
.contains(searchController.text.toLowerCase()))
|
||||||
.map((package) => package.values.first)
|
.map((package) => package.values.first)
|
||||||
.toList();
|
.toList();
|
||||||
return GridView.builder(
|
if (filteredPackages.isNotEmpty) {
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
return GridView.builder(
|
||||||
shrinkWrap: true,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
padding: getPadding(width, height),
|
shrinkWrap: true,
|
||||||
// shrinkWrap: true,
|
padding: getPadding(width, height),
|
||||||
itemCount: filteredPackages.length,
|
// shrinkWrap: true,
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
itemCount: filteredPackages.length,
|
||||||
maxCrossAxisExtent: packageSize,
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
crossAxisSpacing: 5,
|
maxCrossAxisExtent: packageSize,
|
||||||
),
|
crossAxisSpacing: 5,
|
||||||
itemBuilder: (context, index) {
|
),
|
||||||
return filteredPackages[index];
|
itemBuilder: (context, index) {
|
||||||
// return personalPackages[index];
|
return filteredPackages[index];
|
||||||
},
|
// return personalPackages[index];
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
MihIcons.mzansiAi,
|
||||||
|
size: 165,
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
"Mzansi AI is here to help you!",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
overflow: TextOverflow.visible,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user