fix wallet padding

This commit is contained in:
2025-06-06 12:35:11 +02:00
parent 2cd074f230
commit b6183f2a5d
2 changed files with 256 additions and 235 deletions

View File

@@ -43,7 +43,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
);
}
void editCardWindow(BuildContext ctxt, int index) {
void editCardWindow(BuildContext ctxt, int index, double width) {
showDialog(
context: context,
barrierDismissible: false,
@@ -55,7 +55,12 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
_nicknameController.clear();
Navigator.pop(context);
},
windowBody: Column(
windowBody: Padding(
padding:
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.05)
: EdgeInsets.symmetric(horizontal: width * 0),
child: Column(
children: [
MihForm(
formKey: _formKey,
@@ -117,7 +122,8 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
],
),
const SizedBox(height: 15),
MihButton(
Center(
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
@@ -132,24 +138,28 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
);
}
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
width: 300,
child: Text(
"Update",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
],
),
),
),
);
}
@@ -290,7 +300,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
);
}
void viewCardWindow(int index) {
void viewCardWindow(int index, double width) {
//print(widget.cardList[index].card_number);
String formattedCardNumber = "";
for (int i = 0; i <= widget.cardList[index].card_number.length - 1; i++) {
@@ -356,7 +366,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
_cardNumberController.text = widget.cardList[index].card_number;
_nicknameController.text = widget.cardList[index].nickname;
});
editCardWindow(context, index);
editCardWindow(context, index, width);
},
),
SpeedDialChild(
@@ -500,7 +510,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
height: 100,
),
onTap: () {
viewCardWindow(index);
viewCardWindow(index, size.width);
},
);
},

View File

@@ -83,7 +83,7 @@ class _MihCardsState extends State<MihCards> {
}
}
void addCardWindow(BuildContext ctxt) {
void addCardWindow(BuildContext ctxt, double width) {
showDialog(
context: context,
barrierDismissible: false,
@@ -97,7 +97,12 @@ class _MihCardsState extends State<MihCards> {
shopName.value = "";
Navigator.pop(context);
},
windowBody: Column(
windowBody: Padding(
padding:
MzanziInnovationHub.of(context)!.theme.screenType == "desktop"
? EdgeInsets.symmetric(horizontal: width * 0.05)
: EdgeInsets.symmetric(horizontal: width * 0),
child: Column(
children: [
MihForm(
formKey: _formKey,
@@ -157,7 +162,8 @@ class _MihCardsState extends State<MihCards> {
),
ValueListenableBuilder(
valueListenable: shopName,
builder: (BuildContext context, String value, Widget? child) {
builder:
(BuildContext context, String value, Widget? child) {
return Visibility(
visible: value != "",
child: Column(
@@ -230,7 +236,8 @@ class _MihCardsState extends State<MihCards> {
],
),
const SizedBox(height: 15),
MihButton(
Center(
child: MihButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
if (shopController.text == "") {
@@ -256,24 +263,28 @@ class _MihCardsState extends State<MihCards> {
}
}
},
buttonColor:
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
buttonColor: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
width: 300,
child: Text(
"Add",
style: TextStyle(
color:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
color: MzanziInnovationHub.of(context)!
.theme
.primaryColor(),
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
],
),
),
),
);
}
@@ -388,7 +399,7 @@ class _MihCardsState extends State<MihCards> {
backgroundColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
onTap: () {
addCardWindow(context);
addCardWindow(context, width);
},
)
]),