Merge branch '6.x' into add-missing-translations
This commit is contained in:
commit
29ab5a9eac
@ -38,7 +38,11 @@ PAYPAL_LIVE_MODE=null
|
||||
PAYPAL_LOCALE=null
|
||||
# Use BCP-47 code from this link https://developer.paypal.com/docs/api/reference/locale-codes/
|
||||
|
||||
# *<! ------ RAZORPAY (OPTIONAL) ------!>*
|
||||
|
||||
RAZORPAY_API_KEY=""
|
||||
|
||||
# *<! ------ EXTRAS ------!>*
|
||||
|
||||
PRODUCT_PLACEHOLDER_IMAGE="https://woosignal.com/images/woocommerce-placeholder.png"
|
||||
# Sets the default placeholder image for products with no image
|
||||
# Sets the default placeholder image for products with no image
|
||||
@ -1,3 +1,10 @@
|
||||
## [6.1.0] - 2022-07-09
|
||||
|
||||
* Add RazorPay
|
||||
* Null safety tweaks to widgets
|
||||
* Ability for users to delete their accounts using WP_JSON
|
||||
* Pubspec.yaml dependency updates
|
||||
|
||||
## [6.0.0] - 2022-05-19
|
||||
|
||||
* Migrate to Nylo 3.x
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
# WooCommerce App: Label StoreMax
|
||||
|
||||
### Label StoreMax - v6.0.0
|
||||
### Label StoreMax - v6.1.0
|
||||
|
||||
|
||||
[Official WooSignal WooCommerce App](https://woosignal.com)
|
||||
@ -44,7 +44,7 @@ Full documentation this available [here](https://woosignal.com/docs/app/label-st
|
||||
- Browse products, make orders, customer login (via WordPress)
|
||||
- Change app name, logo, customize default language, currency + more
|
||||
- Light and dark mode
|
||||
- Stripe, Cash On Delivery, PayPal
|
||||
- Stripe, Cash On Delivery, PayPal, RazorPay
|
||||
- Localized for en, es, pt, it, hi, fr, zh, tr, nl, de
|
||||
- Orders show as normal in WooCommerce
|
||||
|
||||
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "einreichen",
|
||||
"Your review has been submitted": "Ihre Bewertung wurde übermittelt",
|
||||
"Delete Account": "Konto löschen",
|
||||
"Phone Number": "Telefonnummer"
|
||||
"Phone Number": "Telefonnummer",
|
||||
"Delete your account": "Lösche deinen Account",
|
||||
"Are you sure?": "Bist du dir sicher?",
|
||||
"Yes, delete my account": "Ja, lösche mein Konto",
|
||||
"Account deleted": "Konto gelöscht"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Submit",
|
||||
"Your review has been submitted": "Your review has been submitted",
|
||||
"Delete Account": "Delete Account",
|
||||
"Phone Number": "Phone Number"
|
||||
"Phone Number": "Phone Number",
|
||||
"Delete your account": "Delete your account",
|
||||
"Are you sure?": "Are you sure?",
|
||||
"Yes, delete my account": "Yes, delete my account",
|
||||
"Account deleted": "Account deleted"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Entregar",
|
||||
"Your review has been submitted": "Tu reseña ha sido enviada",
|
||||
"Delete Account": "Borrar cuenta",
|
||||
"Phone Number": "Número de teléfono"
|
||||
"Phone Number": "Número de teléfono",
|
||||
"Delete your account": "eliminar su cuenta",
|
||||
"Are you sure?": "¿Está seguro?",
|
||||
"Yes, delete my account": "Sí, eliminar mi cuenta",
|
||||
"Account deleted": "Cuenta borrada"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Soumettre",
|
||||
"Your review has been submitted": "Votre avis a été soumis",
|
||||
"Delete Account": "Supprimer le compte",
|
||||
"Phone Number": "Numéro de téléphone"
|
||||
"Phone Number": "Numéro de téléphone",
|
||||
"Delete your account": "Supprimer votre compte",
|
||||
"Are you sure?": "Êtes-vous sûr?",
|
||||
"Yes, delete my account": "Oui, supprimer mon compte",
|
||||
"Account deleted": "Compte supprimé"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "prastut karana",
|
||||
"Your review has been submitted": "aapakee sameeksha jama ho chukee hai",
|
||||
"Delete Account": "khaata hata do",
|
||||
"Phone Number": "fon nambar"
|
||||
"Phone Number": "fon nambar",
|
||||
"Delete your account": "apane khaate ko nasht karo",
|
||||
"Are you sure?": "kya aapako yakeen hai?",
|
||||
"Yes, delete my account": "haan, mera akaunt dileet kar do",
|
||||
"Account deleted": "khaata hataaya gaya"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Invia",
|
||||
"Your review has been submitted": "La tua recensione è stata inviata",
|
||||
"Delete Account": "Eliminare l'account",
|
||||
"Phone Number": "Numero di telefono"
|
||||
"Phone Number": "Numero di telefono",
|
||||
"Delete your account": "cancella il tuo account",
|
||||
"Are you sure?": "Sei sicuro?",
|
||||
"Yes, delete my account": "Sì, elimina il mio account",
|
||||
"Account deleted": "Account cancellato"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Indienen",
|
||||
"Your review has been submitted": "Uw beoordeling is verzonden",
|
||||
"Delete Account": "Account verwijderen",
|
||||
"Phone Number": "Telefoonnummer"
|
||||
"Phone Number": "Telefoonnummer",
|
||||
"Delete your account": "Verwijder je account",
|
||||
"Are you sure?": "Weet je het zeker?",
|
||||
"Yes, delete my account": "Ja, verwijder mijn account",
|
||||
"Account deleted": "Account verwijderd"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Enviar",
|
||||
"Your review has been submitted": "Sua avaliação foi enviada",
|
||||
"Delete Account": "Deletar conta",
|
||||
"Phone Number": "Número de telefone"
|
||||
"Phone Number": "Número de telefone",
|
||||
"Delete your account": "Deletar sua conta",
|
||||
"Are you sure?": "Tem certeza?",
|
||||
"Yes, delete my account": "Sim, excluir minha conta",
|
||||
"Account deleted": "Conta excluída"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "Göndermek",
|
||||
"Your review has been submitted": "İncelemeniz gönderildi",
|
||||
"Delete Account": "Hesabı sil",
|
||||
"Phone Number": "Telefon numarası"
|
||||
"Phone Number": "Telefon numarası",
|
||||
"Delete your account": "Hesabını sil",
|
||||
"Are you sure?": "Emin misin?",
|
||||
"Yes, delete my account": "Evet, hesabımı sil",
|
||||
"Account deleted": "Hesap silindi"
|
||||
}
|
||||
@ -222,5 +222,9 @@
|
||||
"Submit": "提交",
|
||||
"Your review has been submitted": "您的评论已提交",
|
||||
"Delete Account": "删除帐户",
|
||||
"Phone Number": "电话号码"
|
||||
"Phone Number": "电话号码",
|
||||
"Delete your account": "删除您的帐户",
|
||||
"Are you sure?": "你确定吗?",
|
||||
"Yes, delete my account": "是的,删除我的帐户",
|
||||
"Account deleted": "帐号已删除"
|
||||
}
|
||||
81
LabelStoreMax/lib/app/providers/razorpay_pay.dart
Normal file
81
LabelStoreMax/lib/app/providers/razorpay_pay.dart
Normal file
@ -0,0 +1,81 @@
|
||||
//
|
||||
// LabelCore
|
||||
// Label StoreMAX
|
||||
//
|
||||
// Created by Anthony Gordon.
|
||||
// 2022, WooSignal Ltd. All rights reserved.
|
||||
//
|
||||
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_app/app/models/cart.dart';
|
||||
import 'package:flutter_app/bootstrap/data/order_wc.dart';
|
||||
import 'package:flutter_app/bootstrap/helpers.dart';
|
||||
import 'package:flutter_app/resources/pages/checkout_confirmation.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:razorpay_flutter/razorpay_flutter.dart';
|
||||
import 'package:woosignal/models/response/tax_rate.dart';
|
||||
import 'package:woosignal/models/payload/order_wc.dart';
|
||||
import 'package:woosignal/models/response/order.dart';
|
||||
|
||||
razorPay(context,
|
||||
{required CheckoutConfirmationPageState state, TaxRate? taxRate}) async {
|
||||
Razorpay razorpay = Razorpay();
|
||||
|
||||
razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS,
|
||||
(PaymentSuccessResponse response) async {
|
||||
OrderWC orderWC = await buildOrderWC(taxRate: taxRate);
|
||||
|
||||
Order? order = await appWooSignal((api) => api.createOrder(orderWC));
|
||||
|
||||
if (order != null) {
|
||||
Cart.getInstance.clear();
|
||||
Navigator.pushNamed(context, "/checkout-status", arguments: order);
|
||||
} else {
|
||||
showToastNotification(
|
||||
context,
|
||||
title: "Error".tr(),
|
||||
description: trans("Something went wrong, please contact our store"),
|
||||
);
|
||||
state.reloadState(showLoader: false);
|
||||
}
|
||||
});
|
||||
|
||||
razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, (PaymentFailureResponse response) {
|
||||
showToastNotification(context,
|
||||
title: trans("Error"),
|
||||
description: response.message ?? "",
|
||||
style: ToastNotificationStyleType.WARNING);
|
||||
state.reloadState(showLoader: false);
|
||||
});
|
||||
|
||||
razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
|
||||
|
||||
// CHECKOUT HELPER
|
||||
await checkout(taxRate, (total, billingDetails, cart) async {
|
||||
var options = {
|
||||
'key': getEnv('RAZORPAY_API_KEY'),
|
||||
'amount': (double.parse(total) * 100).toInt(),
|
||||
'name': getEnv('APP_NAME'),
|
||||
'description': await cart.cartShortDesc(),
|
||||
'prefill': {
|
||||
"name": [
|
||||
billingDetails!.billingAddress?.firstName,
|
||||
billingDetails.billingAddress?.lastName
|
||||
].where((t) => t != null || t != "").toList().join(" "),
|
||||
"method": "card",
|
||||
'email': billingDetails.billingAddress?.emailAddress ?? ""
|
||||
}
|
||||
};
|
||||
|
||||
state.reloadState(showLoader: true);
|
||||
|
||||
razorpay.open(options);
|
||||
});
|
||||
}
|
||||
|
||||
void _handleExternalWallet(ExternalWalletResponse response) {}
|
||||
@ -1 +0,0 @@
|
||||
|
||||
@ -51,7 +51,7 @@ stripePay(context,
|
||||
// // CHECKOUT HELPER
|
||||
await checkout(taxRate, (total, billingDetails, cart) async {
|
||||
Map<String, dynamic> address = {
|
||||
"name": billingDetails!.billingAddress!.nameFull(),
|
||||
"name": billingDetails!.billingAddress?.nameFull(),
|
||||
"line1": billingDetails.shippingAddress!.addressLine,
|
||||
"city": billingDetails.shippingAddress!.city,
|
||||
"postal_code": billingDetails.shippingAddress!.postalCode,
|
||||
@ -62,7 +62,7 @@ stripePay(context,
|
||||
|
||||
rsp = await appWooSignal((api) => api.stripePaymentIntent(
|
||||
amount: total,
|
||||
email: billingDetails.billingAddress!.emailAddress,
|
||||
email: billingDetails.billingAddress?.emailAddress,
|
||||
desc: cartShortDesc,
|
||||
shipping: address,
|
||||
));
|
||||
|
||||
@ -60,19 +60,19 @@ Future<OrderWC> buildOrderWC({TaxRate? taxRate, bool markPaid = true}) async {
|
||||
BillingDetails billingDetails = checkoutSession.billingDetails!;
|
||||
|
||||
Billing billing = Billing();
|
||||
billing.firstName = billingDetails.billingAddress!.firstName;
|
||||
billing.lastName = billingDetails.billingAddress!.lastName;
|
||||
billing.address1 = billingDetails.billingAddress!.addressLine;
|
||||
billing.city = billingDetails.billingAddress!.city;
|
||||
billing.postcode = billingDetails.billingAddress!.postalCode;
|
||||
billing.email = billingDetails.billingAddress!.emailAddress;
|
||||
if (billingDetails.billingAddress!.phoneNumber != "") {
|
||||
billing.phone = billingDetails.billingAddress!.phoneNumber;
|
||||
billing.firstName = billingDetails.billingAddress?.firstName;
|
||||
billing.lastName = billingDetails.billingAddress?.lastName;
|
||||
billing.address1 = billingDetails.billingAddress?.addressLine;
|
||||
billing.city = billingDetails.billingAddress?.city;
|
||||
billing.postcode = billingDetails.billingAddress?.postalCode;
|
||||
billing.email = billingDetails.billingAddress?.emailAddress;
|
||||
if (billingDetails.billingAddress?.phoneNumber != "") {
|
||||
billing.phone = billingDetails.billingAddress?.phoneNumber;
|
||||
}
|
||||
if (billingDetails.billingAddress!.customerCountry!.hasState()) {
|
||||
billing.state = billingDetails.billingAddress!.customerCountry!.state!.name;
|
||||
if (billingDetails.billingAddress?.customerCountry?.hasState() ?? false) {
|
||||
billing.state = billingDetails.billingAddress?.customerCountry!.state!.name;
|
||||
}
|
||||
billing.country = billingDetails.billingAddress!.customerCountry!.name;
|
||||
billing.country = billingDetails.billingAddress?.customerCountry!.name;
|
||||
|
||||
orderWC.billing = billing;
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ import 'package:flutter_web_browser/flutter_web_browser.dart';
|
||||
import 'package:math_expressions/math_expressions.dart';
|
||||
import 'package:money_formatter/money_formatter.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:status_alert/status_alert.dart';
|
||||
import 'package:woosignal/models/response/products.dart';
|
||||
import 'package:woosignal/models/response/tax_rate.dart';
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter_app/app/models/payment_type.dart';
|
||||
import 'package:flutter_app/app/providers/cash_on_delivery.dart';
|
||||
import 'package:flutter_app/app/providers/paypal_pay.dart';
|
||||
import 'package:flutter_app/app/providers/razorpay_pay.dart';
|
||||
import 'package:flutter_app/app/providers/stripe_pay.dart';
|
||||
import 'package:flutter_app/bootstrap/helpers.dart';
|
||||
|
||||
@ -14,7 +15,7 @@ import 'package:flutter_app/bootstrap/helpers.dart';
|
||||
*/
|
||||
|
||||
const appPaymentGateways = [];
|
||||
// Available: "Stripe", "CashOnDelivery", "PayPal"
|
||||
// Available: "Stripe", "CashOnDelivery", "PayPal", "RazorPay"
|
||||
// e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery.
|
||||
|
||||
List<PaymentType> paymentTypeList = [
|
||||
@ -42,10 +43,18 @@ List<PaymentType> paymentTypeList = [
|
||||
pay: payPalPay,
|
||||
),
|
||||
|
||||
addPayment(
|
||||
id: 5,
|
||||
name: "RazorPay",
|
||||
desc: "Debit or Credit Card",
|
||||
assetImage: "razorpay.png",
|
||||
pay: razorPay,
|
||||
),
|
||||
|
||||
// e.g. add more here
|
||||
|
||||
// addPayment(
|
||||
// id: 5,
|
||||
// id: 6,
|
||||
// name: "MyNewPaymentMethod",
|
||||
// desc: "Debit or Credit Card",
|
||||
// assetImage: "add icon image to public/assets/images/myimage.png",
|
||||
|
||||
92
LabelStoreMax/lib/resources/pages/account_delete_page.dart
Normal file
92
LabelStoreMax/lib/resources/pages/account_delete_page.dart
Normal file
@ -0,0 +1,92 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
|
||||
import 'package:flutter_app/resources/widgets/buttons.dart';
|
||||
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:wp_json_api/models/responses/wp_user_delete_response.dart';
|
||||
import 'package:wp_json_api/wp_json_api.dart';
|
||||
|
||||
class AccountDeletePage extends StatefulWidget {
|
||||
AccountDeletePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AccountDeletePageState createState() => _AccountDeletePageState();
|
||||
}
|
||||
|
||||
class _AccountDeletePageState extends NyState<AccountDeletePage> {
|
||||
|
||||
@override
|
||||
init() async {
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(trans("Delete Account")),
|
||||
),
|
||||
body: SafeAreaWidget(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.no_accounts_rounded, size: 50),
|
||||
Text(trans("Delete your account"), style: textTheme.headline3,),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 18),
|
||||
child: Text(trans("Are you sure?")),
|
||||
),
|
||||
],),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
PrimaryButton(title: trans("Yes, delete my account"), isLoading: isLocked('delete_account'), action: _deleteAccount),
|
||||
LinkButton(title: trans("Back"), action: pop)
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_deleteAccount() async {
|
||||
await lockRelease('delete_account', perform: () async {
|
||||
String? userToken = await readAuthToken();
|
||||
|
||||
WPUserDeleteResponse? wpUserDeleteResponse;
|
||||
try {
|
||||
wpUserDeleteResponse = await WPJsonAPI.instance
|
||||
.api((request) => request.wpUserDelete(
|
||||
userToken
|
||||
));
|
||||
} on Exception catch (e) {
|
||||
NyLogger.error(e.toString());
|
||||
showToastNotification(
|
||||
context,
|
||||
title: trans("Oops!"),
|
||||
description: trans("Something went wrong"),
|
||||
style: ToastNotificationStyleType.DANGER,
|
||||
);
|
||||
}
|
||||
|
||||
if (wpUserDeleteResponse != null) {
|
||||
showToast(title: trans("Success"), description: trans("Account deleted"));
|
||||
await authLogout(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -31,8 +31,8 @@ class AccountLandingPage extends StatefulWidget {
|
||||
_AccountLandingPageState createState() => _AccountLandingPageState();
|
||||
}
|
||||
|
||||
class _AccountLandingPageState extends State<AccountLandingPage> {
|
||||
bool _hasTappedLogin = false;
|
||||
class _AccountLandingPageState extends NyState<AccountLandingPage> {
|
||||
|
||||
final TextEditingController _tfEmailController = TextEditingController(),
|
||||
_tfPasswordController = TextEditingController();
|
||||
|
||||
@ -98,7 +98,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
|
||||
obscureText: true),
|
||||
PrimaryButton(
|
||||
title: trans("Login"),
|
||||
isLoading: _hasTappedLogin,
|
||||
isLoading: isLocked('login_button'),
|
||||
action: _loginUser,
|
||||
),
|
||||
],
|
||||
@ -185,11 +185,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_hasTappedLogin == false) {
|
||||
setState(() {
|
||||
_hasTappedLogin = true;
|
||||
});
|
||||
|
||||
await lockRelease('login_button', perform: () async {
|
||||
WPUserLoginResponse? wpUserLoginResponse;
|
||||
try {
|
||||
wpUserLoginResponse = await WPJsonAPI.instance.api(
|
||||
@ -221,17 +217,19 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
|
||||
description: trans("Invalid login credentials"),
|
||||
style: ToastNotificationStyleType.DANGER,
|
||||
icon: Icons.account_circle);
|
||||
} finally {
|
||||
setState(() {
|
||||
_hasTappedLogin = false;
|
||||
});
|
||||
}
|
||||
|
||||
if (wpUserLoginResponse != null && wpUserLoginResponse.status == 200) {
|
||||
if (wpUserLoginResponse == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (wpUserLoginResponse.status != 200) {
|
||||
return;
|
||||
}
|
||||
String? token = wpUserLoginResponse.data!.userToken;
|
||||
String userId = wpUserLoginResponse.data!.userId.toString();
|
||||
User user = User.fromUserAuthResponse(token: token, userId: userId);
|
||||
user.save(SharedKey.authUser);
|
||||
await user.save(SharedKey.authUser);
|
||||
|
||||
showToastNotification(context,
|
||||
title: trans("Hello"),
|
||||
@ -240,7 +238,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
|
||||
icon: Icons.account_circle);
|
||||
navigatorPush(context,
|
||||
routeName: UserAuth.instance.redirect, forgetLast: 1);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,10 +37,9 @@ class AccountRegistrationPage extends StatefulWidget {
|
||||
_AccountRegistrationPageState();
|
||||
}
|
||||
|
||||
class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
class _AccountRegistrationPageState extends NyState<AccountRegistrationPage> {
|
||||
_AccountRegistrationPageState();
|
||||
|
||||
bool _hasTappedRegister = false;
|
||||
final TextEditingController _tfEmailAddressController =
|
||||
TextEditingController(),
|
||||
_tfPasswordController = TextEditingController(),
|
||||
@ -106,7 +105,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
Padding(
|
||||
child: PrimaryButton(
|
||||
title: trans("Sign up"),
|
||||
isLoading: _hasTappedRegister,
|
||||
isLoading: isLocked('register_user'),
|
||||
action: _signUpTapped,
|
||||
),
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
@ -122,7 +121,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
TextSpan(
|
||||
text: trans("terms and conditions"),
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
TextSpan(text: ' ' + trans("and") + ' '),
|
||||
TextSpan(text: ' ${trans("and")} '),
|
||||
TextSpan(
|
||||
text: trans("privacy policy"),
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
@ -171,18 +170,14 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_hasTappedRegister == false) {
|
||||
setState(() {
|
||||
_hasTappedRegister = true;
|
||||
});
|
||||
|
||||
await lockRelease('register_user', perform: () async {
|
||||
String username =
|
||||
(email.replaceAll(RegExp(r'([@.])'), "")) + _randomStr(4);
|
||||
|
||||
WPUserRegisterResponse? wpUserRegisterResponse;
|
||||
try {
|
||||
wpUserRegisterResponse = await WPJsonAPI.instance.api(
|
||||
(request) => request.wpRegister(
|
||||
(request) => request.wpRegister(
|
||||
email: email.toLowerCase(),
|
||||
password: password,
|
||||
username: username,
|
||||
@ -197,7 +192,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
showToastNotification(context,
|
||||
title: trans("Invalid details"),
|
||||
description:
|
||||
trans("Something went wrong, please contact our store"),
|
||||
trans("Something went wrong, please contact our store"),
|
||||
style: ToastNotificationStyleType.DANGER);
|
||||
} on ExistingUserLoginException catch (_) {
|
||||
showToastNotification(context,
|
||||
@ -224,18 +219,21 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
title: trans("Oops!"),
|
||||
description: trans("Something went wrong"),
|
||||
style: ToastNotificationStyleType.DANGER);
|
||||
} finally {
|
||||
setState(() {
|
||||
_hasTappedRegister = false;
|
||||
});
|
||||
}
|
||||
|
||||
if (wpUserRegisterResponse != null &&
|
||||
wpUserRegisterResponse.status == 200) {
|
||||
if (wpUserRegisterResponse == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (wpUserRegisterResponse.status != 200) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save user to shared preferences
|
||||
String? token = wpUserRegisterResponse.data!.userToken;
|
||||
String userId = wpUserRegisterResponse.data!.userId.toString();
|
||||
User user = User.fromUserAuthResponse(token: token, userId: userId);
|
||||
user.save(SharedKey.authUser);
|
||||
await user.save(SharedKey.authUser);
|
||||
|
||||
await WPJsonAPI.instance.api((request) => request
|
||||
.wpUpdateUserInfo(token, firstName: firstName, lastName: lastName));
|
||||
@ -247,8 +245,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
|
||||
icon: Icons.account_circle);
|
||||
navigatorPush(context,
|
||||
routeName: UserAuth.instance.redirect, forgetLast: 2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_viewTOSModal() async {
|
||||
|
||||
@ -18,7 +18,7 @@ import 'package:flutter_app/resources/widgets/buttons.dart';
|
||||
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/product_category.dart';
|
||||
import 'package:woosignal/models/response/products.dart' as ws_product;
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ import 'package:flutter_app/bootstrap/helpers.dart';
|
||||
import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/products.dart' as ws_product;
|
||||
|
||||
class BrowseSearchPage extends NyStatefulWidget {
|
||||
|
||||
@ -294,7 +294,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkoutSession.billingDetails!.billingAddress!.hasMissingFields()) {
|
||||
if (checkoutSession.billingDetails?.billingAddress?.hasMissingFields() ?? true) {
|
||||
showToastNotification(
|
||||
context,
|
||||
title: trans("Oops"),
|
||||
|
||||
@ -90,7 +90,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
|
||||
CheckoutSession.getInstance.billingDetails!.initSession();
|
||||
CheckoutSession.getInstance.billingDetails!.shippingAddress!
|
||||
.initAddress();
|
||||
CheckoutSession.getInstance.billingDetails!.billingAddress!.initAddress();
|
||||
CheckoutSession.getInstance.billingDetails!.billingAddress?.initAddress();
|
||||
}
|
||||
BillingDetails billingDetails = CheckoutSession.getInstance.billingDetails!;
|
||||
_setFieldsFromCustomerAddress(billingDetails.billingAddress,
|
||||
|
||||
@ -154,7 +154,7 @@ class _CouponPageState extends State<CouponPage> {
|
||||
|
||||
// Check email restrictions
|
||||
String? emailAddress =
|
||||
checkoutSession.billingDetails!.billingAddress!.emailAddress;
|
||||
checkoutSession.billingDetails!.billingAddress?.emailAddress;
|
||||
if (coupon.emailRestrictions!.contains(emailAddress)) {
|
||||
_showAlert(
|
||||
message: trans('You cannot redeem this coupon'),
|
||||
|
||||
@ -18,7 +18,7 @@ import 'package:flutter_app/resources/widgets/product_review_item_container_widg
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/product_review.dart';
|
||||
import 'package:woosignal/models/response/products.dart';
|
||||
import '../../app/controllers/product_reviews_controller.dart';
|
||||
|
||||
@ -15,7 +15,7 @@ import 'package:flutter_app/bootstrap/helpers.dart';
|
||||
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
|
||||
import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/order.dart';
|
||||
|
||||
class AccountDetailOrdersWidget extends StatefulWidget {
|
||||
|
||||
@ -46,6 +46,14 @@ class AccountDetailSettingsWidget extends StatelessWidget {
|
||||
Navigator.pushNamed(context, "/account-billing-details"),
|
||||
),
|
||||
),
|
||||
Card(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.no_accounts_rounded),
|
||||
title: Text("Delete Account"),
|
||||
onTap: () =>
|
||||
Navigator.pushNamed(context, "/account-delete"),
|
||||
),
|
||||
),
|
||||
Card(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.exit_to_app),
|
||||
|
||||
@ -63,7 +63,7 @@ class CheckoutSelectCouponWidget extends StatelessWidget {
|
||||
|
||||
return;
|
||||
}
|
||||
if (checkoutSession.billingDetails!.billingAddress!.hasMissingFields()) {
|
||||
if (checkoutSession.billingDetails?.billingAddress?.hasMissingFields() ?? true) {
|
||||
showToastNotification(
|
||||
context,
|
||||
title: trans("Oops"),
|
||||
|
||||
@ -18,6 +18,7 @@ class CheckoutStoreHeadingWidget extends StatelessWidget {
|
||||
child: ClipRRect(
|
||||
child: StoreLogo(height: 65),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
));
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,10 +23,9 @@ class CheckoutUserDetailsWidget extends StatelessWidget {
|
||||
leadImage: Icon(Icons.home),
|
||||
leadTitle: hasUserCheckoutInfo
|
||||
? (checkoutSession.billingDetails == null ||
|
||||
checkoutSession.billingDetails!.billingAddress!
|
||||
.hasMissingFields()
|
||||
(checkoutSession.billingDetails?.billingAddress?.hasMissingFields() ?? true)
|
||||
? trans("Billing address is incomplete")
|
||||
: checkoutSession.billingDetails!.billingAddress!.addressFull())
|
||||
: checkoutSession.billingDetails!.billingAddress?.addressFull())
|
||||
: trans("Add billing & shipping details"),
|
||||
action: _actionCheckoutDetails,
|
||||
showBorderBottom: true,
|
||||
@ -36,10 +35,6 @@ class CheckoutUserDetailsWidget extends StatelessWidget {
|
||||
_actionCheckoutDetails() {
|
||||
Navigator.pushNamed(context, "/checkout-details").then((e) {
|
||||
resetState!();
|
||||
// setState(() {
|
||||
// _showFullLoader = true;
|
||||
// });
|
||||
// _getTaxes();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import 'package:flutter_app/resources/widgets/home_drawer_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/woosignal_app.dart';
|
||||
import 'package:woosignal/models/response/product_category.dart' as ws_category;
|
||||
import 'package:woosignal/models/response/products.dart' as ws_product;
|
||||
|
||||
@ -10,7 +10,7 @@ import 'package:flutter_app/resources/widgets/safearea_widget.dart';
|
||||
import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
|
||||
import 'package:flutter_swiper_tv/flutter_swiper.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/woosignal_app.dart';
|
||||
import 'package:woosignal/models/response/product_category.dart' as ws_category;
|
||||
import 'package:woosignal/models/response/products.dart' as ws_product;
|
||||
|
||||
@ -23,7 +23,7 @@ import 'package:flutter_app/resources/widgets/top_nav_widget.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
import 'package:flutter_swiper_tv/flutter_swiper.dart';
|
||||
import 'package:nylo_framework/nylo_framework.dart';
|
||||
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
||||
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
|
||||
import 'package:woosignal/models/response/products.dart';
|
||||
import 'package:woosignal/models/response/tax_rate.dart';
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter_app/resources/pages/account_billing_details.dart';
|
||||
import 'package:flutter_app/resources/pages/account_delete_page.dart';
|
||||
import 'package:flutter_app/resources/pages/account_detail.dart';
|
||||
import 'package:flutter_app/resources/pages/account_landing.dart';
|
||||
import 'package:flutter_app/resources/pages/account_order_detail.dart';
|
||||
@ -103,6 +104,8 @@ appRouter() => nyRoutes((router) {
|
||||
|
||||
router.route("/account-update", (context) => AccountProfileUpdatePage());
|
||||
|
||||
router.route("/account-delete", (context) => AccountDeletePage());
|
||||
|
||||
router.route(
|
||||
"/account-billing-details", (context) => AccountBillingDetailsPage());
|
||||
|
||||
|
||||
@ -7,14 +7,14 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "40.0.0"
|
||||
version: "41.0.0"
|
||||
analyzer:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
version: "4.2.0"
|
||||
animate_do:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -154,7 +154,7 @@ packages:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
version: "1.0.5"
|
||||
device_info_plus:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -204,6 +204,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.6"
|
||||
eventify:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: eventify
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -346,7 +353,7 @@ packages:
|
||||
name: flutter_stripe
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.2.0"
|
||||
flutter_styled_toast:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -399,6 +406,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.8.5+1"
|
||||
fluttertoast:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fluttertoast
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.0.9"
|
||||
freezed_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -580,7 +594,7 @@ packages:
|
||||
name: math_expressions
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.3.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -608,14 +622,14 @@ packages:
|
||||
name: nylo_framework
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
version: "3.1.4"
|
||||
nylo_support:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nylo_support
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.2.0"
|
||||
octo_image:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -643,7 +657,7 @@ packages:
|
||||
name: page_transition
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.0.9"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -763,13 +777,20 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
pull_to_refresh:
|
||||
pull_to_refresh_flutter3:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: pull_to_refresh
|
||||
name: pull_to_refresh_flutter3
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.0.1"
|
||||
razorpay_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: razorpay_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
recase:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -900,21 +921,21 @@ packages:
|
||||
name: stripe_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.2.0"
|
||||
stripe_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stripe_ios
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.2.0"
|
||||
stripe_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stripe_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.2.0"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -963,7 +984,7 @@ packages:
|
||||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
version: "6.1.4"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -998,7 +1019,7 @@ packages:
|
||||
name: url_launcher_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.1.0"
|
||||
url_launcher_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1159,7 +1180,7 @@ packages:
|
||||
name: wp_json_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
version: "3.2.0"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# Official WooSignal App Template for WooCommerce
|
||||
|
||||
# Label StoreMax
|
||||
# Version: 6.0.0
|
||||
# Version: 6.1.0
|
||||
# Author: Anthony Gordon
|
||||
# Homepage: https://woosignal.com
|
||||
# Documentation: https://woosignal.com/docs/app/label-storemax
|
||||
@ -26,25 +26,26 @@ environment:
|
||||
|
||||
dependencies:
|
||||
google_fonts: ^2.3.3
|
||||
analyzer: ^4.1.0
|
||||
analyzer: ^4.2.0
|
||||
intl: ^0.17.0
|
||||
page_transition: ^2.0.5
|
||||
nylo_framework: ^3.1.3
|
||||
page_transition: ^2.0.9
|
||||
nylo_framework: ^3.1.4
|
||||
woosignal: ^3.1.0
|
||||
flutter_stripe: ^3.0.0
|
||||
wp_json_api: ^3.1.3
|
||||
flutter_stripe: ^3.2.0
|
||||
wp_json_api: ^3.2.0
|
||||
cached_network_image: ^3.2.1
|
||||
package_info: ^2.0.2
|
||||
money_formatter: ^0.0.3
|
||||
flutter_web_browser: ^0.17.1
|
||||
webview_flutter: ^3.0.4
|
||||
pull_to_refresh: 2.0.0
|
||||
url_launcher: ^6.1.2
|
||||
pull_to_refresh_flutter3: 2.0.1
|
||||
url_launcher: ^6.1.4
|
||||
flutter_styled_toast: ^2.1.3
|
||||
animate_do: ^2.1.0
|
||||
bubble_tab_indicator: ^0.1.5
|
||||
razorpay_flutter: ^1.3.0
|
||||
status_alert: ^1.0.0
|
||||
math_expressions: ^2.3.0
|
||||
math_expressions: ^2.3.1
|
||||
validated: ^2.0.0
|
||||
flutter_spinkit: ^5.1.0
|
||||
auto_size_text: ^3.0.0
|
||||
@ -62,7 +63,7 @@ dependencies:
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.4
|
||||
cupertino_icons: ^1.0.5
|
||||
collection: ^1.15.0-nullsafety.4
|
||||
|
||||
dev_dependencies:
|
||||
@ -78,9 +79,6 @@ flutter_icons:
|
||||
image_path: "public/assets/app_icon/appicon.png"
|
||||
remove_alpha_ios: true
|
||||
|
||||
dependency_overrides:
|
||||
intl: ^0.17.0
|
||||
|
||||
flutter:
|
||||
|
||||
# The following line ensures that the Material Icons font is
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
# WooCommerce App: Label StoreMax
|
||||
|
||||
### Label StoreMax - v6.0.0
|
||||
### Label StoreMax - v6.1.0
|
||||
|
||||
|
||||
[Official WooSignal WooCommerce App](https://woosignal.com)
|
||||
@ -45,7 +45,7 @@ Full documentation this available [here](https://woosignal.com/docs/app/ios/labe
|
||||
- Change app name, logo, customize default language, currency + more
|
||||
- Light and dark mode
|
||||
- Theme customization
|
||||
- Stripe, Cash On Delivery and PayPal
|
||||
- Stripe, Cash On Delivery, PayPal and RazorPay
|
||||
- Localized for en, es, pt, it, hi, fr, zh, tr, nl
|
||||
- Orders show as normal in WooCommerce
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user