fix add card scan bug
fix cancel button in scanner add new fields
This commit is contained in:
@@ -1,19 +1,17 @@
|
|||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:mzansi_innovation_hub/main.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_apis/mih_mzansi_wallet_apis.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_inputs_and_buttons/mih_number_input.dart';
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.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_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.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_alert.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_delete_message.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/loyalty_card.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/loyalty_card.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/components/mih_card_display.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/components/mih_card_display.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
// import 'package:syncfusion_flutter_barcodes/barcodes.dart';
|
|
||||||
import 'package:barcode_widget/barcode_widget.dart';
|
import 'package:barcode_widget/barcode_widget.dart';
|
||||||
|
|
||||||
class BuildLoyaltyCardList extends StatefulWidget {
|
class BuildLoyaltyCardList extends StatefulWidget {
|
||||||
@@ -36,6 +34,7 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
final TextEditingController _nicknameController = TextEditingController();
|
final TextEditingController _nicknameController = TextEditingController();
|
||||||
final TextEditingController _cardNumberController = TextEditingController();
|
final TextEditingController _cardNumberController = TextEditingController();
|
||||||
late int _noFavourites;
|
late int _noFavourites;
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
void openscanner() async {
|
void openscanner() async {
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed(
|
||||||
@@ -58,38 +57,86 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
},
|
},
|
||||||
windowBody: Column(
|
windowBody: Column(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 10),
|
MihForm(
|
||||||
MIHTextField(
|
formKey: _formKey,
|
||||||
controller: _nicknameController,
|
formFields: [
|
||||||
hintText: "Card Title",
|
MihTextFormField(
|
||||||
editable: true,
|
fillColor:
|
||||||
required: false,
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
inputColor:
|
||||||
const SizedBox(height: 10),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
Row(
|
controller: _nicknameController,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
multiLineInput: false,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
requiredText: false,
|
||||||
mainAxisSize: MainAxisSize.max,
|
hintText: "Card Title",
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: MIHNumberField(
|
|
||||||
controller: _cardNumberController,
|
|
||||||
hintText: "Card Number",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
enableDecimal: false,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: _cardNumberController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Card Number",
|
||||||
|
numberMode: true,
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 20),
|
||||||
|
MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
openscanner();
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 100,
|
||||||
|
child: Text(
|
||||||
|
"Scan",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
MihButton(
|
MihButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
openscanner();
|
if (_formKey.currentState!.validate()) {
|
||||||
|
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:
|
buttonColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
width: 100,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Scan",
|
"Update",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
@@ -100,41 +147,6 @@ class _BuildLoyaltyCardListState extends State<BuildLoyaltyCardList> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
|
||||||
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,
|
|
||||||
child: Text(
|
|
||||||
"Update",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ class _MihBarcodeScannerState extends State<MihBarcodeScanner>
|
|||||||
.theme
|
.theme
|
||||||
.secondaryColor(),
|
.secondaryColor(),
|
||||||
width: 100,
|
width: 100,
|
||||||
|
height: 50,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Cancel",
|
"Cancel",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
|
||||||
import 'package:mzansi_innovation_hub/main.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_apis/mih_mzansi_wallet_apis.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_apis/mih_validation_services.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_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_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_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_button.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_form.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_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_floating_menu.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_package_window.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_search_bar.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_search_bar.dart';
|
||||||
|
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_text_form_field.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_error_message.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
import 'package:mzansi_innovation_hub/mih_objects/app_user.dart';
|
||||||
@@ -36,6 +37,7 @@ class _MihCardsState extends State<MihCards> {
|
|||||||
final TextEditingController cardNumberController = TextEditingController();
|
final TextEditingController cardNumberController = TextEditingController();
|
||||||
final TextEditingController cardSearchController = TextEditingController();
|
final TextEditingController cardSearchController = TextEditingController();
|
||||||
final FocusNode searchFocusNode = FocusNode();
|
final FocusNode searchFocusNode = FocusNode();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
late Future<List<MIHLoyaltyCard>> cardList;
|
late Future<List<MIHLoyaltyCard>> cardList;
|
||||||
List<MIHLoyaltyCard> listOfCards = [];
|
List<MIHLoyaltyCard> listOfCards = [];
|
||||||
//bool showSelectedCardType = false;
|
//bool showSelectedCardType = false;
|
||||||
@@ -97,104 +99,168 @@ class _MihCardsState extends State<MihCards> {
|
|||||||
},
|
},
|
||||||
windowBody: Column(
|
windowBody: Column(
|
||||||
children: [
|
children: [
|
||||||
MIHDropdownField(
|
MihForm(
|
||||||
controller: shopController,
|
formKey: _formKey,
|
||||||
hintText: "Shop Name",
|
formFields: [
|
||||||
dropdownOptions: const [
|
MIHDropdownField(
|
||||||
"+More",
|
controller: shopController,
|
||||||
"Apple Tree",
|
hintText: "Shop Name",
|
||||||
"Auchan",
|
dropdownOptions: const [
|
||||||
"Best Before",
|
"+More",
|
||||||
"Big Save",
|
"Apple Tree",
|
||||||
"Boxer",
|
"Auchan",
|
||||||
"BP",
|
"Best Before",
|
||||||
"Builders Warehouse",
|
"Big Save",
|
||||||
"Checkers",
|
"Boxer",
|
||||||
"Choppies",
|
"BP",
|
||||||
"Clicks",
|
"Builders Warehouse",
|
||||||
"Continente",
|
"Checkers",
|
||||||
"Cotton:On",
|
"Choppies",
|
||||||
"Carrefour",
|
"Clicks",
|
||||||
"Dis-Chem",
|
"Continente",
|
||||||
"Edgars",
|
"Cotton:On",
|
||||||
"Eskom",
|
"Carrefour",
|
||||||
"Exclusive Books",
|
"Dis-Chem",
|
||||||
"Fresh Stop",
|
"Edgars",
|
||||||
"Fresmart",
|
"Eskom",
|
||||||
"Infinity",
|
"Exclusive Books",
|
||||||
"Jet",
|
"Fresh Stop",
|
||||||
"Justrite",
|
"Fresmart",
|
||||||
"Kero",
|
"Infinity",
|
||||||
"Leroy Merlin",
|
"Jet",
|
||||||
"Makro",
|
"Justrite",
|
||||||
"Naivas",
|
"Kero",
|
||||||
"OK Foods",
|
"Leroy Merlin",
|
||||||
"Panarottis",
|
"Makro",
|
||||||
"Pick n Pay",
|
"Naivas",
|
||||||
"PnA",
|
"OK Foods",
|
||||||
"PQ Clothing",
|
"Panarottis",
|
||||||
"Rage",
|
"Pick n Pay",
|
||||||
"Sefalana",
|
"PnA",
|
||||||
"Sasol",
|
"PQ Clothing",
|
||||||
"Shell",
|
"Rage",
|
||||||
"Shoprite",
|
"Sefalana",
|
||||||
"Signature Cosmetics & Fragrances",
|
"Sasol",
|
||||||
"Spar",
|
"Shell",
|
||||||
"Spur",
|
"Shoprite",
|
||||||
"TFG Group",
|
"Signature Cosmetics & Fragrances",
|
||||||
"Toys R Us",
|
"Spar",
|
||||||
"Woermann Brock",
|
"Spur",
|
||||||
"Woolworths"
|
"TFG Group",
|
||||||
],
|
"Toys R Us",
|
||||||
required: true,
|
"Woermann Brock",
|
||||||
editable: true,
|
"Woolworths"
|
||||||
enableSearch: false,
|
],
|
||||||
),
|
required: true,
|
||||||
ValueListenableBuilder(
|
editable: true,
|
||||||
valueListenable: shopName,
|
enableSearch: false,
|
||||||
builder: (BuildContext context, String value, Widget? child) {
|
|
||||||
return Visibility(
|
|
||||||
visible: value != "",
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MihCardDisplay(
|
|
||||||
shopName: shopName.value, nickname: "", height: 200),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
MIHTextField(
|
|
||||||
controller: _nicknameController,
|
|
||||||
hintText: "Card Title",
|
|
||||||
editable: true,
|
|
||||||
required: false,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 10),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Flexible(
|
|
||||||
child: MIHNumberField(
|
|
||||||
controller: cardNumberController,
|
|
||||||
hintText: "Card Number",
|
|
||||||
editable: true,
|
|
||||||
required: true,
|
|
||||||
enableDecimal: false,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
ValueListenableBuilder(
|
||||||
|
valueListenable: shopName,
|
||||||
|
builder: (BuildContext context, String value, Widget? child) {
|
||||||
|
return Visibility(
|
||||||
|
visible: value != "",
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihCardDisplay(
|
||||||
|
shopName: shopName.value,
|
||||||
|
nickname: "",
|
||||||
|
height: 200),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
fillColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: _nicknameController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: false,
|
||||||
|
hintText: "Card Title",
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: MihTextFormField(
|
||||||
|
fillColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
inputColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
controller: cardNumberController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
hintText: "Card Number",
|
||||||
|
numberMode: true,
|
||||||
|
validator: (value) {
|
||||||
|
return MihValidationServices().isEmpty(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 20),
|
||||||
|
MihButton(
|
||||||
|
onPressed: () {
|
||||||
|
openscanner();
|
||||||
|
},
|
||||||
|
buttonColor: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
|
width: 100,
|
||||||
|
child: Text(
|
||||||
|
"Scan",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!
|
||||||
|
.theme
|
||||||
|
.primaryColor(),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
MihButton(
|
MihButton(
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
if (shopController.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:
|
buttonColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
width: 100,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Scan",
|
"Add",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color:
|
color:
|
||||||
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
@@ -205,43 +271,6 @@ class _MihCardsState extends State<MihCards> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 15),
|
|
||||||
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,
|
|
||||||
child: Text(
|
|
||||||
"Add",
|
|
||||||
style: TextStyle(
|
|
||||||
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user