From 877dabbb60fa51b86346774aef578321bd122813 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 11 Oct 2021 23:41:22 +0100 Subject: [PATCH] v5.2.0 --- LabelStoreMax/.env | 8 +- LabelStoreMax/CHANGELOG.md | 9 + LabelStoreMax/README.md | 4 +- LabelStoreMax/android/app/build.gradle | 18 +- .../com/woosignal/android/MainActivity.kt | 3 +- LabelStoreMax/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- LabelStoreMax/ios/Runner/Info.plist | 2 +- LabelStoreMax/lang/de.json | 3 +- LabelStoreMax/lang/en.json | 3 +- LabelStoreMax/lang/es.json | 3 +- LabelStoreMax/lang/fr.json | 3 +- LabelStoreMax/lang/hi.json | 3 +- LabelStoreMax/lang/it.json | 3 +- LabelStoreMax/lang/pt.json | 3 +- LabelStoreMax/lang/zh.json | 3 +- .../lib/app/providers/paypal_pay.dart | 2 +- .../lib/app/providers/razor_pay.dart | 88 -------- .../lib/app/providers/stripe_pay.dart | 166 +++++++------- LabelStoreMax/lib/bootstrap/app.dart | 115 +++++----- .../lib/config/app_payment_gateways.dart | 13 +- LabelStoreMax/lib/config/app_theme.dart | 73 +++---- LabelStoreMax/lib/main.dart | 23 +- .../pages/account_billing_details.dart | 19 +- .../lib/resources/pages/account_detail.dart | 14 +- .../lib/resources/pages/account_landing.dart | 32 +-- .../resources/pages/account_order_detail.dart | 12 +- .../lib/resources/pages/account_register.dart | 10 +- .../pages/account_shipping_details.dart | 19 +- .../lib/resources/pages/browse_category.dart | 4 +- .../lib/resources/pages/browse_search.dart | 4 +- LabelStoreMax/lib/resources/pages/cart.dart | 4 +- .../pages/checkout_confirmation.dart | 36 ++- .../lib/resources/pages/checkout_details.dart | 13 +- .../pages/checkout_payment_type.dart | 36 ++- .../pages/checkout_shipping_type.dart | 16 +- .../lib/resources/pages/checkout_status.dart | 8 +- .../resources/pages/customer_countries.dart | 4 +- .../lib/resources/pages/home_search.dart | 1 - .../lib/resources/pages/product_detail.dart | 18 +- .../lib/resources/themes/dark_theme.dart | 199 +++++++++-------- .../lib/resources/themes/default_theme.dart | 111 ---------- .../lib/resources/themes/light_theme.dart | 121 ++++++++++ .../themes/styles/dark_theme_colors.dart | 38 ++++ .../themes/styles/light_theme_colors.dart | 37 ++++ .../resources/themes/styles/theme_styles.dart | 33 +++ .../themes/text_theme/default_text_theme.dart | 55 +++++ .../resources/widgets/app_loader_widget.dart | 7 +- .../resources/widgets/app_version_widget.dart | 2 +- .../lib/resources/widgets/buttons.dart | 2 +- .../widgets/cached_image_widget.dart | 1 + .../resources/widgets/cart_icon_widget.dart | 2 +- .../resources/widgets/checkout_paypal.dart | 75 ++++--- .../resources/widgets/home_drawer_widget.dart | 46 ++-- .../resources/widgets/notic_home_widget.dart | 1 + .../resources/widgets/notic_theme_widget.dart | 2 +- .../lib/resources/widgets/top_nav_widget.dart | 2 +- .../lib/resources/widgets/woosignal_ui.dart | 26 ++- LabelStoreMax/lib/routes/router.dart | 2 +- LabelStoreMax/pubspec.lock | 206 +++++++++++------- LabelStoreMax/pubspec.yaml | 28 +-- README.md | 4 +- 63 files changed, 944 insertions(+), 862 deletions(-) delete mode 100644 LabelStoreMax/lib/app/providers/razor_pay.dart delete mode 100644 LabelStoreMax/lib/resources/themes/default_theme.dart create mode 100644 LabelStoreMax/lib/resources/themes/light_theme.dart create mode 100644 LabelStoreMax/lib/resources/themes/styles/dark_theme_colors.dart create mode 100644 LabelStoreMax/lib/resources/themes/styles/light_theme_colors.dart create mode 100644 LabelStoreMax/lib/resources/themes/styles/theme_styles.dart create mode 100644 LabelStoreMax/lib/resources/themes/text_theme/default_text_theme.dart diff --git a/LabelStoreMax/.env b/LabelStoreMax/.env index cb9ba47..dc68393 100644 --- a/LabelStoreMax/.env +++ b/LabelStoreMax/.env @@ -23,14 +23,12 @@ APP_KEY="your app key" STRIPE_ACCOUNT="Stripe account key from WooSignal" # Stripe account key from WooSignal https://woosignal.com/dashboard +STRIPE_COUNTRY_CODE="GB" +# Alpha-2 country code list: https://www.iban.com/country-codes + STRIPE_LIVE_MODE=null # Change to 'true' for live payments and update the "Environment for Stripe" here https://woosignal.com/dashboard -# ** - -RAZORPAY_ID="" -# Razorpay ID from https://razorpay.com - # ** PAYPAL_ACCOUNT_EMAIL="mystore@business.com" diff --git a/LabelStoreMax/CHANGELOG.md b/LabelStoreMax/CHANGELOG.md index 401ee70..55af273 100644 --- a/LabelStoreMax/CHANGELOG.md +++ b/LabelStoreMax/CHANGELOG.md @@ -1,3 +1,12 @@ +## [5.2.0] - 2020-10-11 + +* Migrate to Nylo 2.1.0 +* Use flutter_stripe library for payments +* Remove RazorPay for build fails +* Pubspec.yaml dependency updates +* Android compileSdkVersion 30 +* Bug fixes + ## [5.1.0] - 2020-07-19 * Add support for simplified Chinese locale (zh) diff --git a/LabelStoreMax/README.md b/LabelStoreMax/README.md index bdbfa77..f096f5e 100644 --- a/LabelStoreMax/README.md +++ b/LabelStoreMax/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v5.1.0 +### Label StoreMax - v5.2.0 [Official WooSignal WooCommerce App](https://woosignal.com) @@ -44,7 +44,7 @@ Full documentation this available [here](https://woosignal.com/docs/app/ios/labe - 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, RazorPay, PayPal +- Stripe, Cash On Delivery, PayPal - Localized for en, es, pt, it, hi, fr, zh - Orders show as normal in WooCommerce diff --git a/LabelStoreMax/android/app/build.gradle b/LabelStoreMax/android/app/build.gradle index 3ff0139..7adc310 100644 --- a/LabelStoreMax/android/app/build.gradle +++ b/LabelStoreMax/android/app/build.gradle @@ -26,7 +26,19 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + packagingOptions { + exclude 'META-INF/DEPENDENCIES' + exclude 'META-INF/LICENSE' + exclude 'META-INF/LICENSE.txt' + exclude 'META-INF/license.txt' + exclude 'META-INF/NOTICE' + exclude 'META-INF/NOTICE.txt' + exclude 'META-INF/notice.txt' + exclude 'META-INF/ASL2.0' + exclude("META-INF/*.kotlin_module") + } + + compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -39,8 +51,8 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.woosignal.android" - minSdkVersion 19 - targetSdkVersion 29 + minSdkVersion 21 + targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true diff --git a/LabelStoreMax/android/app/src/main/kotlin/com/woosignal/android/MainActivity.kt b/LabelStoreMax/android/app/src/main/kotlin/com/woosignal/android/MainActivity.kt index 20500a3..9691152 100644 --- a/LabelStoreMax/android/app/src/main/kotlin/com/woosignal/android/MainActivity.kt +++ b/LabelStoreMax/android/app/src/main/kotlin/com/woosignal/android/MainActivity.kt @@ -1,6 +1,7 @@ package com.woosignal.android import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.android.FlutterFragmentActivity -class MainActivity: FlutterActivity() { +class MainActivity: FlutterFragmentActivity() { } diff --git a/LabelStoreMax/android/build.gradle b/LabelStoreMax/android/build.gradle index 3100ad2..0b891c9 100644 --- a/LabelStoreMax/android/build.gradle +++ b/LabelStoreMax/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.5.0' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:4.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/LabelStoreMax/android/gradle/wrapper/gradle-wrapper.properties b/LabelStoreMax/android/gradle/wrapper/gradle-wrapper.properties index 296b146..bc6a58a 100644 --- a/LabelStoreMax/android/gradle/wrapper/gradle-wrapper.properties +++ b/LabelStoreMax/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist b/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist index 6b4c0f7..f2872cf 100644 --- a/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist +++ b/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 8.0 + 9.0 diff --git a/LabelStoreMax/ios/Runner/Info.plist b/LabelStoreMax/ios/Runner/Info.plist index 8dd22ee..8707779 100644 --- a/LabelStoreMax/ios/Runner/Info.plist +++ b/LabelStoreMax/ios/Runner/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString $(FLUTTER_BUILD_NAME) NSCameraUsageDescription - $(PRODUCT_NAME) photo use + You can take photos of your payment details. CFBundleSignature ???? MinimumOSVersion diff --git a/LabelStoreMax/lang/de.json b/LabelStoreMax/lang/de.json index ad7b08c..8612163 100644 --- a/LabelStoreMax/lang/de.json +++ b/LabelStoreMax/lang/de.json @@ -184,5 +184,6 @@ "Payment Cancelled": "Zahlung storniert", "The payment has been cancelled": "Die Zahlung wurde storniert", "Must have": "Haben müssen", - "Our selection of new items": "Unsere Auswahl an Neuheiten" + "Our selection of new items": "Unsere Auswahl an Neuheiten", + "Register": "Registrieren" } \ No newline at end of file diff --git a/LabelStoreMax/lang/en.json b/LabelStoreMax/lang/en.json index c4a646b..79a77da 100644 --- a/LabelStoreMax/lang/en.json +++ b/LabelStoreMax/lang/en.json @@ -184,5 +184,6 @@ "Payment Cancelled": "Payment Cancelled", "The payment has been cancelled": "The payment has been cancelled", "Must have": "Must have", - "Our selection of new items": "Our selection of new items" + "Our selection of new items": "Our selection of new items", + "Register": "Register" } \ No newline at end of file diff --git a/LabelStoreMax/lang/es.json b/LabelStoreMax/lang/es.json index ed9c20e..11fff15 100644 --- a/LabelStoreMax/lang/es.json +++ b/LabelStoreMax/lang/es.json @@ -184,5 +184,6 @@ "Payment Cancelled": "Pago cancelado", "The payment has been cancelled": "El pago ha sido cancelado", "Must have": "Debe tener", - "Our selection of new items": "Nuestra selección de novedades" + "Our selection of new items": "Nuestra selección de novedades", + "Register": "Registrarse" } \ No newline at end of file diff --git a/LabelStoreMax/lang/fr.json b/LabelStoreMax/lang/fr.json index d4f552a..e64e1e7 100644 --- a/LabelStoreMax/lang/fr.json +++ b/LabelStoreMax/lang/fr.json @@ -184,5 +184,6 @@ "Payment Cancelled": "Paiement annulé", "The payment has been cancelled": "Le paiement a été annulé", "Must have": "Doit avoir", - "Our selection of new items": "Notre sélection de nouveautés" + "Our selection of new items": "Notre sélection de nouveautés", + "Register": "S'inscrire" } \ No newline at end of file diff --git a/LabelStoreMax/lang/hi.json b/LabelStoreMax/lang/hi.json index 929d10a..95f91d3 100644 --- a/LabelStoreMax/lang/hi.json +++ b/LabelStoreMax/lang/hi.json @@ -184,5 +184,6 @@ "Payment Cancelled": "bhugataan radd kiya gaya", "The payment has been cancelled": "bhugataan radd kar diya gaya hai", "Must have": "hona aavashyak hai", - "Our selection of new items": "naee vastuon ka hamaara chayan" + "Our selection of new items": "naee vastuon ka hamaara chayan", + "Register": "rajistar karen" } \ No newline at end of file diff --git a/LabelStoreMax/lang/it.json b/LabelStoreMax/lang/it.json index e1be4bb..317bfc1 100644 --- a/LabelStoreMax/lang/it.json +++ b/LabelStoreMax/lang/it.json @@ -184,5 +184,6 @@ "Payment Cancelled": "Pagamento annullato", "The payment has been cancelled": "Il pagamento è stato annullato", "Must have": "Deve avere", - "Our selection of new items": "La nostra selezione di nuovi articoli" + "Our selection of new items": "La nostra selezione di nuovi articoli", + "Register": "Registrati" } \ No newline at end of file diff --git a/LabelStoreMax/lang/pt.json b/LabelStoreMax/lang/pt.json index 877f449..ba1ef19 100644 --- a/LabelStoreMax/lang/pt.json +++ b/LabelStoreMax/lang/pt.json @@ -184,5 +184,6 @@ "Payment Cancelled": "Pagamento Cancelado", "The payment has been cancelled": "O pagamento foi cancelado", "Must have": "Deve ter", - "Our selection of new items": "Nossa seleção de novos itens" + "Our selection of new items": "Nossa seleção de novos itens", + "Register": "Registro" } \ No newline at end of file diff --git a/LabelStoreMax/lang/zh.json b/LabelStoreMax/lang/zh.json index 41d20db..bdb70f5 100644 --- a/LabelStoreMax/lang/zh.json +++ b/LabelStoreMax/lang/zh.json @@ -184,5 +184,6 @@ "Payment Cancelled": "付款已取消", "The payment has been cancelled": "付款已取消", "Must have": "一定有", - "Our selection of new items": "我们精选的新品" + "Our selection of new items": "我们精选的新品", + "Register": "登记" } \ No newline at end of file diff --git a/LabelStoreMax/lib/app/providers/paypal_pay.dart b/LabelStoreMax/lib/app/providers/paypal_pay.dart index 56bb01f..a237ffa 100644 --- a/LabelStoreMax/lib/app/providers/paypal_pay.dart +++ b/LabelStoreMax/lib/app/providers/paypal_pay.dart @@ -46,7 +46,7 @@ payPalPay(context, state.reloadState(showLoader: false); return; } - +print(value); state.reloadState(showLoader: true); if (value.containsKey("status") && value["status"] == "success") { OrderWC orderWC = diff --git a/LabelStoreMax/lib/app/providers/razor_pay.dart b/LabelStoreMax/lib/app/providers/razor_pay.dart deleted file mode 100644 index 02b71b8..0000000 --- a/LabelStoreMax/lib/app/providers/razor_pay.dart +++ /dev/null @@ -1,88 +0,0 @@ -// -// LabelCore -// Label StoreMax -// -// Created by Anthony Gordon. -// 2021, 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/bootstrap/app_helper.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_support/helpers/helper.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) { - razorPay.clear(); - Navigator.pushNamed(context, "/checkout-status", arguments: order); - } else { - showToastNotification(context, - title: trans(context, "Error"), - description: trans(context, "Something went wrong, please contact our store"), - style: ToastNotificationStyleType.WARNING); - razorPay.clear(); - state.reloadState(showLoader: false); - } - }); - - razorPay.on(Razorpay.EVENT_PAYMENT_ERROR, (PaymentFailureResponse response) { - showToastNotification(context, - title: trans(context, "Error"), - description: response.message, - style: ToastNotificationStyleType.WARNING); - razorPay.clear(); - state.reloadState(showLoader: false); - }); - - razorPay.on(Razorpay.EVENT_EXTERNAL_WALLET, - (ExternalWalletResponse response) { - showToastNotification(context, - title: trans(context, "Error"), - description: trans(context, "Not supported, try a card payment"), - style: ToastNotificationStyleType.WARNING); - razorPay.clear(); - state.reloadState(showLoader: false); - }); - - // CHECKOUT HELPER - await checkout(taxRate, (total, billingDetails, cart) async { - var options = { - 'key': getEnv('RAZORPAY_ID'), - 'amount': (parseWcPrice(total) * 100).toInt(), - 'name': AppHelper.instance.appConfig.appName, - '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); - }); -} diff --git a/LabelStoreMax/lib/app/providers/stripe_pay.dart b/LabelStoreMax/lib/app/providers/stripe_pay.dart index f19db8d..d2ad5b3 100644 --- a/LabelStoreMax/lib/app/providers/stripe_pay.dart +++ b/LabelStoreMax/lib/app/providers/stripe_pay.dart @@ -17,103 +17,105 @@ import 'package:flutter_app/bootstrap/app_helper.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:flutter_stripe/flutter_stripe.dart'; +import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_support/helpers/helper.dart'; import 'package:woosignal/models/payload/order_wc.dart'; import 'package:woosignal/models/response/order.dart'; import 'package:woosignal/models/response/tax_rate.dart'; import 'package:woosignal/models/response/woosignal_app.dart'; -import 'package:woosignal_stripe/woosignal_stripe.dart'; stripePay(context, {@required CheckoutConfirmationPageState state, TaxRate taxRate}) async { + WooSignalApp wooSignalApp = AppHelper.instance.appConfig; + + bool liveMode = getEnv('STRIPE_LIVE_MODE') == null + ? !wooSignalApp.stripeLiveMode + : getEnv('STRIPE_LIVE_MODE', defaultValue: false); + + // CONFIGURE STRIPE + Stripe.stripeAccountId = getEnv('STRIPE_ACCOUNT'); + Stripe.publishableKey = liveMode ? "pk_live_IyS4Vt86L49jITSfaUShumzi" : "pk_test_0jMmpBntJ6UkizPkfiB8ZJxH"; // Don't change this value + try { - WooSignalApp wooSignalApp = AppHelper.instance.appConfig; - bool liveMode = getEnv('STRIPE_LIVE_MODE') == null - ? wooSignalApp.stripeLiveMode - : getEnv('STRIPE_LIVE_MODE', defaultValue: false); + dynamic rsp = {}; + // // CHECKOUT HELPER + await checkout(taxRate, (total, billingDetails, cart) async { + Map address = { + "name": billingDetails.billingAddress.nameFull(), + "line1": billingDetails.shippingAddress.addressLine, + "city": billingDetails.shippingAddress.city, + "postal_code": billingDetails.shippingAddress.postalCode, + "country": + (billingDetails.shippingAddress?.customerCountry?.name ?? "") + }; - // CONFIGURE STRIPE - FlutterStripePayment.setStripeSettings( - stripeAccount: getEnv('STRIPE_ACCOUNT'), liveMode: liveMode); + String cartShortDesc = await cart.cartShortDesc(); - PaymentResponse paymentResponse = - await FlutterStripePayment.addPaymentMethod(); + rsp = await appWooSignal((api) => + api.stripePaymentIntent( + amount: total, + email: billingDetails.billingAddress.emailAddress, + desc: cartShortDesc, + shipping: address, + )); + }); - // CHECK STATUS FROM STRIPE - if (paymentResponse.status == PaymentResponseStatus.succeeded) { - state.reloadState(showLoader: true); - - // CHECKOUT HELPER - await checkout(taxRate, (total, billingDetails, cart) async { - Map address = { - "name": billingDetails.billingAddress.nameFull(), - "line1": billingDetails.shippingAddress.addressLine, - "city": billingDetails.shippingAddress.city, - "postal_code": billingDetails.shippingAddress.postalCode, - "country": - (billingDetails.shippingAddress?.customerCountry?.name ?? "") - }; - - String cartShortDesc = await cart.cartShortDesc(); - - dynamic rsp = await appWooSignal((api) => api.stripePaymentIntent( - amount: total, - email: billingDetails.billingAddress.emailAddress, - desc: cartShortDesc, - shipping: address, - )); - - if (rsp == null) { - showToastNotification(context, - title: trans(context, "Oops!"), - description: - trans(context, "Something went wrong, please try again."), - icon: Icons.payment, - style: ToastNotificationStyleType.WARNING); - state.reloadState(showLoader: false); - return; - } - - String clientSecret = rsp["client_secret"]; - var intentResponse = await FlutterStripePayment.confirmPaymentIntent( - clientSecret, - paymentResponse.paymentMethodId, - (double.parse(total) * 100), - ); - - if (intentResponse.status == PaymentResponseStatus.succeeded) { - OrderWC orderWC = await buildOrderWC(taxRate: taxRate); - Order order = await appWooSignal((api) => api.createOrder(orderWC)); - - if (order != null) { - Navigator.pushNamed(context, "/checkout-status", arguments: order); - } else { - showToastNotification( - context, - title: trans(context, "Error"), - description: trans(context, - "Something went wrong, please contact our store"), - ); - state.reloadState(showLoader: false); - } - } else if (intentResponse.status == PaymentResponseStatus.failed) { - if (getEnv('APP_DEBUG', defaultValue: true)) { - NyLogger.error(intentResponse.errorMessage); - } - showToastNotification( - context, - title: trans(context, "Error"), - description: intentResponse.errorMessage, - ); - state.reloadState(showLoader: false); - } else { - state.reloadState(showLoader: false); - } - }); - } else { + if (rsp == null) { + showToastNotification(context, + title: trans(context, "Oops!"), + description: + trans(context, "Something went wrong, please try again."), + icon: Icons.payment, + style: ToastNotificationStyleType.WARNING); state.reloadState(showLoader: false); + return; } + + Stripe.instance.initPaymentSheet(paymentSheetParameters: SetupPaymentSheetParameters( + applePay: false, + googlePay: false, + style: Theme.of(state.context).brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark, + testEnv: liveMode, + merchantCountryCode: getEnv('STRIPE_COUNTRY_CODE', defaultValue: 'GB'), + merchantDisplayName: getEnv('APP_NAME'), + paymentIntentClientSecret: rsp['client_secret'], + )); + + await Stripe.instance.presentPaymentSheet(); + + state.reloadState(showLoader: true); + + OrderWC orderWC = await buildOrderWC(taxRate: taxRate); + Order order = await appWooSignal((api) => api.createOrder(orderWC)); + + if (order == null) { + showToastNotification( + context, + title: trans(context, "Error"), + description: trans(context, + "Something went wrong, please contact our store"), + ); + state.reloadState(showLoader: false); + return; + } + + Navigator.pushNamed(context, "/checkout-status", arguments: order); + + } + on StripeException catch(e) { + showToastNotification( + context, + title: trans(context, "Oops!"), + description: e.error.localizedMessage, + icon: Icons.payment, + style: ToastNotificationStyleType.WARNING, + ); + state.reloadState(showLoader: false); } catch (ex) { + if (getEnv('APP_DEBUG', defaultValue: true)) { + NyLogger.error(ex.toString()); + } showToastNotification( context, title: trans(context, "Oops!"), diff --git a/LabelStoreMax/lib/bootstrap/app.dart b/LabelStoreMax/lib/bootstrap/app.dart index b6242ea..5adcd26 100644 --- a/LabelStoreMax/lib/bootstrap/app.dart +++ b/LabelStoreMax/lib/bootstrap/app.dart @@ -1,25 +1,13 @@ -// Label StoreMax -// -// Created by Anthony Gordon. -// 2021, 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:adaptive_theme/adaptive_theme.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:nylo_support/localization/app_localization.dart'; +import 'package:nylo_framework/nylo_framework.dart'; // ignore: must_be_immutable class AppBuild extends StatelessWidget { - final String initialRoute; - Brightness defaultBrightness; + String initialRoute; ThemeData themeData; ThemeData darkTheme; + ThemeData lightTheme; Locale locale; String title; bool debugShowCheckedModeBanner; @@ -40,16 +28,15 @@ class AppBuild extends StatelessWidget { InitialRouteListFactory onGenerateInitialRoutes; GlobalKey navigatorKey; - final Route Function(RouteSettings settings) onGenerateRoute; + Route Function(RouteSettings settings) onGenerateRoute; AppBuild({ Key key, this.initialRoute, this.title, - this.defaultBrightness, - this.locale, + @required this.locale, this.themeData, - this.onGenerateRoute, + @required this.onGenerateRoute, this.navigatorKey, this.onGenerateInitialRoutes, this.onUnknownRoute, @@ -57,6 +44,7 @@ class AppBuild extends StatelessWidget { this.builder, this.onGenerateTitle, this.color, + this.lightTheme, this.darkTheme, this.themeMode = ThemeMode.system, this.supportedLocales = const [Locale('en', 'US')], @@ -72,45 +60,56 @@ class AppBuild extends StatelessWidget { @override Widget build(BuildContext context) { - return AdaptiveTheme( - light: themeData, - dark: darkTheme, - initial: AdaptiveThemeMode.light, - builder: (theme, darkTheme) => ValueListenableBuilder( - valueListenable: ValueNotifier(locale), - builder: (context, Locale locale, _) => MaterialApp( - navigatorKey: navigatorKey, - themeMode: themeMode, - onGenerateTitle: onGenerateTitle, - onGenerateInitialRoutes: onGenerateInitialRoutes, - onUnknownRoute: onUnknownRoute, - builder: builder, - navigatorObservers: navigatorObservers, - color: color, - supportedLocales: supportedLocales, - debugShowMaterialGrid: debugShowMaterialGrid, - showPerformanceOverlay: showPerformanceOverlay, - checkerboardRasterCacheImages: checkerboardRasterCacheImages, - checkerboardOffscreenLayers: checkerboardOffscreenLayers, - showSemanticsDebugger: showSemanticsDebugger, - debugShowCheckedModeBanner: debugShowCheckedModeBanner, - shortcuts: shortcuts, - actions: actions, - title: title ?? "", - darkTheme: darkTheme, - initialRoute: initialRoute, - onGenerateRoute: this.onGenerateRoute, - locale: locale, - theme: theme, - localizationsDelegates: [ - AppLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalMaterialLocalizations.delegate - ], - localeResolutionCallback: - (Locale locale, Iterable supportedLocales) { - return locale; - }, + return ThemeProvider( + themes: [ + AppTheme( + id: "default_light_theme", + data: this.lightTheme ?? ThemeData.fallback(), + description: 'Light theme'), + AppTheme( + id: "default_dark_theme", + data: this.darkTheme ?? ThemeData.fallback(), + description: 'Dark theme'), + ], + child: ThemeConsumer( + child: Builder( + builder: (themeContext) => ValueListenableBuilder( + valueListenable: ValueNotifier(locale), + builder: (context, Locale locale, _) => MaterialApp( + navigatorKey: navigatorKey, + themeMode: themeMode, + onGenerateTitle: onGenerateTitle, + onGenerateInitialRoutes: onGenerateInitialRoutes, + onUnknownRoute: onUnknownRoute, + builder: builder, + navigatorObservers: navigatorObservers, + color: color, + supportedLocales: supportedLocales, + debugShowMaterialGrid: debugShowMaterialGrid, + showPerformanceOverlay: showPerformanceOverlay, + checkerboardRasterCacheImages: checkerboardRasterCacheImages, + checkerboardOffscreenLayers: checkerboardOffscreenLayers, + showSemanticsDebugger: showSemanticsDebugger, + debugShowCheckedModeBanner: debugShowCheckedModeBanner, + shortcuts: shortcuts, + actions: actions, + title: title ?? "", + darkTheme: darkTheme, + initialRoute: initialRoute, + onGenerateRoute: this.onGenerateRoute, + locale: locale, + theme: themeData ?? ThemeProvider.themeOf(themeContext).data, + localizationsDelegates: [ + AppLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalMaterialLocalizations.delegate + ], + localeResolutionCallback: + (Locale locale, Iterable supportedLocales) { + return locale; + }, + ), + ), ), ), ); diff --git a/LabelStoreMax/lib/config/app_payment_gateways.dart b/LabelStoreMax/lib/config/app_payment_gateways.dart index c926995..146f328 100644 --- a/LabelStoreMax/lib/config/app_payment_gateways.dart +++ b/LabelStoreMax/lib/config/app_payment_gateways.dart @@ -1,7 +1,6 @@ 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/razor_pay.dart'; import 'package:flutter_app/app/providers/stripe_pay.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; @@ -14,8 +13,8 @@ import 'package:flutter_app/bootstrap/helpers.dart'; |-------------------------------------------------------------------------- */ -const app_payment_gateways = ["Stripe"]; -// Available: "Stripe", "CashOnDelivery", "RazorPay", "PayPal" +const app_payment_gateways = ["Stripe", "CashOnDelivery", "PayPal"]; +// Available: "Stripe", "CashOnDelivery", "PayPal" // e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery. List paymentTypeList = [ @@ -35,14 +34,6 @@ List paymentTypeList = [ pay: cashOnDeliveryPay, ), - addPayment( - id: 3, - name: "RazorPay", - desc: "Debit or Credit Card", - assetImage: "razorpay.png", - pay: razorPay, - ), - addPayment( id: 4, name: "PayPal", diff --git a/LabelStoreMax/lib/config/app_theme.dart b/LabelStoreMax/lib/config/app_theme.dart index 7341c78..8340c67 100644 --- a/LabelStoreMax/lib/config/app_theme.dart +++ b/LabelStoreMax/lib/config/app_theme.dart @@ -1,62 +1,43 @@ import 'package:flutter/material.dart'; +import 'package:flutter_app/resources/themes/styles/dark_theme_colors.dart'; +import 'package:flutter_app/resources/themes/styles/light_theme_colors.dart'; +import 'package:flutter_app/resources/themes/styles/theme_styles.dart'; import 'package:google_fonts/google_fonts.dart'; /* |-------------------------------------------------------------------------- -| APP THEME +| Theme Font | -| Change the font and colors for your themes. +| Uses Google Fonts - https://pub.dev/packages/google_fonts +| +| e.g. updating the font from "montserrat" to "lato" +| before: final TextStyle appThemeFont = GoogleFonts.montserrat(); +| after: final TextStyle appThemeFont = GoogleFonts.lato(); |-------------------------------------------------------------------------- */ -// Theme main font final TextStyle appThemeFont = GoogleFonts.overpass(); -// Theme colors -class AppColors { - // MAIN - Color _mainLightColor = Color(0xFF232c33); - Color _mainDarkColor = Color(0xFFFAFAFA); +// e.g. custom font in pubspec.yaml - https://flutter.dev/docs/cookbook/design/fonts +// final TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo"); - // SECONDARY - Color _secondLightColor = Color(0xFF232c33); - Color _secondDarkColor = Color(0xFFF1F1F1); +/* +|-------------------------------------------------------------------------- +| Theme Colors +| +| Customize your theme's light and dark themes: /lib/config/styles/ +|-------------------------------------------------------------------------- +*/ - // ACCENT - Color _accentLightColor = Color(0xFF465f81); - Color _accentDarkColor = Color(0xFF4a4a4a); +class NyColors { + // Light Colors + static LightThemeColors light = LightThemeColors(); - // SCAFFOLD - Color _scaffoldDarkColor = Color(0xFF2C2C2C); - Color _scaffoldLightColor = Color(0xFFFAFAFA); -} + // Dark Colors + static DarkThemeColors dark = DarkThemeColors(); -class AppTheme extends AppColors { - Color mainColor( - {double opacity = 1, Brightness brightness = Brightness.light}) { - return (brightness == Brightness.light - ? _mainLightColor.withOpacity(opacity) - : _mainDarkColor.withOpacity(opacity)); + /// helper to find correct theme from the [context]. + static BaseStyles of(BuildContext context) { + return ((Theme.of(context).brightness == Brightness.dark) ? dark : light); } - - Color secondColor( - {double opacity = 1, Brightness brightness = Brightness.light}) { - return (brightness == Brightness.light - ? _secondLightColor.withOpacity(opacity) - : _secondDarkColor.withOpacity(opacity)); - } - - Color accentColor( - {double opacity = 1, Brightness brightness = Brightness.light}) { - return (brightness == Brightness.light - ? _accentLightColor.withOpacity(opacity) - : _accentDarkColor.withOpacity(opacity)); - } - - Color scaffoldColor( - {double opacity = 1, Brightness brightness = Brightness.light}) { - return (brightness == Brightness.light - ? _scaffoldLightColor.withOpacity(opacity) - : _scaffoldDarkColor.withOpacity(opacity)); - } -} +} \ No newline at end of file diff --git a/LabelStoreMax/lib/main.dart b/LabelStoreMax/lib/main.dart index 92c7096..b394c8a 100644 --- a/LabelStoreMax/lib/main.dart +++ b/LabelStoreMax/lib/main.dart @@ -5,22 +5,17 @@ import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/config/app_locale.dart'; import 'package:flutter_app/resources/themes/dark_theme.dart'; -import 'package:flutter_app/resources/themes/default_theme.dart'; -import 'package:flutter_app/config/app_theme.dart'; +import 'package:flutter_app/resources/themes/light_theme.dart'; import 'package:flutter_app/routes/router.dart'; import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/nylo.dart'; import 'package:nylo_framework/nylo_framework.dart'; -import 'package:nylo_framework/theme/helper/theme_helper.dart'; import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:wp_json_api/wp_json_api.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - AppTheme appTheme = AppTheme(); - - Nylo nylo = - await initNylo(theme: defaultTheme(appTheme), router: buildRouter()); + Nylo nylo = await Nylo.init(router: appRouter()); await SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, @@ -43,12 +38,10 @@ void main() async { ); } - if (locale == null) { - if (wooSignalApp.locale != null) { - locale = Locale(wooSignalApp.locale); - } else { - locale = Locale(getEnv('DEFAULT_LOCALE', defaultValue: 'en')); - } + if (locale == null && wooSignalApp.locale != null) { + locale = Locale(wooSignalApp.locale); + } else { + locale = Locale(getEnv('DEFAULT_LOCALE', defaultValue: 'en')); } } @@ -56,8 +49,8 @@ void main() async { AppBuild( navigatorKey: nylo.router.navigatorKey, onGenerateRoute: nylo.router.generator(), - themeData: CurrentTheme.instance.theme, - darkTheme: darkTheme(appTheme), + lightTheme: lightTheme(), + darkTheme: darkTheme(), locale: locale, initialRoute: initialRoute, supportedLocales: app_locales_supported, diff --git a/LabelStoreMax/lib/resources/pages/account_billing_details.dart b/LabelStoreMax/lib/resources/pages/account_billing_details.dart index 98bd2e4..bea7861 100644 --- a/LabelStoreMax/lib/resources/pages/account_billing_details.dart +++ b/LabelStoreMax/lib/resources/pages/account_billing_details.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; @@ -33,8 +33,6 @@ class AccountBillingDetailsPage extends StatefulWidget { class _AccountBillingDetailsPageState extends State { _AccountBillingDetailsPageState(); - AppTheme _appTheme = AppTheme(); - // BILLING TEXT CONTROLLERS TextEditingController _txtShippingFirstName = TextEditingController(), _txtShippingLastName = TextEditingController(), @@ -75,14 +73,12 @@ class _AccountBillingDetailsPageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; + return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( - trans(context, "Billing Details"), - style: Theme.of(context).textTheme.headline6, + trans(context, "Billing Details") ), centerTitle: true, ), @@ -165,13 +161,12 @@ class _AccountBillingDetailsPageState extends State { ], ), decoration: BoxDecoration( - color: adaptiveTheme.isLight - ? Colors.white - : _appTheme.accentColor( - brightness: Brightness.dark), + color: (Theme.of(context).brightness == Brightness.light) + ? NyColors.light.background + : NyColors.dark.primaryAccent, borderRadius: BorderRadius.circular(10), boxShadow: - adaptiveTheme.isLight ? wsBoxShadow() : null, + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, ), padding: EdgeInsets.all(8), ), diff --git a/LabelStoreMax/lib/resources/pages/account_detail.dart b/LabelStoreMax/lib/resources/pages/account_detail.dart index 5f7debd..bc997e2 100644 --- a/LabelStoreMax/lib/resources/pages/account_detail.dart +++ b/LabelStoreMax/lib/resources/pages/account_detail.dart @@ -8,12 +8,13 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:bubble_tab_indicator/bubble_tab_indicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart'; +import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/resources/widgets/app_loader_widget.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -100,10 +101,9 @@ class _AccountDetailPageState extends State new Tab(text: trans(context, "Orders")), new Tab(text: trans(context, "Settings")), ]; - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; + return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, leading: widget.showLeadingBackButton ? Container( child: IconButton( icon: Icon(Icons.arrow_back_ios), @@ -112,8 +112,7 @@ class _AccountDetailPageState extends State margin: EdgeInsets.only(left: 0), ) : Container(), title: Text( - trans(context, "Account"), - style: Theme.of(context).textTheme.headline6, + trans(context, "Account") ), centerTitle: true, ), @@ -206,9 +205,8 @@ class _AccountDetailPageState extends State ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - boxShadow: adaptiveTheme.isLight ? wsBoxShadow() : null, - color: - adaptiveTheme.isLight ? Colors.white : Colors.white70, + boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, + color: NyColors.of(context).backgroundContainer, ), ), Expanded(child: _activeBody), diff --git a/LabelStoreMax/lib/resources/pages/account_landing.dart b/LabelStoreMax/lib/resources/pages/account_landing.dart index 06cedcc..46dbe57 100644 --- a/LabelStoreMax/lib/resources/pages/account_landing.dart +++ b/LabelStoreMax/lib/resources/pages/account_landing.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_app/app/models/user.dart'; @@ -27,7 +27,8 @@ import 'package:wp_json_api/models/responses/wp_user_login_response.dart'; import 'package:wp_json_api/wp_json_api.dart'; class AccountLandingPage extends StatefulWidget { - AccountLandingPage(); + final bool showBackButton; + AccountLandingPage({this.showBackButton = true}); @override _AccountLandingPageState createState() => _AccountLandingPageState(); @@ -37,7 +38,6 @@ class _AccountLandingPageState extends State { bool _hasTappedLogin = false; TextEditingController _tfEmailController = TextEditingController(), _tfPasswordController = TextEditingController(); - AppTheme _appTheme = AppTheme(); @override void initState() { @@ -46,7 +46,6 @@ class _AccountLandingPageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; return Scaffold( resizeToAvoidBottomInset: false, body: SafeArea( @@ -79,10 +78,8 @@ class _AccountLandingPageState extends State { Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), - boxShadow: adaptiveTheme.isLight ? wsBoxShadow() : null, - color: adaptiveTheme.isLight - ? Colors.white - : _appTheme.accentColor(brightness: Brightness.dark), + boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, + color: NyColors.of(context).backgroundContainer, ), padding: EdgeInsets.symmetric(vertical: 18, horizontal: 8), margin: EdgeInsets.symmetric(horizontal: 16), @@ -117,7 +114,7 @@ class _AccountLandingPageState extends State { Icon( Icons.account_circle, color: - adaptiveTheme.isLight ? Colors.black38 : Colors.white70, + (Theme.of(context).brightness == Brightness.light) ? Colors.black38 : Colors.white70, ), Padding( child: Text( @@ -143,12 +140,17 @@ class _AccountLandingPageState extends State { "No URL found for \"forgot password\".\nAdd your forgot password URL here https://woosignal.com/dashboard/apps"); } }), - Divider(), - LinkButton( - title: trans(context, "Back"), - action: () => Navigator.pop(context), - ), - ], + widget.showBackButton ? Column( + children: [ + Divider(), + LinkButton( + title: trans(context, "Back"), + action: () => Navigator.pop(context), + ), + ], + ) : Padding(padding: EdgeInsets.only(bottom: 20),) + + ].where((element) => element != null).toList(), ), ), ); diff --git a/LabelStoreMax/lib/resources/pages/account_order_detail.dart b/LabelStoreMax/lib/resources/pages/account_order_detail.dart index f535835..a2c5f25 100644 --- a/LabelStoreMax/lib/resources/pages/account_order_detail.dart +++ b/LabelStoreMax/lib/resources/pages/account_order_detail.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_app/app/controllers/account_order_detail_controller.dart'; @@ -44,10 +44,9 @@ class _AccountOrderDetailPageState extends NyState { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; + return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, leading: Container( child: IconButton( icon: Icon(Icons.arrow_back_ios), @@ -56,8 +55,7 @@ class _AccountOrderDetailPageState extends NyState { margin: EdgeInsets.only(left: 0), ), title: Text( - "${trans(context, "Order").capitalize()} #${_orderId.toString()}", - style: Theme.of(context).textTheme.headline6, + "${trans(context, "Order").capitalize()} #${_orderId.toString()}" ), centerTitle: true, ), @@ -110,8 +108,8 @@ class _AccountOrderDetailPageState extends NyState { decoration: BoxDecoration( borderRadius: BorderRadius.circular(8), boxShadow: - adaptiveThemeMode.isLight ? wsBoxShadow() : null, - color: adaptiveThemeMode.isLight + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, + color: (Theme.of(context).brightness == Brightness.light) ? Colors.white : Color(0xFF2C2C2C), ), diff --git a/LabelStoreMax/lib/resources/pages/account_register.dart b/LabelStoreMax/lib/resources/pages/account_register.dart index c305104..3245c4b 100644 --- a/LabelStoreMax/lib/resources/pages/account_register.dart +++ b/LabelStoreMax/lib/resources/pages/account_register.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_app/app/models/user.dart'; import 'package:flutter_app/bootstrap/app_helper.dart'; @@ -54,17 +54,15 @@ class _AccountRegistrationPageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; + return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, leading: IconButton( icon: Icon(Icons.close), onPressed: () => Navigator.pop(context), ), title: Text( - "Register", - style: Theme.of(context).textTheme.headline6, + trans(context, "Register") ), centerTitle: true, ), @@ -131,7 +129,7 @@ class _AccountRegistrationPageState extends State { style: TextStyle(fontWeight: FontWeight.bold)), ], style: TextStyle( - color: adaptiveTheme.isLight + color: (Theme.of(context).brightness == Brightness.light) ? Colors.black45 : Colors.white70), ), diff --git a/LabelStoreMax/lib/resources/pages/account_shipping_details.dart b/LabelStoreMax/lib/resources/pages/account_shipping_details.dart index f85d82b..6cfd887 100644 --- a/LabelStoreMax/lib/resources/pages/account_shipping_details.dart +++ b/LabelStoreMax/lib/resources/pages/account_shipping_details.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; @@ -34,8 +34,6 @@ class _AccountShippingDetailsPageState extends State { _AccountShippingDetailsPageState(); - AppTheme _appTheme = AppTheme(); - // BILLING TEXT CONTROLLERS TextEditingController _txtShippingFirstName = TextEditingController(), _txtShippingLastName = TextEditingController(), @@ -91,14 +89,12 @@ class _AccountShippingDetailsPageState @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; + return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( - trans(context, "Shipping Details"), - style: Theme.of(context).textTheme.headline6, + trans(context, "Shipping Details") ), centerTitle: true, ), @@ -182,13 +178,12 @@ class _AccountShippingDetailsPageState ], ), decoration: BoxDecoration( - color: adaptiveTheme.isLight - ? Colors.white - : _appTheme.accentColor( - brightness: Brightness.dark), + color: (Theme.of(context).brightness == Brightness.light) + ? NyColors.light.background + : NyColors.dark.primaryAccent, borderRadius: BorderRadius.circular(10), boxShadow: - adaptiveTheme.isLight ? wsBoxShadow() : null, + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, ), padding: EdgeInsets.all(8), ), diff --git a/LabelStoreMax/lib/resources/pages/browse_category.dart b/LabelStoreMax/lib/resources/pages/browse_category.dart index 79acbfc..2a4957d 100644 --- a/LabelStoreMax/lib/resources/pages/browse_category.dart +++ b/LabelStoreMax/lib/resources/pages/browse_category.dart @@ -83,15 +83,13 @@ class _BrowseCategoryPageState extends NyState { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, title: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Text(trans(context, "Browse"), style: Theme.of(context).textTheme.subtitle1), - Text(parseHtmlString(productCategory.name), - style: Theme.of(context).textTheme.headline6) + Text(parseHtmlString(productCategory.name)) ], ), centerTitle: true, diff --git a/LabelStoreMax/lib/resources/pages/browse_search.dart b/LabelStoreMax/lib/resources/pages/browse_search.dart index 97ffd6b..90eb3d7 100644 --- a/LabelStoreMax/lib/resources/pages/browse_search.dart +++ b/LabelStoreMax/lib/resources/pages/browse_search.dart @@ -77,15 +77,13 @@ class _BrowseSearchState extends NyState { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, title: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Text(trans(context, "Search results for"), style: Theme.of(context).textTheme.subtitle1), - Text("\"" + _search + "\"", - style: Theme.of(context).textTheme.headline6) + Text("\"" + _search + "\"") ], ), centerTitle: true, diff --git a/LabelStoreMax/lib/resources/pages/cart.dart b/LabelStoreMax/lib/resources/pages/cart.dart index 2de6472..cb47109 100644 --- a/LabelStoreMax/lib/resources/pages/cart.dart +++ b/LabelStoreMax/lib/resources/pages/cart.dart @@ -187,9 +187,7 @@ class _CartPageState extends State { appBar: AppBar( title: Text( trans(context, "Shopping Cart"), - style: Theme.of(context).appBarTheme.textTheme.headline6, ), - textTheme: Theme.of(context).textTheme, elevation: 1, actions: [ InkWell( @@ -199,7 +197,7 @@ class _CartPageState extends State { child: Padding( child: Text( trans(context, "Clear Cart"), - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyText2, ), padding: EdgeInsets.only(right: 8), ), diff --git a/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart b/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart index c0cb649..40c4216 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart @@ -8,7 +8,6 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; import 'package:flutter/material.dart'; import 'package:flutter_app/app/models/cart.dart'; import 'package:flutter_app/app/models/checkout_session.dart'; @@ -16,6 +15,7 @@ import 'package:flutter_app/app/models/customer_address.dart'; import 'package:flutter_app/app/models/customer_country.dart'; import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; +import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/resources/widgets/app_loader_widget.dart'; import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; @@ -178,16 +178,10 @@ class CheckoutConfirmationPageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( - trans(context, "Checkout"), - style: Theme.of(context) - .textTheme - .subtitle1 - .copyWith(fontWeight: FontWeight.bold), + trans(context, "Checkout") ), centerTitle: true, ), @@ -203,12 +197,10 @@ class CheckoutConfirmationPageState extends State { child: Container( padding: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - color: adaptiveThemeMode.isLight - ? Colors.white - : Colors.white54, + color: NyColors.of(context).backgroundContainer, borderRadius: BorderRadius.circular(10), boxShadow: - adaptiveThemeMode.isLight ? wsBoxShadow() : null, + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, ), margin: EdgeInsets.only(top: 5, bottom: 5), child: Column( @@ -217,7 +209,7 @@ class CheckoutConfirmationPageState extends State { children: [ Container( decoration: BoxDecoration( - boxShadow: adaptiveThemeMode.isLight + boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow(blurRadius: 10) : null, color: Colors.transparent, @@ -258,13 +250,13 @@ class CheckoutConfirmationPageState extends State { (CheckoutSession.getInstance.paymentType != null ? wsCheckoutRow(context, heading: trans(context, "Payment method"), - leadImage: Image.asset( - getImageAsset(CheckoutSession - .getInstance.paymentType.assetImage), - width: 70, - color: adaptiveThemeMode.isLight - ? null - : Colors.white, + leadImage: Container( + color: Colors.white, + child: Image.asset( + getImageAsset(CheckoutSession + .getInstance.paymentType.assetImage), + width: 70, + ), ), leadTitle: CheckoutSession .getInstance.paymentType.desc, @@ -386,7 +378,7 @@ class CheckoutConfirmationPageState extends State { return; } - if (_wooSignalApp.disableShipping == 1 && + if (_wooSignalApp.disableShipping == 0 && CheckoutSession.getInstance.shippingType == null) { showToastNotification( context, @@ -411,7 +403,7 @@ class CheckoutConfirmationPageState extends State { return; } - if (_wooSignalApp.disableShipping != 1 && + if (_wooSignalApp.disableShipping == 0 && CheckoutSession.getInstance.shippingType?.minimumValue != null) { String total = await Cart.getInstance.getTotal(); if (total == null) { diff --git a/LabelStoreMax/lib/resources/pages/checkout_details.dart b/LabelStoreMax/lib/resources/pages/checkout_details.dart index 4b50f79..8d38ae6 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_details.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_details.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_app/app/models/billing_details.dart'; import 'package:flutter_app/app/models/checkout_session.dart'; @@ -34,7 +34,6 @@ class _CheckoutDetailsPageState extends State { bool _hasDifferentShippingAddress = false, valRememberDetails = true; int activeTabIndex = 0; - AppTheme _appTheme = AppTheme(); // TEXT CONTROLLERS TextEditingController @@ -158,14 +157,11 @@ class _CheckoutDetailsPageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( trans(context, "Billing & Shipping Details"), - style: Theme.of(context).textTheme.headline6, ), centerTitle: true, ), @@ -229,13 +225,10 @@ class _CheckoutDetailsPageState extends State { fit: FlexFit.tight, child: Container( decoration: BoxDecoration( - color: adaptiveThemeMode.isLight - ? Colors.white - : _appTheme.accentColor( - brightness: Brightness.dark), + color: NyColors.of(context).backgroundContainer, borderRadius: BorderRadius.circular(10), boxShadow: - adaptiveThemeMode.isLight ? wsBoxShadow() : null, + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, ), padding: EdgeInsets.only(left: 8, right: 8, top: 8), child: (activeTab ?? tabBillingDetails()), diff --git a/LabelStoreMax/lib/resources/pages/checkout_payment_type.dart b/LabelStoreMax/lib/resources/pages/checkout_payment_type.dart index 6a685f1..5470ae0 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_payment_type.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_payment_type.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_app/app/models/checkout_session.dart'; import 'package:flutter_app/app/models/payment_type.dart'; @@ -29,8 +29,6 @@ class CheckoutPaymentTypePage extends StatefulWidget { class _CheckoutPaymentTypePageState extends State { _CheckoutPaymentTypePageState(); - AppTheme _appTheme = AppTheme(); - @override void initState() { super.initState(); @@ -44,14 +42,12 @@ class _CheckoutPaymentTypePageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; + return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( - trans(context, "Payment Method"), - style: Theme.of(context).textTheme.headline6, + trans(context, "Payment Method") ), automaticallyImplyLeading: false, centerTitle: true, @@ -91,14 +87,18 @@ class _CheckoutPaymentTypePageState extends State { left: 8, right: 8, ), - leading: Image.asset( - getImageAsset(paymentType.assetImage), - width: 60, - color: adaptiveThemeMode.isLight - ? null - : Colors.white, - fit: BoxFit.contain, - alignment: Alignment.center), + leading: Container( + decoration: BoxDecoration( + color: Colors.white + ), + padding: EdgeInsets.all(4), + child: Image.asset( + getImageAsset(paymentType.assetImage), + width: 60, + fit: BoxFit.contain, + alignment: Alignment.center, + ), + ), title: Text(paymentType.desc, style: Theme.of(context).textTheme.subtitle1), @@ -127,12 +127,10 @@ class _CheckoutPaymentTypePageState extends State { ], ), decoration: BoxDecoration( - color: adaptiveThemeMode.isLight - ? Colors.white - : _appTheme.accentColor(brightness: Brightness.dark), + color: NyColors.of(context).backgroundContainer, borderRadius: BorderRadius.circular(10), boxShadow: - adaptiveThemeMode.isLight ? wsBoxShadow() : null, + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, ), padding: EdgeInsets.all(8), ), diff --git a/LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart b/LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart index 1b03aed..ffa14ec 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_app/app/models/cart.dart'; import 'package:flutter_app/app/models/cart_line_item.dart'; @@ -35,7 +35,6 @@ class CheckoutShippingTypePage extends StatefulWidget { class _CheckoutShippingTypePageState extends State { _CheckoutShippingTypePageState(); - AppTheme _appTheme = AppTheme(); bool _isShippingSupported = true, _isLoading = true; List> _wsShippingOptions = []; WSShipping _shipping; @@ -235,14 +234,11 @@ class _CheckoutShippingTypePageState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( - trans(context, "Shipping Methods"), - style: Theme.of(context).textTheme.headline6, + trans(context, "Shipping Methods") ), automaticallyImplyLeading: false, centerTitle: true, @@ -261,7 +257,7 @@ class _CheckoutShippingTypePageState extends State { child: Image.asset( getImageAsset('shipping_icon.png'), height: 100, - color: adaptiveThemeMode.isLight ? null : Colors.white, + color: (Theme.of(context).brightness == Brightness.light) ? null : Colors.white, fit: BoxFit.fitHeight, ), ), @@ -395,12 +391,10 @@ class _CheckoutShippingTypePageState extends State { ], ), decoration: BoxDecoration( - color: adaptiveThemeMode.isLight - ? Colors.white - : _appTheme.accentColor(brightness: Brightness.dark), + color: NyColors.of(context).backgroundContainer, borderRadius: BorderRadius.circular(10), boxShadow: - adaptiveThemeMode.isLight ? wsBoxShadow() : null, + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, ), padding: EdgeInsets.all(8), ), diff --git a/LabelStoreMax/lib/resources/pages/checkout_status.dart b/LabelStoreMax/lib/resources/pages/checkout_status.dart index 060c3cf..254f2fd 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_status.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_status.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_app/app/controllers/checkout_status_controller.dart'; import 'package:flutter_app/app/models/cart.dart'; @@ -43,7 +43,7 @@ class _CheckoutStatusState extends NyState { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; + return Scaffold( appBar: AppBar( elevation: 0.0, @@ -94,7 +94,7 @@ class _CheckoutStatusState extends NyState { border: Border( bottom: BorderSide(color: Colors.black12, width: 1.0), ), - color: adaptiveThemeMode.isLight ? Colors.white : null), + color: (Theme.of(context).brightness == Brightness.light) ? Colors.white : null), padding: EdgeInsets.only(bottom: 20), ), Container( @@ -164,7 +164,7 @@ class _CheckoutStatusState extends NyState { padding: EdgeInsets.all(16), margin: EdgeInsets.all(8), color: - adaptiveThemeMode.isLight ? Colors.white : null); + (Theme.of(context).brightness == Brightness.light) ? Colors.white : null); }), ), Align( diff --git a/LabelStoreMax/lib/resources/pages/customer_countries.dart b/LabelStoreMax/lib/resources/pages/customer_countries.dart index dbe4afc..939628e 100644 --- a/LabelStoreMax/lib/resources/pages/customer_countries.dart +++ b/LabelStoreMax/lib/resources/pages/customer_countries.dart @@ -44,10 +44,8 @@ class _CustomerCountriesPageState extends State { return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( - backgroundColor: Colors.transparent, title: Text( - trans(context, "Select a country"), - style: Theme.of(context).textTheme.headline6, + trans(context, "Select a country") ), centerTitle: true, ), diff --git a/LabelStoreMax/lib/resources/pages/home_search.dart b/LabelStoreMax/lib/resources/pages/home_search.dart index 94585a4..2fb443c 100644 --- a/LabelStoreMax/lib/resources/pages/home_search.dart +++ b/LabelStoreMax/lib/resources/pages/home_search.dart @@ -47,7 +47,6 @@ class _HomeSearchPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, title: StoreLogo(height: 55), centerTitle: true, ), diff --git a/LabelStoreMax/lib/resources/pages/product_detail.dart b/LabelStoreMax/lib/resources/pages/product_detail.dart index 56ca208..9436428 100644 --- a/LabelStoreMax/lib/resources/pages/product_detail.dart +++ b/LabelStoreMax/lib/resources/pages/product_detail.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:flutter_app/app/controllers/product_detail_controller.dart'; @@ -42,7 +42,6 @@ class _ProductDetailState extends NyState { int _quantityIndicator = 1; List _productVariations = []; Map _tmpAttributeObj = {}; - AppTheme _appTheme = AppTheme(); @override widgetDidLoad() async { @@ -283,14 +282,12 @@ class _ProductDetailState extends NyState { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; return Scaffold( appBar: AppBar( - backgroundColor: Colors.transparent, actions: [ CartIconWidget(), ], - title: StoreLogo(height: 55, showBgWhite: !adaptiveTheme.isLight), + title: StoreLogo(height: 55, showBgWhite: (Theme.of(context).brightness == Brightness.dark)), centerTitle: true, ), body: SafeArea( @@ -309,7 +306,7 @@ class _ProductDetailState extends NyState { child: Swiper( itemBuilder: (BuildContext context, int index) => CachedImageWidget( - image: _product.images[index].src, + image: _product.images.length != 0 ? _product.images[index].src : getEnv("PRODUCT_PLACEHOLDER_IMAGE"), ), itemCount: _product.images.length == 0 ? 1 @@ -381,9 +378,7 @@ class _ProductDetailState extends NyState { ), Container( decoration: BoxDecoration( - color: adaptiveTheme.isLight - ? Colors.white - : Colors.black26, + color: NyColors.of(context).background, // boxShadow: wsBoxShadow(), borderRadius: BorderRadius.circular(4), ), @@ -444,10 +439,7 @@ class _ProductDetailState extends NyState { Container( padding: EdgeInsets.symmetric(horizontal: 16), decoration: BoxDecoration( - color: adaptiveTheme.isLight - ? Colors.white - : _appTheme.scaffoldColor( - brightness: Brightness.dark), + color: NyColors.of(context).background, boxShadow: [ BoxShadow( color: Colors.black12, diff --git a/LabelStoreMax/lib/resources/themes/dark_theme.dart b/LabelStoreMax/lib/resources/themes/dark_theme.dart index 0c51918..fa1cdae 100644 --- a/LabelStoreMax/lib/resources/themes/dark_theme.dart +++ b/LabelStoreMax/lib/resources/themes/dark_theme.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_app/config/app_theme.dart'; -import 'package:nylo_support/helpers/helper.dart'; +import 'package:flutter_app/resources/themes/text_theme/default_text_theme.dart'; +import 'package:nylo_framework/nylo_framework.dart'; /* |-------------------------------------------------------------------------- @@ -10,111 +12,106 @@ import 'package:nylo_support/helpers/helper.dart'; |-------------------------------------------------------------------------- */ -TextTheme _defaultTextTheme(AppTheme appTheme) { - return TextTheme( - headline5: TextStyle( - fontSize: 22.0, - color: appTheme.secondColor(brightness: Brightness.dark), +ThemeData darkTheme() { + TextTheme darkTheme = + getAppTextTheme(appThemeFont, defaultTextTheme.merge(_darkTextTheme())); + return ThemeData( + primaryColor: NyColors.light.primaryContent, + backgroundColor: NyColors.dark.background, + colorScheme: ColorScheme.dark(), + primaryColorLight: NyColors.light.primaryAccent, + primaryColorDark: NyColors.dark.primaryContent, + focusColor: NyColors.dark.primaryContent, + scaffoldBackgroundColor: NyColors.dark.background, + hintColor: NyColors.light.primaryAccent, + appBarTheme: AppBarTheme( + backgroundColor: NyColors.dark.appBarBackground, + titleTextStyle: darkTheme.headline6 + .copyWith(color: NyColors.dark.appBarPrimaryContent), + iconTheme: IconThemeData(color: NyColors.dark.appBarPrimaryContent), + elevation: 1.0, + systemOverlayStyle: SystemUiOverlayStyle.light), + buttonTheme: ButtonThemeData( + buttonColor: NyColors.dark.primaryAccent, + colorScheme: ColorScheme.light(primary: NyColors.dark.buttonBackground), ), - headline4: TextStyle( - fontSize: 24.0, - fontWeight: FontWeight.w600, - color: appTheme.secondColor(brightness: Brightness.dark), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom(primary: NyColors.dark.primaryContent), ), - headline3: TextStyle( - fontSize: 26.0, - fontWeight: FontWeight.w700, - color: appTheme.secondColor(brightness: Brightness.dark), + elevatedButtonTheme: ElevatedButtonThemeData( + style: TextButton.styleFrom( + primary: NyColors.dark.buttonPrimaryContent, + backgroundColor: NyColors.dark.buttonBackground), ), - headline2: TextStyle( - fontSize: 28.0, - fontWeight: FontWeight.w600, - color: appTheme.mainColor(brightness: Brightness.dark), + inputDecorationTheme: InputDecorationTheme( + focusedBorder:UnderlineInputBorder( + borderSide:BorderSide(color: Colors.black) + ), ), - headline1: TextStyle( - fontSize: 36.0, - fontWeight: FontWeight.w300, - color: appTheme.secondColor(brightness: Brightness.dark), - ), - subtitle2: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w500, - color: appTheme.secondColor(brightness: Brightness.dark), - ), - subtitle1: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.w500, - color: Colors.white, - ), - overline: TextStyle( - fontSize: 10.0, - fontWeight: FontWeight.w400, - color: appTheme.secondColor(brightness: Brightness.dark), - ), - button: TextStyle( - color: Colors.white, - ), - headline6: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.w600, - color: appTheme.mainColor(brightness: Brightness.dark), - ), - bodyText2: TextStyle( - fontSize: 14.0, - color: appTheme.secondColor(brightness: Brightness.dark), - ), - bodyText1: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - color: appTheme.secondColor(brightness: Brightness.dark), - ), - caption: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - color: appTheme.accentColor(brightness: Brightness.dark), + bottomNavigationBarTheme: BottomNavigationBarThemeData( + backgroundColor: NyColors.dark.bottomTabBarBackground, + unselectedIconTheme: + IconThemeData(color: NyColors.dark.bottomTabBarIconUnselected), + selectedIconTheme: + IconThemeData(color: NyColors.dark.bottomTabBarIconSelected), + unselectedLabelStyle: + TextStyle(color: NyColors.dark.bottomTabBarLabelUnselected), + selectedLabelStyle: + TextStyle(color: NyColors.dark.bottomTabBarLabelSelected), + selectedItemColor: NyColors.dark.bottomTabBarLabelSelected, ), + textTheme: darkTheme, + textSelectionTheme: TextSelectionThemeData(cursorColor: NyColors.dark.inputPrimaryContent), ); } -ThemeData darkTheme(AppTheme appTheme) => ThemeData( - primaryColor: appTheme.mainColor(brightness: Brightness.dark), - backgroundColor: Colors.white, - brightness: Brightness.dark, - accentColor: appTheme.accentColor(brightness: Brightness.dark), - iconTheme: IconThemeData( - color: appTheme.secondColor(brightness: Brightness.dark)), - primaryColorLight: appTheme.accentColor( - brightness: Brightness.light, - ), - primaryColorDark: appTheme.accentColor( - brightness: Brightness.dark, - ), - primaryTextTheme: _defaultTextTheme(appTheme).copyWith( - bodyText2: - TextStyle(color: Colors.white70, fontWeight: FontWeight.bold), - bodyText1: - TextStyle(color: Colors.grey, fontWeight: FontWeight.bold)), - accentColorBrightness: Brightness.dark, - accentTextTheme: _defaultTextTheme(appTheme).apply( - bodyColor: appTheme.accentColor(brightness: Brightness.dark), - displayColor: appTheme.accentColor(brightness: Brightness.dark), - ), - focusColor: appTheme.accentColor(brightness: Brightness.dark), - scaffoldBackgroundColor: - appTheme.scaffoldColor(brightness: Brightness.dark), - hintColor: appTheme.secondColor(brightness: Brightness.dark), - appBarTheme: AppBarTheme( - textTheme: getAppTextTheme(appThemeFont, _defaultTextTheme(appTheme)), - color: - appTheme.scaffoldColor(brightness: Brightness.dark, opacity: 0.5), - iconTheme: IconThemeData( - color: appTheme.mainColor(brightness: Brightness.dark)), - elevation: 1.0, - brightness: Brightness.dark, - ), - buttonColor: Colors.white, - buttonTheme: ButtonThemeData( - buttonColor: appTheme.accentColor(), - ), - textTheme: getAppTextTheme(appThemeFont, _defaultTextTheme(appTheme)), - ); +/* +|-------------------------------------------------------------------------- +| Dark Text Theme +|-------------------------------------------------------------------------- +*/ + +TextTheme _darkTextTheme() { + final Color darkPrimaryContent = NyColors.dark.primaryContent; + return TextTheme( + headline6: TextStyle( + color: darkPrimaryContent.withOpacity(0.8), + ), + headline5: TextStyle( + color: darkPrimaryContent, + ), + headline4: TextStyle( + color: darkPrimaryContent, + ), + headline3: TextStyle( + color: darkPrimaryContent, + ), + headline2: TextStyle( + color: darkPrimaryContent, + ), + headline1: TextStyle( + color: darkPrimaryContent, + ), + subtitle2: TextStyle( + color: darkPrimaryContent, + ), + subtitle1: TextStyle( + color: darkPrimaryContent, + ), + overline: TextStyle( + color: darkPrimaryContent, + ), + button: TextStyle( + color: darkPrimaryContent.withOpacity(0.8), + ), + bodyText2: TextStyle( + color: darkPrimaryContent.withOpacity(0.8), + ), + bodyText1: TextStyle( + color: NyColors.dark.primaryContent, + ), + caption: TextStyle( + color: darkPrimaryContent.withOpacity(0.8), + ), + ); +} \ No newline at end of file diff --git a/LabelStoreMax/lib/resources/themes/default_theme.dart b/LabelStoreMax/lib/resources/themes/default_theme.dart deleted file mode 100644 index 4d5df13..0000000 --- a/LabelStoreMax/lib/resources/themes/default_theme.dart +++ /dev/null @@ -1,111 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_app/config/app_theme.dart'; -import 'package:nylo_support/helpers/helper.dart'; - -/* -|-------------------------------------------------------------------------- -| Default Theme -| -| Theme Config - config/app_theme.dart -|-------------------------------------------------------------------------- -*/ - -ThemeData defaultTheme(AppTheme appTheme) => ThemeData( - primaryColor: appTheme.mainColor(), - backgroundColor: Colors.white, - brightness: Brightness.light, - accentColor: appTheme.accentColor(), - primaryColorLight: appTheme.accentColor( - brightness: Brightness.light, - ), - primaryColorDark: appTheme.accentColor( - brightness: Brightness.dark, - ), - accentColorBrightness: Brightness.light, - accentTextTheme: _defaultTextTheme(appTheme).apply( - bodyColor: appTheme.accentColor(), - displayColor: appTheme.accentColor(), - ), - focusColor: appTheme.accentColor(), - scaffoldBackgroundColor: appTheme.scaffoldColor(), - primaryTextTheme: _defaultTextTheme(appTheme).copyWith( - bodyText2: TextStyle(color: Colors.grey), - bodyText1: TextStyle(color: Colors.grey)), - hintColor: appTheme.secondColor(), - appBarTheme: AppBarTheme( - color: Colors.white, - textTheme: getAppTextTheme(appThemeFont, _defaultTextTheme(appTheme)), - iconTheme: IconThemeData(color: appTheme.mainColor()), - elevation: 0.0, - brightness: Brightness.light, - ), - buttonColor: Colors.white, - buttonTheme: ButtonThemeData( - buttonColor: appTheme.accentColor(), - ), - textTheme: getAppTextTheme(appThemeFont, _defaultTextTheme(appTheme)), - ); - -TextTheme _defaultTextTheme(AppTheme appTheme) { - return TextTheme( - headline5: TextStyle( - fontSize: 22.0, - color: appTheme.secondColor(), - ), - headline4: TextStyle( - fontSize: 24.0, - fontWeight: FontWeight.w600, - color: appTheme.secondColor(), - ), - headline3: TextStyle( - fontSize: 26.0, - fontWeight: FontWeight.w700, - color: appTheme.secondColor(), - ), - headline2: TextStyle( - fontSize: 28.0, - fontWeight: FontWeight.w600, - color: appTheme.mainColor(), - ), - headline1: TextStyle( - fontSize: 36.0, - fontWeight: FontWeight.w300, - color: appTheme.secondColor(), - ), - subtitle2: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w500, - color: appTheme.secondColor(), - ), - subtitle1: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.w500, - color: appTheme.secondColor(), - ), - overline: TextStyle( - fontSize: 10.0, - fontWeight: FontWeight.w400, - color: appTheme.secondColor(), - ), - button: TextStyle( - color: Colors.white, - ), - headline6: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.w600, - color: appTheme.mainColor(), - ), - bodyText2: TextStyle( - fontSize: 14.0, - color: appTheme.secondColor(), - ), - bodyText1: TextStyle( - fontSize: 16.0, - color: appTheme.secondColor(), - fontWeight: FontWeight.bold), - caption: TextStyle( - fontSize: 16.0, - color: appTheme.accentColor(), - fontWeight: FontWeight.bold), - ); -} diff --git a/LabelStoreMax/lib/resources/themes/light_theme.dart b/LabelStoreMax/lib/resources/themes/light_theme.dart new file mode 100644 index 0000000..d25203b --- /dev/null +++ b/LabelStoreMax/lib/resources/themes/light_theme.dart @@ -0,0 +1,121 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_app/config/app_theme.dart'; +import 'package:flutter_app/resources/themes/text_theme/default_text_theme.dart'; +import 'package:nylo_framework/nylo_framework.dart'; + +/* +|-------------------------------------------------------------------------- +| Light Theme +| +| Theme Config - config/app_theme.dart +|-------------------------------------------------------------------------- +*/ + +ThemeData lightTheme() { + TextTheme lightTheme = + getAppTextTheme(appThemeFont, defaultTextTheme.merge(_lightTextTheme())); + final Color lightPrimaryContent = NyColors.light.primaryContent; + final Color darkPrimaryContent = NyColors.dark.primaryContent; + + return ThemeData( + primaryColor: lightPrimaryContent, + backgroundColor: NyColors.light.background, + colorScheme: ColorScheme.light(), + primaryColorLight: NyColors.light.primaryAccent, + primaryColorDark: darkPrimaryContent, + focusColor: lightPrimaryContent, + scaffoldBackgroundColor: NyColors.light.background, + hintColor: NyColors.light.primaryAccent, + appBarTheme: AppBarTheme( + backgroundColor: NyColors.light.appBarBackground, + titleTextStyle: lightTheme.headline6 + .copyWith(color: NyColors.light.appBarPrimaryContent), + iconTheme: IconThemeData(color: NyColors.light.appBarPrimaryContent), + elevation: 1.0, + systemOverlayStyle: SystemUiOverlayStyle.dark, + ), + buttonTheme: ButtonThemeData( + buttonColor: NyColors.light.buttonPrimaryContent, + colorScheme: ColorScheme.light(primary: NyColors.light.buttonBackground), + ), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom(primary: lightPrimaryContent), + ), + elevatedButtonTheme: ElevatedButtonThemeData( + style: TextButton.styleFrom( + primary: NyColors.light.buttonPrimaryContent, + backgroundColor: NyColors.light.buttonBackground), + ), + inputDecorationTheme: InputDecorationTheme( + focusedBorder:UnderlineInputBorder( + borderSide:BorderSide(color: Colors.black) + ), + ), + bottomNavigationBarTheme: BottomNavigationBarThemeData( + backgroundColor: NyColors.light.bottomTabBarBackground, + unselectedIconTheme: + IconThemeData(color: NyColors.light.bottomTabBarIconUnselected), + selectedIconTheme: + IconThemeData(color: NyColors.light.bottomTabBarIconSelected), + unselectedLabelStyle: + TextStyle(color: NyColors.light.bottomTabBarLabelUnselected), + selectedLabelStyle: + TextStyle(color: NyColors.light.bottomTabBarLabelSelected), + selectedItemColor: NyColors.light.bottomTabBarLabelSelected, + ), + textTheme: lightTheme, + textSelectionTheme: TextSelectionThemeData(cursorColor: NyColors.light.inputPrimaryContent) + ); +} + +/* +|-------------------------------------------------------------------------- +| Light Text Theme +|-------------------------------------------------------------------------- +*/ + +TextTheme _lightTextTheme() { + final Color lightPrimaryContent = NyColors.light.primaryContent; + return TextTheme( + headline6: TextStyle( + color: lightPrimaryContent, + ), + headline5: TextStyle( + color: lightPrimaryContent, + ), + headline4: TextStyle( + color: lightPrimaryContent, + ), + headline3: TextStyle( + color: lightPrimaryContent, + ), + headline2: TextStyle( + color: lightPrimaryContent, + ), + headline1: TextStyle( + color: lightPrimaryContent, + ), + subtitle2: TextStyle( + color: lightPrimaryContent, + ), + subtitle1: TextStyle( + color: lightPrimaryContent, + ), + overline: TextStyle( + color: lightPrimaryContent, + ), + button: TextStyle( + color: lightPrimaryContent.withOpacity(0.8), + ), + bodyText2: TextStyle( + color: lightPrimaryContent.withOpacity(0.8), + ), + bodyText1: TextStyle( + color: lightPrimaryContent, + ), + caption: TextStyle( + color: lightPrimaryContent, + ), + ); +} \ No newline at end of file diff --git a/LabelStoreMax/lib/resources/themes/styles/dark_theme_colors.dart b/LabelStoreMax/lib/resources/themes/styles/dark_theme_colors.dart new file mode 100644 index 0000000..4d498db --- /dev/null +++ b/LabelStoreMax/lib/resources/themes/styles/dark_theme_colors.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_app/resources/themes/styles/theme_styles.dart'; + +/* +|-------------------------------------------------------------------------- +| Dark Theme Colors +|-------------------------------------------------------------------------- +*/ + +class DarkThemeColors implements BaseStyles { + // general + Color get background => const Color(0xFF212121); + Color get backgroundContainer => const Color(0xFF4a4a4a); + + Color get primaryContent => const Color(0xFFE1E1E1); + Color get primaryAccent => const Color(0xFF818181); + + // app bar + Color get appBarBackground => const Color(0xFF2C2C2C); + Color get appBarPrimaryContent => Colors.white; + + Color get inputPrimaryContent => Colors.white; + + // buttons + Color get buttonBackground => Colors.white60; + Color get buttonPrimaryContent => const Color(0xFF232c33); + + // bottom tab bar + Color get bottomTabBarBackground => const Color(0xFF232c33); + + // bottom tab bar - icons + Color get bottomTabBarIconSelected => Colors.white70; + Color get bottomTabBarIconUnselected => Colors.white60; + + // bottom tab bar - label + Color get bottomTabBarLabelUnselected => Colors.white54; + Color get bottomTabBarLabelSelected => Colors.white; +} \ No newline at end of file diff --git a/LabelStoreMax/lib/resources/themes/styles/light_theme_colors.dart b/LabelStoreMax/lib/resources/themes/styles/light_theme_colors.dart new file mode 100644 index 0000000..ca556a9 --- /dev/null +++ b/LabelStoreMax/lib/resources/themes/styles/light_theme_colors.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_app/resources/themes/styles/theme_styles.dart'; + +/* +|-------------------------------------------------------------------------- +| Light Theme Colors +|-------------------------------------------------------------------------- +*/ + +class LightThemeColors implements BaseStyles { + // general + Color get background => const Color(0xFFFFFFFF); + Color get backgroundContainer => Colors.white; + Color get primaryContent => const Color(0xFF000000); + Color get primaryAccent => const Color(0xFF87c694); + + // app bar + Color get appBarBackground => Colors.white; + Color get appBarPrimaryContent => const Color(0xFF3a3d40); + + Color get inputPrimaryContent => Colors.black; + + // buttons + Color get buttonBackground => const Color(0xFF529cda); + Color get buttonPrimaryContent => Colors.white; + + // bottom tab bar + Color get bottomTabBarBackground => Colors.white; + + // bottom tab bar - icons + Color get bottomTabBarIconSelected => Colors.blue; + Color get bottomTabBarIconUnselected => Colors.black54; + + // bottom tab bar - label + Color get bottomTabBarLabelUnselected => Colors.black45; + Color get bottomTabBarLabelSelected => Colors.black; +} diff --git a/LabelStoreMax/lib/resources/themes/styles/theme_styles.dart b/LabelStoreMax/lib/resources/themes/styles/theme_styles.dart new file mode 100644 index 0000000..907f2c3 --- /dev/null +++ b/LabelStoreMax/lib/resources/themes/styles/theme_styles.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +/// Interface for your base styles. +/// Add more styles here and then implement in +/// light_theme_colors.dart and dark_theme_colors.dart. +abstract class BaseStyles { + // general + Color get background; + Color get backgroundContainer; + Color get primaryContent; + Color get primaryAccent; + + // app bar + Color get appBarBackground; + Color get appBarPrimaryContent; + + // buttons + Color get buttonBackground; + Color get buttonPrimaryContent; + + // bottom tab bar + Color get bottomTabBarBackground; + + // bottom tab bar - icons + Color get bottomTabBarIconSelected; + Color get bottomTabBarIconUnselected; + + // bottom tab bar - label + Color get bottomTabBarLabelUnselected; + Color get bottomTabBarLabelSelected; + + Color get inputPrimaryContent; +} \ No newline at end of file diff --git a/LabelStoreMax/lib/resources/themes/text_theme/default_text_theme.dart b/LabelStoreMax/lib/resources/themes/text_theme/default_text_theme.dart new file mode 100644 index 0000000..2f40598 --- /dev/null +++ b/LabelStoreMax/lib/resources/themes/text_theme/default_text_theme.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; + +/* +|-------------------------------------------------------------------------- +| Default text theme +|-------------------------------------------------------------------------- +*/ + +const TextTheme defaultTextTheme = TextTheme( + headline6: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.w600, + ), + headline5: TextStyle( + fontSize: 22.0, + ), + headline4: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.w600, + ), + headline3: TextStyle( + fontSize: 26.0, + fontWeight: FontWeight.w700, + ), + headline2: TextStyle( + fontSize: 28.0, + fontWeight: FontWeight.w600, + ), + headline1: TextStyle( + fontSize: 36.0, + fontWeight: FontWeight.w300, + ), + subtitle2: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w500, + ), + subtitle1: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w500, + ), + overline: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.w400, + ), + button: TextStyle(), + bodyText2: TextStyle( + fontSize: 14.0, + ), + bodyText1: TextStyle( + fontSize: 16.0, + ), + caption: TextStyle( + fontSize: 16.0, + ), +); diff --git a/LabelStoreMax/lib/resources/widgets/app_loader_widget.dart b/LabelStoreMax/lib/resources/widgets/app_loader_widget.dart index 4614e3b..cbad679 100644 --- a/LabelStoreMax/lib/resources/widgets/app_loader_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/app_loader_widget.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -18,10 +18,9 @@ class AppLoaderWidget extends StatelessWidget { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; + bool isDark = (Theme.of(context).brightness == Brightness.dark); return SpinKitDoubleBounce( - color: - adaptiveThemeMode.isLight ? HexColor("#424242") : HexColor("#c7c7c7"), + color: HexColor(!isDark ? "#424242" : "#c7c7c7") ); } } diff --git a/LabelStoreMax/lib/resources/widgets/app_version_widget.dart b/LabelStoreMax/lib/resources/widgets/app_version_widget.dart index 9859650..86f4549 100644 --- a/LabelStoreMax/lib/resources/widgets/app_version_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/app_version_widget.dart @@ -33,7 +33,7 @@ class AppVersionWidget extends StatelessWidget { "${trans(context, "Version")}: ${snapshot.data.version}", style: Theme.of(context) .textTheme - .bodyText1 + .bodyText2 .copyWith(fontWeight: FontWeight.w300)), padding: EdgeInsets.only(top: 15, bottom: 15), ); diff --git a/LabelStoreMax/lib/resources/widgets/buttons.dart b/LabelStoreMax/lib/resources/widgets/buttons.dart index 6fbf9a3..5ebbb13 100644 --- a/LabelStoreMax/lib/resources/widgets/buttons.dart +++ b/LabelStoreMax/lib/resources/widgets/buttons.dart @@ -30,7 +30,7 @@ class PrimaryButton extends StatelessWidget { textStyle: Theme.of(context) .textTheme .button - .copyWith(fontSize: 16, fontWeight: FontWeight.bold), + .copyWith(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white), bgColor: HexColor("#529cda"), ); } diff --git a/LabelStoreMax/lib/resources/widgets/cached_image_widget.dart b/LabelStoreMax/lib/resources/widgets/cached_image_widget.dart index 280d5f9..a2a2955 100644 --- a/LabelStoreMax/lib/resources/widgets/cached_image_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/cached_image_widget.dart @@ -21,6 +21,7 @@ class CachedImageWidget extends StatelessWidget { child: CircularProgressIndicator( strokeWidth: 2, backgroundColor: Colors.black12, + color: Colors.black54 ), ), this.fit = BoxFit.contain, diff --git a/LabelStoreMax/lib/resources/widgets/cart_icon_widget.dart b/LabelStoreMax/lib/resources/widgets/cart_icon_widget.dart index 9a71d2a..0fedc06 100644 --- a/LabelStoreMax/lib/resources/widgets/cart_icon_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/cart_icon_widget.dart @@ -55,7 +55,7 @@ class _CartIconWidgetState extends State { } return Text( cartValue, - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyText2, textAlign: TextAlign.center, ); } diff --git a/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart b/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart index a6d9893..100c89c 100644 --- a/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart +++ b/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart @@ -6,11 +6,11 @@ import 'package:flutter_app/app/models/checkout_session.dart'; import 'package:flutter_app/app/models/customer_address.dart'; import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; +import 'package:nylo_framework/nylo_framework.dart'; import 'dart:async'; - -import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/widgets/ny_state.dart'; +import 'package:webview_flutter/webview_flutter.dart'; import 'package:woosignal/models/response/woosignal_app.dart'; class PayPalCheckout extends StatefulWidget { @@ -25,7 +25,9 @@ class PayPalCheckout extends StatefulWidget { } class WebViewState extends NyState { - final flutterWebViewPlugin = new FlutterWebviewPlugin(); + final Completer _controller = + Completer(); + String payerId = ''; int intCount = 0; StreamSubscription _onUrlChanged; @@ -67,7 +69,7 @@ class WebViewState extends NyState { } String getPayPalItemName() { - return truncateString(widget.description, 124); + return truncateString(widget.description.replaceAll(new RegExp(r'[^\w\s]+'),''), 124); } String getPayPalPaymentType() { @@ -84,33 +86,17 @@ class WebViewState extends NyState { @override void initState() { super.initState(); + if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); setCheckoutShippingAddress( CheckoutSession.getInstance.billingDetails.shippingAddress); - setState(() {}); - - _onUrlChanged = flutterWebViewPlugin.onUrlChanged.listen((String url) { - if (intCount > 0) { - url = url.replaceAll("~", "_"); - } - - intCount = intCount + 1; - if (url.contains("payment_success")) { - var uri = Uri.dataFromString(url); - setState(() { - payerId = uri.queryParameters['PayerID']; - }); - Navigator.pop(context, {"status": "success", "payerId": payerId}); - } else if (url.contains("payment_failure")) { - Navigator.pop(context, {"status": "cancelled"}); - } - }); } @override void dispose() { - _onUrlChanged.cancel(); - flutterWebViewPlugin.dispose(); + if (_onUrlChanged != null) { + _onUrlChanged.cancel(); + } super.dispose(); } @@ -146,14 +132,39 @@ $formCheckoutShippingAddress @override Widget build(BuildContext context) { - return WebviewScaffold( - url: Uri.dataFromString(_loadHTML(), mimeType: 'text/html').toString(), - appBar: AppBar( - centerTitle: true, - automaticallyImplyLeading: false, - title: Text( - trans(context, "PayPal Checkout"), - textAlign: TextAlign.center, + return Scaffold( + resizeToAvoidBottomInset: false, + body: SafeArea( + child: WebView( + initialUrl: Uri.dataFromString(_loadHTML(), mimeType: 'text/html').toString(), + javascriptMode: JavascriptMode.unrestricted, + onWebViewCreated: (WebViewController webViewController) { + _controller.complete(webViewController); + }, + onProgress: (int progress) { + }, + navigationDelegate: (NavigationRequest request) { + return NavigationDecision.navigate; + }, + onPageStarted: (String url) { + }, + onPageFinished: (String url) { + if (intCount > 0) { + url = url.replaceAll("~", "_"); + } + + intCount = intCount + 1; + if (url.contains("payment_success")) { + var uri = Uri.dataFromString(url); + setState(() { + payerId = uri.queryParameters['PayerID']; + }); + Navigator.pop(context, {"status": payerId == null ? "cancelled" : "success", "payerId": payerId}); + } else if (url.contains("payment_failure")) { + Navigator.pop(context, {"status": "cancelled"}); + } + }, + gestureNavigationEnabled: false, ), ), ); diff --git a/LabelStoreMax/lib/resources/widgets/home_drawer_widget.dart b/LabelStoreMax/lib/resources/widgets/home_drawer_widget.dart index f7d696c..e2e8b95 100644 --- a/LabelStoreMax/lib/resources/widgets/home_drawer_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/home_drawer_widget.dart @@ -8,12 +8,14 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart'; +import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/resources/widgets/app_version_widget.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; +import 'package:nylo_framework/theme/helper/ny_theme.dart'; import 'package:nylo_support/helpers/helper.dart'; import 'package:woosignal/models/response/woosignal_app.dart'; @@ -30,19 +32,17 @@ class HomeDrawerWidget extends StatefulWidget { class _HomeDrawerWidgetState extends State { @override Widget build(BuildContext context) { - AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; + bool isDark = (Theme.of(context).brightness == Brightness.dark); return Drawer( child: Container( - color: adaptiveTheme == AdaptiveThemeMode.light - ? Colors.white - : Color(0xFF2C2C2C), + color: NyColors.of(context).background, child: ListView( padding: EdgeInsets.zero, children: [ DrawerHeader( child: Center(child: StoreLogo()), decoration: BoxDecoration( - color: adaptiveTheme.isLight ? Colors.white : Colors.black87, + color: NyColors.of(context).background, ), ), Padding( @@ -54,15 +54,20 @@ class _HomeDrawerWidgetState extends State { ), if (widget.wooSignalApp.wpLoginEnabled == 1) ListTile( - title: Text(trans(context, "Profile")), + title: Text(trans(context, "Profile"), style: Theme.of(context).textTheme.bodyText2.copyWith( + fontSize: 16 + ),), leading: Icon(Icons.account_circle), onTap: _actionProfile, ), ListTile( - title: Text(trans(context, "Cart")), + title: Text(trans(context, "Cart"), style: Theme.of(context).textTheme.bodyText2.copyWith( + fontSize: 16 + ),), leading: Icon(Icons.shopping_cart), onTap: _actionCart, ), + if (widget.wooSignalApp.appTermslink != null && widget.wooSignalApp.appPrivacylink != null) Padding( child: Text( trans(context, "About Us"), @@ -73,7 +78,10 @@ class _HomeDrawerWidgetState extends State { if (widget.wooSignalApp.appTermslink != null && widget.wooSignalApp.appTermslink.isNotEmpty) ListTile( - title: Text(trans(context, "Terms and conditions")), + title: Text(trans(context, "Terms and conditions"), + style: Theme.of(context).textTheme.bodyText2.copyWith( + fontSize: 16 + ),), leading: Icon(Icons.menu_book_rounded), trailing: Icon(Icons.keyboard_arrow_right_rounded), onTap: _actionTerms, @@ -81,25 +89,25 @@ class _HomeDrawerWidgetState extends State { if (widget.wooSignalApp.appPrivacylink != null && widget.wooSignalApp.appPrivacylink.isNotEmpty) ListTile( - title: Text(trans(context, "Privacy policy")), + title: Text(trans(context, "Privacy policy"), style: Theme.of(context).textTheme.bodyText2.copyWith( + fontSize: 16 + ),), trailing: Icon(Icons.keyboard_arrow_right_rounded), leading: Icon(Icons.account_balance), onTap: _actionPrivacy, ), ListTile( title: Text( - adaptiveTheme.isDark - ? trans(context, "Light Mode") - : trans(context, "Dark Mode"), + trans(context, (isDark ? "Light Mode" : "Dark Mode")), + style: Theme.of(context).textTheme.bodyText2.copyWith( + fontSize: 16 + ) ), leading: Icon(Icons.brightness_4_rounded), onTap: () { - if (adaptiveTheme.isDark) { - AdaptiveTheme.of(context).setLight(); - } else { - AdaptiveTheme.of(context).setDark(); - } - setState(() {}); + setState(() { + NyTheme.set(context, id: isDark ? "default_light_theme" : "default_dark_theme"); + }); }, ), ListTile( diff --git a/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart b/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart index 8cf1514..b98e0ff 100644 --- a/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart @@ -117,6 +117,7 @@ class _NoticHomeWidgetState extends State { onTap: _modalBottomSheetMenu, child: Text( trans(context, "Categories"), + style: Theme.of(context).textTheme.bodyText2, ), ), ), diff --git a/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart b/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart index 998de29..99f6b38 100644 --- a/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart @@ -89,7 +89,7 @@ class _NoticThemeWidgetState extends State { } case 3: { - activeWidget = (await authCheck()) ? AccountDetailPage(showLeadingBackButton: false) : AccountLandingPage(); + activeWidget = (await authCheck()) ? AccountDetailPage(showLeadingBackButton: false) : AccountLandingPage(showBackButton: false,); break; } } diff --git a/LabelStoreMax/lib/resources/widgets/top_nav_widget.dart b/LabelStoreMax/lib/resources/widgets/top_nav_widget.dart index 9cbb163..4fae548 100644 --- a/LabelStoreMax/lib/resources/widgets/top_nav_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/top_nav_widget.dart @@ -36,7 +36,7 @@ class TopNavWidget extends StatelessWidget { AutoSizeText( trans(context, "Newest"), style: Theme.of(context) - .primaryTextTheme + .textTheme .bodyText2 .copyWith(fontWeight: FontWeight.bold), maxLines: 1, diff --git a/LabelStoreMax/lib/resources/widgets/woosignal_ui.dart b/LabelStoreMax/lib/resources/widgets/woosignal_ui.dart index 313be50..6a0cdc5 100644 --- a/LabelStoreMax/lib/resources/widgets/woosignal_ui.dart +++ b/LabelStoreMax/lib/resources/widgets/woosignal_ui.dart @@ -8,7 +8,7 @@ // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -import 'package:adaptive_theme/adaptive_theme.dart'; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -18,6 +18,7 @@ import 'package:flutter_app/app/models/cart_line_item.dart'; import 'package:flutter_app/app/models/checkout_session.dart'; import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; +import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/resources/widgets/app_loader_widget.dart'; import 'package:flutter_app/resources/widgets/cached_image_widget.dart'; import 'package:flutter_app/resources/widgets/no_results_for_products_widget.dart'; @@ -237,7 +238,9 @@ class TextEditingRow extends StatelessWidget { child: Padding( child: Text( heading, - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyText1.copyWith( + color: NyColors.of(context).primaryContent + ), ), padding: EdgeInsets.only(bottom: 2), ), @@ -375,7 +378,9 @@ class ProductItemContainer extends StatelessWidget { margin: const EdgeInsets.only(top: 2, bottom: 2), child: Text( product.name, - style: Theme.of(context).textTheme.bodyText2, + style: Theme.of(context).textTheme.bodyText2.copyWith( + fontSize: 15 + ), maxLines: 2, overflow: TextOverflow.ellipsis, ), @@ -438,7 +443,7 @@ class ProductItemContainer extends StatelessWidget { wsModalBottom(BuildContext context, {String title, Widget bodyWidget, Widget extraWidget}) { - AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; + showModalBottomSheet( context: context, backgroundColor: Colors.transparent, @@ -451,9 +456,7 @@ wsModalBottom(BuildContext context, child: new Container( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: new BoxDecoration( - color: adaptiveThemeMode.isLight - ? Colors.white - : Color(0xFF2C2C2C), + color: NyColors.of(context).background, borderRadius: new BorderRadius.only( topLeft: const Radius.circular(10.0), topRight: const Radius.circular(10.0), @@ -476,10 +479,8 @@ wsModalBottom(BuildContext context, width: double.infinity, decoration: BoxDecoration( boxShadow: - adaptiveThemeMode.isLight ? wsBoxShadow() : null, - color: adaptiveThemeMode.isLight - ? Colors.white - : Color(0xFF4a4a4a), + (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, + color: NyColors.of(context).background, borderRadius: BorderRadius.circular(8), ), child: bodyWidget, @@ -487,7 +488,8 @@ wsModalBottom(BuildContext context, ), extraWidget ?? null ].where((t) => t != null).toList(), - )), + ), + ), ), ); }, diff --git a/LabelStoreMax/lib/routes/router.dart b/LabelStoreMax/lib/routes/router.dart index 14955c5..bd6f0a5 100644 --- a/LabelStoreMax/lib/routes/router.dart +++ b/LabelStoreMax/lib/routes/router.dart @@ -29,7 +29,7 @@ import 'package:page_transition/page_transition.dart'; |-------------------------------------------------------------------------- */ -buildRouter() => nyCreateRoutes((router) { +appRouter() => nyRoutes((router) { router.route("/home", (context) => HomePage()); router.route("/cart", (context) => CartPage()); diff --git a/LabelStoreMax/pubspec.lock b/LabelStoreMax/pubspec.lock index 1ec91ad..f8bbe9d 100644 --- a/LabelStoreMax/pubspec.lock +++ b/LabelStoreMax/pubspec.lock @@ -7,21 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "21.0.0" - adaptive_theme: - dependency: "direct main" - description: - name: adaptive_theme - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" + version: "22.0.0" analyzer: dependency: "direct main" description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.7.2" animate_do: dependency: "direct main" description: @@ -42,14 +35,14 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.2.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.6.1" + version: "2.8.1" auto_size_text: dependency: "direct main" description: @@ -91,7 +84,7 @@ packages: name: cached_network_image_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" characters: dependency: transitive description: @@ -105,14 +98,14 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" cli_util: dependency: transitive description: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.3" clock: dependency: transitive description: @@ -133,7 +126,7 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" crypto: dependency: transitive description: @@ -176,13 +169,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" - eventify: - dependency: transitive - description: - name: eventify - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" fake_async: dependency: transitive description: @@ -196,14 +182,14 @@ packages: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.0" + version: "6.1.2" flare_dart: dependency: transitive description: @@ -236,21 +222,21 @@ packages: name: flutter_cache_manager url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.2" flutter_dotenv: dependency: transitive description: name: flutter_dotenv url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.0.2" flutter_launcher_icons: - dependency: "direct main" + dependency: transitive description: name: flutter_launcher_icons url: "https://pub.dartlang.org" source: hosted - version: "0.9.0" + version: "0.9.2" flutter_localizations: dependency: "direct main" description: flutter @@ -269,21 +255,28 @@ packages: name: flutter_secure_storage url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "4.2.1" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.1.0" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.1" + flutter_stripe: + dependency: "direct main" + description: + name: flutter_stripe + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" flutter_styled_toast: dependency: "direct main" description: @@ -309,19 +302,19 @@ packages: name: flutter_web_browser url: "https://pub.dartlang.org" source: hosted - version: "0.14.0" + version: "0.15.0" flutter_web_plugins: dependency: transitive description: flutter source: sdk version: "0.0.0" - flutter_webview_plugin: - dependency: "direct main" + freezed_annotation: + dependency: transitive description: - name: flutter_webview_plugin + name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.14.3" glob: dependency: transitive description: @@ -342,7 +335,7 @@ packages: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" html: dependency: "direct main" description: @@ -356,7 +349,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.1" + version: "0.13.3" http_parser: dependency: transitive description: @@ -385,13 +378,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" logger: dependency: transitive description: name: logger url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" matcher: dependency: transitive description: @@ -405,14 +405,14 @@ packages: name: math_expressions url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.2.0" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" money_formatter: dependency: "direct main" description: @@ -426,14 +426,14 @@ packages: name: nylo_framework url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "2.0.4" nylo_support: - dependency: "direct main" + dependency: transitive description: name: nylo_support url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "2.1.0" octo_image: dependency: transitive description: @@ -461,7 +461,7 @@ packages: name: page_transition url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.4" path: dependency: transitive description: @@ -475,21 +475,21 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path_provider_platform_interface: dependency: transitive description: @@ -503,28 +503,28 @@ packages: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.3" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.11.1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.2" platform_alert_dialog: dependency: "direct main" description: @@ -538,14 +538,14 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.1" + version: "4.2.3" pub_semver: dependency: transitive description: @@ -560,41 +560,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" - razorpay_flutter: - dependency: "direct main" - description: - name: razorpay_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.7" rxdart: dependency: transitive description: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.26.0" + version: "0.27.2" shared_preferences: dependency: transitive description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.7" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_platform_interface: dependency: transitive description: @@ -608,14 +601,14 @@ packages: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" sky_engine: dependency: transitive description: flutter @@ -634,14 +627,14 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+3" + version: "2.0.0+4" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+2" + version: "2.0.1+1" stack_trace: dependency: transitive description: @@ -670,6 +663,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + stripe_android: + dependency: transitive + description: + name: stripe_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + stripe_ios: + dependency: transitive + description: + name: stripe_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + stripe_platform_interface: + dependency: transitive + description: + name: stripe_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" synchronized: dependency: transitive description: @@ -690,7 +704,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" + theme_provider: + dependency: transitive + description: + name: theme_provider + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" transformer_page_view: dependency: transitive description: @@ -726,13 +747,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.15" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.14" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.2.9" woosignal: dependency: "direct main" description: @@ -740,20 +789,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" - woosignal_stripe: - dependency: "direct main" - description: - name: woosignal_stripe - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" wp_json_api: dependency: "direct main" description: name: wp_json_api url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.3" xdg_directories: dependency: transitive description: @@ -767,7 +809,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.3.0" yaml: dependency: transitive description: @@ -776,5 +818,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" - flutter: ">=2.0.1" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/LabelStoreMax/pubspec.yaml b/LabelStoreMax/pubspec.yaml index e82bde4..69a4835 100644 --- a/LabelStoreMax/pubspec.yaml +++ b/LabelStoreMax/pubspec.yaml @@ -1,14 +1,14 @@ # Official WooSignal App Template for WooCommerce # Label StoreMax -# Version: 5.1.0 +# Version: 5.2.0 # Author: Anthony Gordon # Homepage: https://woosignal.com # Documentation: https://woosignal.com/docs/app/ios/label-storemax ### Change App Icon # 1 Replace: public/assets/icon/appicon.png (1024px1024px icon size) -# 2 Run this command from the terminal: "flutter pub run flutter_launcher_icons:main" +# 2 Run this command from the terminal: "flutter pub run nylo_framework:main appicons:build" ### Uploading the IOS/Android app # IOS https://flutter.dev/docs/deployment/ios @@ -27,34 +27,30 @@ environment: dependencies: google_fonts: ^2.1.0 analyzer: ^1.5.0 - adaptive_theme: ^2.2.0 intl: ^0.17.0 - page_transition: ^2.0.2 - nylo_framework: ^1.0.0 - nylo_support: ^1.0.0 + page_transition: ^2.0.4 + nylo_framework: ^2.0.4 woosignal: ^2.1.0 - woosignal_stripe: ^1.1.0 - razorpay_flutter: ^1.2.5 - wp_json_api: ^3.0.0 + flutter_stripe: ^2.0.0 + wp_json_api: ^3.1.3 cached_network_image: ^3.1.0 package_info: ^2.0.2 money_formatter: ^0.0.3 platform_alert_dialog: ^1.0.0+2 - flutter_web_browser: ^0.14.0 - flutter_webview_plugin: ^0.4.0 + flutter_web_browser: ^0.15.0 + webview_flutter: ^2.1.1 pull_to_refresh: 2.0.0 flutter_swiper: ^1.1.6 flutter_styled_toast: ^2.0.0 animate_do: ^2.0.0 bubble_tab_indicator: ^0.1.5 status_alert: ^0.1.3 - math_expressions: ^2.1.1 - hexcolor: ^2.0.3 - flutter_spinkit: ^5.0.0 - flutter_launcher_icons: ^0.9.0 + math_expressions: ^2.2.0 + hexcolor: ^2.0.5 + flutter_spinkit: ^5.1.0 auto_size_text: ^2.1.0 html: ^0.15.0 - flutter_staggered_grid_view: ^0.4.0 + flutter_staggered_grid_view: ^0.4.1 flutter: sdk: flutter flutter_localizations: diff --git a/README.md b/README.md index 498794d..103cd7d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v5.1.0 +### Label StoreMax - v5.2.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, RazorPay and PayPal +- Stripe, Cash On Delivery and PayPal - Localized for en, es, pt, it, hi, fr, zh - Orders show as normal in WooCommerce