Mzansi Wallet No data message enhanced

This commit is contained in:
2025-08-07 10:30:24 +02:00
parent 8316f972e5
commit 1caf8aaf7b
3 changed files with 116 additions and 48 deletions

View File

@@ -22,6 +22,7 @@ class BuildLoyaltyCardList extends StatefulWidget {
final List<MIHLoyaltyCard> cardList; final List<MIHLoyaltyCard> cardList;
final int navIndex; final int navIndex;
final MihBannerAd? bannerAd; final MihBannerAd? bannerAd;
final bool favouritesMode;
final void Function()? onCardViewClose; final void Function()? onCardViewClose;
const BuildLoyaltyCardList({ const BuildLoyaltyCardList({
@@ -29,6 +30,7 @@ class BuildLoyaltyCardList extends StatefulWidget {
required this.signedInUser, required this.signedInUser,
required this.cardList, required this.cardList,
required this.navIndex, required this.navIndex,
required this.favouritesMode,
this.bannerAd, this.bannerAd,
this.onCardViewClose, this.onCardViewClose,
}); });
@@ -524,6 +526,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
}, },
); );
} else { } else {
if (!widget.favouritesMode) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column( child: Column(
@@ -538,24 +541,27 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
"No Cards added yo your Mzansi Wallet.", "No Cards added to your Mzansi Wallet.",
textAlign: TextAlign.center, textAlign: TextAlign.center,
overflow: TextOverflow.visible, overflow: TextOverflow.visible,
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 25,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(), color:
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
), ),
), ),
const SizedBox(height: 10),
Center( Center(
child: RichText( child: RichText(
textAlign: TextAlign.center, textAlign: TextAlign.center,
text: TextSpan( text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: 25, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.normal,
color: color: MzansiInnovationHub.of(context)!
MzansiInnovationHub.of(context)!.theme.secondaryColor(), .theme
.secondaryColor(),
), ),
children: [ children: [
TextSpan(text: "Press "), TextSpan(text: "Press "),
@@ -563,7 +569,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
child: Icon( child: Icon(
Icons.menu, Icons.menu,
size: 25, size: 20,
color: MzansiInnovationHub.of(context)! color: MzansiInnovationHub.of(context)!
.theme .theme
.secondaryColor(), .secondaryColor(),
@@ -577,6 +583,66 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
], ],
), ),
); );
} 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.iDontKnow,
size: 165,
color: MzansiInnovationHub.of(context)!.theme.secondaryColor(),
),
const SizedBox(height: 10),
Text(
"No Favourite Cards in your Mzansi Wallet.",
textAlign: TextAlign.center,
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: "Press "),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
Icons.menu,
size: 20,
color: MzansiInnovationHub.of(context)!
.theme
.secondaryColor(),
),
),
TextSpan(
text:
" when viewing loyalty card to add it to your favorites."),
],
),
),
),
],
),
);
}
} }
} }
} }

View File

@@ -63,6 +63,7 @@ class _MihCardFavouritesState extends State<MihCardFavourites> {
signedInUser: widget.signedInUser, signedInUser: widget.signedInUser,
navIndex: 0, navIndex: 0,
bannerAd: _bannerAd, bannerAd: _bannerAd,
favouritesMode: true,
onCardViewClose: () { onCardViewClose: () {
setState(() { setState(() {
_bannerAd = MihBannerAd(); _bannerAd = MihBannerAd();

View File

@@ -372,6 +372,7 @@ class _MihCardsState extends State<MihCards> {
signedInUser: widget.signedInUser, signedInUser: widget.signedInUser,
navIndex: 0, navIndex: 0,
bannerAd: _bannerAd, bannerAd: _bannerAd,
favouritesMode: false,
onCardViewClose: () { onCardViewClose: () {
setState(() { setState(() {
_bannerAd = MihBannerAd(); _bannerAd = MihBannerAd();