Merge pull request #40 from yaso-meth/QOL-Loyalty-Card-Additional-Cards
QOL-Loyalty-Card-Additional-Cards
BIN
Frontend/images/loyalty_cards/Shell.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 134 KiB |
BIN
Frontend/images/loyalty_cards/best_before.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
Frontend/images/loyalty_cards/checkers.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
Frontend/images/loyalty_cards/edgars.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
Frontend/images/loyalty_cards/fresh_stop.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
Frontend/images/loyalty_cards/jet.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
Frontend/images/loyalty_cards/makro.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
Frontend/images/loyalty_cards/panarottis.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
Frontend/images/loyalty_cards/shoprite.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Frontend/images/loyalty_cards/spur.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
@@ -57,9 +57,9 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
shopName: widget.cardList[index].shop_name, height: 250),
|
shopName: widget.cardList[index].shop_name, height: 250),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
//const SizedBox(height: 10),
|
const SizedBox(height: 20),
|
||||||
Container(
|
Container(
|
||||||
width: 250,
|
width: 500,
|
||||||
//color: Colors.white,
|
//color: Colors.white,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
@@ -69,8 +69,8 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 50,
|
height: 75,
|
||||||
width: 200,
|
width: 300,
|
||||||
child: BarcodeWidget(
|
child: BarcodeWidget(
|
||||||
//color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
//color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
barcode: Barcode.code128(),
|
barcode: Barcode.code128(),
|
||||||
@@ -86,10 +86,13 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
// //showValue: true,
|
// //showValue: true,
|
||||||
// ),
|
// ),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
Text(
|
Text(
|
||||||
"Card Number: ${widget.cardList[index].card_number}",
|
widget.cardList[index].card_number,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
|
fontSize: 25,
|
||||||
|
fontWeight: FontWeight.bold
|
||||||
//MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
//MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -128,7 +131,8 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
// shrinkWrap: true,
|
// shrinkWrap: true,
|
||||||
itemCount: widget.cardList.length,
|
itemCount: widget.cardList.length,
|
||||||
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
//mainAxisSpacing: 15,
|
mainAxisSpacing: 0,
|
||||||
|
crossAxisSpacing: 10,
|
||||||
maxCrossAxisExtent: 175,
|
maxCrossAxisExtent: 175,
|
||||||
),
|
),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:Mzansi_Innovation_Hub/main.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class MihCardDisplay extends StatefulWidget {
|
class MihCardDisplay extends StatefulWidget {
|
||||||
@@ -18,236 +17,89 @@ class _MihCardDisplayState extends State<MihCardDisplay> {
|
|||||||
Widget displayLoyaltyCard() {
|
Widget displayLoyaltyCard() {
|
||||||
switch (widget.shopName.toLowerCase()) {
|
switch (widget.shopName.toLowerCase()) {
|
||||||
case "best before":
|
case "best before":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/bb_club.png'),
|
child: Image.asset('images/loyalty_cards/best_before.png'),
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Best Before",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "checkers":
|
case "checkers":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/checkers_xtra.png'),
|
child: Image.asset('images/loyalty_cards/checkers.png'),
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Checkers",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "clicks":
|
case "clicks":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/Clicks_Club.png'),
|
child: Image.asset('images/loyalty_cards/Clicks_Club.png'),
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Clicks",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "cotton:on":
|
case "cotton:on":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child:
|
child: Image.asset('images/loyalty_cards/cotton_on_perks.png'),
|
||||||
Image.asset('images/loyalty_cards/cotton_on_perks.png'),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Cotton:On",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "dis-chem":
|
case "dis-chem":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child:
|
child: Image.asset('images/loyalty_cards/dischem_benefit.png'),
|
||||||
Image.asset('images/loyalty_cards/dischem_benefit.png'),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Dis-Chem",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "pick n pay":
|
case "pick n pay":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/pnp_smart.png'),
|
child: Image.asset('images/loyalty_cards/pnp_smart.png'),
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Pick 'n Pay",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "shoprite":
|
case "shoprite":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/shoprite_xtra.png'),
|
child: Image.asset('images/loyalty_cards/shoprite.png'),
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Shoprite",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "spar":
|
case "spar":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/spar_rewards.png'),
|
child: Image.asset('images/loyalty_cards/spar_rewards.png'),
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Text(
|
|
||||||
"Spar",
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color:
|
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
case "woolworths":
|
case "woolworths":
|
||||||
return Row(
|
return SizedBox(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
child: Image.asset('images/loyalty_cards/wrewards.png'),
|
child: Image.asset('images/loyalty_cards/wrewards.png'),
|
||||||
),
|
);
|
||||||
const SizedBox(height: 10),
|
case "makro":
|
||||||
Text(
|
return SizedBox(
|
||||||
"WoolWorths",
|
height: widget.height,
|
||||||
textAlign: TextAlign.center,
|
child: Image.asset('images/loyalty_cards/makro.png'),
|
||||||
style: TextStyle(
|
);
|
||||||
fontSize: 20,
|
case "fresh stop":
|
||||||
fontWeight: FontWeight.bold,
|
return SizedBox(
|
||||||
color:
|
height: widget.height,
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
child: Image.asset('images/loyalty_cards/fresh_stop.png'),
|
||||||
),
|
);
|
||||||
),
|
case "panarottis":
|
||||||
],
|
return SizedBox(
|
||||||
),
|
height: widget.height,
|
||||||
],
|
child: Image.asset('images/loyalty_cards/panarottis.png'),
|
||||||
|
);
|
||||||
|
case "shell":
|
||||||
|
return SizedBox(
|
||||||
|
height: widget.height,
|
||||||
|
child: Image.asset('images/loyalty_cards/Shell.png'),
|
||||||
|
);
|
||||||
|
case "edgars":
|
||||||
|
return SizedBox(
|
||||||
|
height: widget.height,
|
||||||
|
child: Image.asset('images/loyalty_cards/edgars.png'),
|
||||||
|
);
|
||||||
|
case "jet":
|
||||||
|
return SizedBox(
|
||||||
|
height: widget.height,
|
||||||
|
child: Image.asset('images/loyalty_cards/jet.png'),
|
||||||
|
);
|
||||||
|
case "spur":
|
||||||
|
return SizedBox(
|
||||||
|
height: widget.height,
|
||||||
|
child: Image.asset('images/loyalty_cards/spur.png'),
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return const SizedBox(
|
return SizedBox(
|
||||||
height: 150,
|
height: widget.height,
|
||||||
child: Placeholder(),
|
child: const Placeholder(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,9 +116,16 @@ class _LoyaltyCardsState extends State<LoyaltyCards> {
|
|||||||
"Clicks",
|
"Clicks",
|
||||||
"Cotton:On",
|
"Cotton:On",
|
||||||
"Dis-Chem",
|
"Dis-Chem",
|
||||||
|
"Edgars",
|
||||||
|
"Fresh Stop",
|
||||||
|
"Jet",
|
||||||
|
"Makro",
|
||||||
|
"Panarottis",
|
||||||
"Pick n Pay",
|
"Pick n Pay",
|
||||||
|
"Shell",
|
||||||
"Shoprite",
|
"Shoprite",
|
||||||
"Spar",
|
"Spar",
|
||||||
|
"Spur",
|
||||||
"Woolworths"
|
"Woolworths"
|
||||||
],
|
],
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||