diff --git a/Frontend/lib/mih_objects/loyalty_card.dart b/Frontend/lib/mih_objects/loyalty_card.dart new file mode 100644 index 00000000..8349a442 --- /dev/null +++ b/Frontend/lib/mih_objects/loyalty_card.dart @@ -0,0 +1,31 @@ +class MIHNotification { + final int idloyalty_cards; + final String app_id; + final String shop_name; + final String card_number; + + const MIHNotification({ + required this.idloyalty_cards, + required this.app_id, + required this.shop_name, + required this.card_number, + }); + + factory MIHNotification.fromJson(Map json) { + return switch (json) { + { + "idloyalty_cards": int idloyalty_cards, + "app_id": String app_id, + "shop_name": String shop_name, + "notification_read": String card_number, + } => + MIHNotification( + idloyalty_cards: idloyalty_cards, + app_id: app_id, + shop_name: shop_name, + card_number: card_number, + ), + _ => throw const FormatException('Failed to load loyalty card.'), + }; + } +} diff --git a/Frontend/lib/mih_packages/mzansi_wallet/loyalty_cards.dart b/Frontend/lib/mih_packages/mzansi_wallet/loyalty_cards.dart new file mode 100644 index 00000000..585695a8 --- /dev/null +++ b/Frontend/lib/mih_packages/mzansi_wallet/loyalty_cards.dart @@ -0,0 +1,48 @@ +import 'package:Mzansi_Innovation_Hub/main.dart'; +import 'package:Mzansi_Innovation_Hub/mih_objects/app_user.dart'; +import 'package:flutter/material.dart'; + +class LoyaltyCards extends StatefulWidget { + final AppUser signedInUser; + const LoyaltyCards({ + super.key, + required this.signedInUser, + }); + + @override + State createState() => _LoyaltyCardsState(); +} + +class _LoyaltyCardsState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "Loyalty Cards", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 25, + fontWeight: FontWeight.bold, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + ), + ), + IconButton( + icon: const Icon(Icons.add_card), + alignment: Alignment.topRight, + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + onPressed: () { + // + }, + ) + ], + ), + Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), + const SizedBox(height: 10), + ], + ); + } +}