QOL: use advanced varding when adding & removing card to fav

This commit is contained in:
2025-11-21 10:27:22 +02:00
parent bb54605ddb
commit 56ab6bb950
2 changed files with 69 additions and 7 deletions

View File

@@ -142,6 +142,68 @@ class _PackageToolZeroState extends State<PackageToolZero> {
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
MihButton(
width: 300,
onPressed: () {
MihAlertServices().warningAdvancedAlert(
"warning!",
"This is the advanced alert message",
[
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Okay",
style: TextStyle(
color: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
MihButton(
onPressed: () {
context.pop();
},
buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300,
elevation: 10,
child: Text(
"Dismiss",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode ==
"Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
],
context,
);
},
buttonColor: MihColors.getSecondaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
child: Text(
"Advanced Warning Alert",
style: TextStyle(
color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(height: 10),
MihButton( MihButton(
width: 300, width: 300,
onPressed: () { onPressed: () {

View File

@@ -224,7 +224,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
void addToFavCardWindow(MzansiProfileProvider mzansiProfileProvider, void addToFavCardWindow(MzansiProfileProvider mzansiProfileProvider,
MzansiWalletProvider walletProvider, BuildContext ctxt, int index) { MzansiWalletProvider walletProvider, BuildContext ctxt, int index) {
MihAlertServices().successAdvancedAlert( MihAlertServices().warningAdvancedAlert(
// "Card Added to Favourites", // "Card Added to Favourites",
"Add Card to Favourites?", "Add Card to Favourites?",
"Would you like to add this card to your favourites for quick access?", "Would you like to add this card to your favourites for quick access?",
@@ -278,13 +278,13 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
MihAlertServices().internetConnectionAlert(context); MihAlertServices().internetConnectionAlert(context);
} }
}, },
buttonColor: MihColors.getPrimaryColor( buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300, width: 300,
child: Text( child: Text(
"Add", "Add",
style: TextStyle( style: TextStyle(
color: MihColors.getSecondaryColor( color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -298,7 +298,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
void removeFromFavCardWindow(MzansiProfileProvider mzansiProfileProvider, void removeFromFavCardWindow(MzansiProfileProvider mzansiProfileProvider,
MzansiWalletProvider walletProvider, BuildContext ctxt, int index) { MzansiWalletProvider walletProvider, BuildContext ctxt, int index) {
MihAlertServices().errorAdvancedAlert( MihAlertServices().warningAdvancedAlert(
"Remove From Favourites?", "Remove From Favourites?",
"Are you sure you want to remove this card from your favourites?", "Are you sure you want to remove this card from your favourites?",
[ [
@@ -333,13 +333,13 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
MihAlertServices().internetConnectionAlert(context); MihAlertServices().internetConnectionAlert(context);
} }
}, },
buttonColor: MihColors.getPrimaryColor( buttonColor: MihColors.getRedColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300, width: 300,
child: Text( child: Text(
"Remove", "Remove",
style: TextStyle( style: TextStyle(
color: MihColors.getSecondaryColor( color: MihColors.getPrimaryColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -350,7 +350,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
onPressed: () async { onPressed: () async {
context.pop(); context.pop();
}, },
buttonColor: MihColors.getSecondaryColor( buttonColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
width: 300, width: 300,
child: Text( child: Text(