create new MIH Button
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_wallet_apis.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_alert.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
||||
@@ -81,49 +81,58 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
MIHButton(
|
||||
onTap: () async {
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
openscanner();
|
||||
},
|
||||
buttonText: "Scan",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
width: 100,
|
||||
child: Text(
|
||||
"Scan",
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
if (_cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
widget.cardList[index].favourite,
|
||||
widget.cardList[index].priority_index,
|
||||
_nicknameController.text,
|
||||
_cardNumberController.text,
|
||||
0,
|
||||
ctxt,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (_cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
widget.cardList[index].favourite,
|
||||
widget.cardList[index].priority_index,
|
||||
_nicknameController.text,
|
||||
_cardNumberController.text,
|
||||
0,
|
||||
ctxt,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Update",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
child: Text(
|
||||
"Update",
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -176,27 +185,30 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
SizedBox(
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
"Yes",
|
||||
_noFavourites,
|
||||
widget.cardList[index].nickname,
|
||||
widget.cardList[index].card_number,
|
||||
1,
|
||||
ctxt,
|
||||
);
|
||||
},
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
"Yes",
|
||||
_noFavourites,
|
||||
widget.cardList[index].nickname,
|
||||
widget.cardList[index].card_number,
|
||||
1,
|
||||
ctxt,
|
||||
);
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
child: Text(
|
||||
"Add",
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -232,27 +244,30 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
SizedBox(
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
"",
|
||||
0,
|
||||
widget.cardList[index].nickname,
|
||||
widget.cardList[index].card_number,
|
||||
0,
|
||||
ctxt,
|
||||
);
|
||||
},
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
MIHMzansiWalletApis.updateLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.cardList[index].idloyalty_cards,
|
||||
"",
|
||||
0,
|
||||
widget.cardList[index].nickname,
|
||||
widget.cardList[index].card_number,
|
||||
0,
|
||||
ctxt,
|
||||
);
|
||||
},
|
||||
buttonText: "Remove",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
child: Text(
|
||||
"Remove",
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
|
||||
class MihBarcodeScanner extends StatefulWidget {
|
||||
final TextEditingController cardNumberController;
|
||||
@@ -120,17 +120,25 @@ class _MihBarcodeScannerState extends State<MihBarcodeScanner>
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
child: MihButton(
|
||||
onPressed: () {
|
||||
_scannerController.stop();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
buttonText: "Cancel",
|
||||
buttonColor: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
width: 100,
|
||||
child: Text(
|
||||
"Cancel",
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!
|
||||
.theme
|
||||
.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// GestureDetector(
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_apis/mih_mzansi_wallet_apis.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_dropdown_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_search_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_text_input.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_single_child_scroll.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_tool_body.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_floating_menu.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||
@@ -184,51 +184,58 @@ class _MihCardsState extends State<MihCards> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
MIHButton(
|
||||
onTap: () async {
|
||||
openscanner();
|
||||
},
|
||||
buttonText: "Scan",
|
||||
MihButton(
|
||||
onPressed: () {},
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
width: 100,
|
||||
child: Text(
|
||||
"Scan",
|
||||
style: TextStyle(
|
||||
color:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
MihButton(
|
||||
onPressed: () {
|
||||
if (shopController.text == "" ||
|
||||
cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.addLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.signedInUser.app_id,
|
||||
shopController.text,
|
||||
cardNumberController.text,
|
||||
"",
|
||||
0,
|
||||
_nicknameController.text,
|
||||
0,
|
||||
context,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
width: 300,
|
||||
height: 50,
|
||||
child: MIHButton(
|
||||
onTap: () {
|
||||
if (shopController.text == "" ||
|
||||
cardNumberController.text == "") {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHErrorMessage(errorType: "Input Error");
|
||||
},
|
||||
);
|
||||
} else {
|
||||
MIHMzansiWalletApis.addLoyaltyCardAPICall(
|
||||
widget.signedInUser,
|
||||
widget.signedInUser.app_id,
|
||||
shopController.text,
|
||||
cardNumberController.text,
|
||||
"",
|
||||
0,
|
||||
_nicknameController.text,
|
||||
0,
|
||||
context,
|
||||
);
|
||||
}
|
||||
},
|
||||
buttonText: "Add",
|
||||
buttonColor:
|
||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||
textColor:
|
||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
child: Text(
|
||||
"Add",
|
||||
style: TextStyle(
|
||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user