This commit is contained in:
Anthony 2021-10-11 23:41:22 +01:00
parent 35d4e62b24
commit 877dabbb60
63 changed files with 944 additions and 862 deletions

View File

@ -23,14 +23,12 @@ APP_KEY="your app key"
STRIPE_ACCOUNT="Stripe account key from WooSignal" STRIPE_ACCOUNT="Stripe account key from WooSignal"
# Stripe account key from WooSignal https://woosignal.com/dashboard # 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 STRIPE_LIVE_MODE=null
# Change to 'true' for live payments and update the "Environment for Stripe" here https://woosignal.com/dashboard # Change to 'true' for live payments and update the "Environment for Stripe" here https://woosignal.com/dashboard
# *<! ------ RAYZORPAY (OPTIONAL) ------!>*
RAZORPAY_ID=""
# Razorpay ID from https://razorpay.com
# *<! ------ PAYPAL (OPTIONAL) ------!>* # *<! ------ PAYPAL (OPTIONAL) ------!>*
PAYPAL_ACCOUNT_EMAIL="mystore@business.com" PAYPAL_ACCOUNT_EMAIL="mystore@business.com"

View File

@ -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 ## [5.1.0] - 2020-07-19
* Add support for simplified Chinese locale (zh) * Add support for simplified Chinese locale (zh)

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.1.0 ### Label StoreMax - v5.2.0
[Official WooSignal WooCommerce App](https://woosignal.com) [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) - Browse products, make orders, customer login (via WordPress)
- Change app name, logo, customize default language, currency + more - Change app name, logo, customize default language, currency + more
- Light and dark mode - Light and dark mode
- Stripe, Cash On Delivery, RazorPay, PayPal - Stripe, Cash On Delivery, PayPal
- Localized for en, es, pt, it, hi, fr, zh - Localized for en, es, pt, it, hi, fr, zh
- Orders show as normal in WooCommerce - Orders show as normal in WooCommerce

View File

@ -26,7 +26,19 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { 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 { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -39,8 +51,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.woosignal.android" applicationId "com.woosignal.android"
minSdkVersion 19 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true

View File

@ -1,6 +1,7 @@
package com.woosignal.android package com.woosignal.android
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterActivity() { class MainActivity: FlutterFragmentActivity() {
} }

View File

@ -1,12 +1,12 @@
buildscript { buildscript {
ext.kotlin_version = '1.3.50' ext.kotlin_version = '1.5.0'
repositories { repositories {
google() google()
jcenter() jcenter()
} }
dependencies { 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" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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

View File

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>8.0</string> <string>9.0</string>
</dict> </dict>
</plist> </plist>

View File

@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string> <string>$(FLUTTER_BUILD_NAME)</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) photo use</string> <string>You can take photos of your payment details.</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "Zahlung storniert", "Payment Cancelled": "Zahlung storniert",
"The payment has been cancelled": "Die Zahlung wurde storniert", "The payment has been cancelled": "Die Zahlung wurde storniert",
"Must have": "Haben müssen", "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"
} }

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "Payment Cancelled", "Payment Cancelled": "Payment Cancelled",
"The payment has been cancelled": "The payment has been cancelled", "The payment has been cancelled": "The payment has been cancelled",
"Must have": "Must have", "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"
} }

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "Pago cancelado", "Payment Cancelled": "Pago cancelado",
"The payment has been cancelled": "El pago ha sido cancelado", "The payment has been cancelled": "El pago ha sido cancelado",
"Must have": "Debe tener", "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"
} }

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "Paiement annulé", "Payment Cancelled": "Paiement annulé",
"The payment has been cancelled": "Le paiement a été annulé", "The payment has been cancelled": "Le paiement a été annulé",
"Must have": "Doit avoir", "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"
} }

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "bhugataan radd kiya gaya", "Payment Cancelled": "bhugataan radd kiya gaya",
"The payment has been cancelled": "bhugataan radd kar diya gaya hai", "The payment has been cancelled": "bhugataan radd kar diya gaya hai",
"Must have": "hona aavashyak 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"
} }

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "Pagamento annullato", "Payment Cancelled": "Pagamento annullato",
"The payment has been cancelled": "Il pagamento è stato annullato", "The payment has been cancelled": "Il pagamento è stato annullato",
"Must have": "Deve avere", "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"
} }

View File

@ -184,5 +184,6 @@
"Payment Cancelled": "Pagamento Cancelado", "Payment Cancelled": "Pagamento Cancelado",
"The payment has been cancelled": "O pagamento foi cancelado", "The payment has been cancelled": "O pagamento foi cancelado",
"Must have": "Deve ter", "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"
} }

View File

@ -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": "我们精选的新品",
"Register": "登记"
} }

View File

@ -46,7 +46,7 @@ payPalPay(context,
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
return; return;
} }
print(value);
state.reloadState(showLoader: true); state.reloadState(showLoader: true);
if (value.containsKey("status") && value["status"] == "success") { if (value.containsKey("status") && value["status"] == "success") {
OrderWC orderWC = OrderWC orderWC =

View File

@ -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);
});
}

View File

@ -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/data/order_wc.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:flutter_app/resources/pages/checkout_confirmation.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:nylo_support/helpers/helper.dart';
import 'package:woosignal/models/payload/order_wc.dart'; import 'package:woosignal/models/payload/order_wc.dart';
import 'package:woosignal/models/response/order.dart'; import 'package:woosignal/models/response/order.dart';
import 'package:woosignal/models/response/tax_rate.dart'; import 'package:woosignal/models/response/tax_rate.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
import 'package:woosignal_stripe/woosignal_stripe.dart';
stripePay(context, stripePay(context,
{@required CheckoutConfirmationPageState state, TaxRate taxRate}) async { {@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 { try {
WooSignalApp wooSignalApp = AppHelper.instance.appConfig; dynamic rsp = {};
bool liveMode = getEnv('STRIPE_LIVE_MODE') == null // // CHECKOUT HELPER
? wooSignalApp.stripeLiveMode await checkout(taxRate, (total, billingDetails, cart) async {
: getEnv('STRIPE_LIVE_MODE', defaultValue: false); Map<String, dynamic> 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 String cartShortDesc = await cart.cartShortDesc();
FlutterStripePayment.setStripeSettings(
stripeAccount: getEnv('STRIPE_ACCOUNT'), liveMode: liveMode);
PaymentResponse paymentResponse = rsp = await appWooSignal((api) =>
await FlutterStripePayment.addPaymentMethod(); api.stripePaymentIntent(
amount: total,
email: billingDetails.billingAddress.emailAddress,
desc: cartShortDesc,
shipping: address,
));
});
// CHECK STATUS FROM STRIPE if (rsp == null) {
if (paymentResponse.status == PaymentResponseStatus.succeeded) { showToastNotification(context,
state.reloadState(showLoader: true); title: trans(context, "Oops!"),
description:
// CHECKOUT HELPER trans(context, "Something went wrong, please try again."),
await checkout(taxRate, (total, billingDetails, cart) async { icon: Icons.payment,
Map<String, dynamic> address = { style: ToastNotificationStyleType.WARNING);
"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 {
state.reloadState(showLoader: false); 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) { } catch (ex) {
if (getEnv('APP_DEBUG', defaultValue: true)) {
NyLogger.error(ex.toString());
}
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops!"), title: trans(context, "Oops!"),

View File

@ -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/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.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 // ignore: must_be_immutable
class AppBuild extends StatelessWidget { class AppBuild extends StatelessWidget {
final String initialRoute; String initialRoute;
Brightness defaultBrightness;
ThemeData themeData; ThemeData themeData;
ThemeData darkTheme; ThemeData darkTheme;
ThemeData lightTheme;
Locale locale; Locale locale;
String title; String title;
bool debugShowCheckedModeBanner; bool debugShowCheckedModeBanner;
@ -40,16 +28,15 @@ class AppBuild extends StatelessWidget {
InitialRouteListFactory onGenerateInitialRoutes; InitialRouteListFactory onGenerateInitialRoutes;
GlobalKey<NavigatorState> navigatorKey; GlobalKey<NavigatorState> navigatorKey;
final Route<dynamic> Function(RouteSettings settings) onGenerateRoute; Route<dynamic> Function(RouteSettings settings) onGenerateRoute;
AppBuild({ AppBuild({
Key key, Key key,
this.initialRoute, this.initialRoute,
this.title, this.title,
this.defaultBrightness, @required this.locale,
this.locale,
this.themeData, this.themeData,
this.onGenerateRoute, @required this.onGenerateRoute,
this.navigatorKey, this.navigatorKey,
this.onGenerateInitialRoutes, this.onGenerateInitialRoutes,
this.onUnknownRoute, this.onUnknownRoute,
@ -57,6 +44,7 @@ class AppBuild extends StatelessWidget {
this.builder, this.builder,
this.onGenerateTitle, this.onGenerateTitle,
this.color, this.color,
this.lightTheme,
this.darkTheme, this.darkTheme,
this.themeMode = ThemeMode.system, this.themeMode = ThemeMode.system,
this.supportedLocales = const <Locale>[Locale('en', 'US')], this.supportedLocales = const <Locale>[Locale('en', 'US')],
@ -72,45 +60,56 @@ class AppBuild extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AdaptiveTheme( return ThemeProvider(
light: themeData, themes: [
dark: darkTheme, AppTheme(
initial: AdaptiveThemeMode.light, id: "default_light_theme",
builder: (theme, darkTheme) => ValueListenableBuilder( data: this.lightTheme ?? ThemeData.fallback(),
valueListenable: ValueNotifier(locale), description: 'Light theme'),
builder: (context, Locale locale, _) => MaterialApp( AppTheme(
navigatorKey: navigatorKey, id: "default_dark_theme",
themeMode: themeMode, data: this.darkTheme ?? ThemeData.fallback(),
onGenerateTitle: onGenerateTitle, description: 'Dark theme'),
onGenerateInitialRoutes: onGenerateInitialRoutes, ],
onUnknownRoute: onUnknownRoute, child: ThemeConsumer(
builder: builder, child: Builder(
navigatorObservers: navigatorObservers, builder: (themeContext) => ValueListenableBuilder(
color: color, valueListenable: ValueNotifier(locale),
supportedLocales: supportedLocales, builder: (context, Locale locale, _) => MaterialApp(
debugShowMaterialGrid: debugShowMaterialGrid, navigatorKey: navigatorKey,
showPerformanceOverlay: showPerformanceOverlay, themeMode: themeMode,
checkerboardRasterCacheImages: checkerboardRasterCacheImages, onGenerateTitle: onGenerateTitle,
checkerboardOffscreenLayers: checkerboardOffscreenLayers, onGenerateInitialRoutes: onGenerateInitialRoutes,
showSemanticsDebugger: showSemanticsDebugger, onUnknownRoute: onUnknownRoute,
debugShowCheckedModeBanner: debugShowCheckedModeBanner, builder: builder,
shortcuts: shortcuts, navigatorObservers: navigatorObservers,
actions: actions, color: color,
title: title ?? "", supportedLocales: supportedLocales,
darkTheme: darkTheme, debugShowMaterialGrid: debugShowMaterialGrid,
initialRoute: initialRoute, showPerformanceOverlay: showPerformanceOverlay,
onGenerateRoute: this.onGenerateRoute, checkerboardRasterCacheImages: checkerboardRasterCacheImages,
locale: locale, checkerboardOffscreenLayers: checkerboardOffscreenLayers,
theme: theme, showSemanticsDebugger: showSemanticsDebugger,
localizationsDelegates: [ debugShowCheckedModeBanner: debugShowCheckedModeBanner,
AppLocalizations.delegate, shortcuts: shortcuts,
GlobalWidgetsLocalizations.delegate, actions: actions,
GlobalMaterialLocalizations.delegate title: title ?? "",
], darkTheme: darkTheme,
localeResolutionCallback: initialRoute: initialRoute,
(Locale locale, Iterable<Locale> supportedLocales) { onGenerateRoute: this.onGenerateRoute,
return locale; locale: locale,
}, theme: themeData ?? ThemeProvider.themeOf(themeContext).data,
localizationsDelegates: [
AppLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate
],
localeResolutionCallback:
(Locale locale, Iterable<Locale> supportedLocales) {
return locale;
},
),
),
), ),
), ),
); );

View File

@ -1,7 +1,6 @@
import 'package:flutter_app/app/models/payment_type.dart'; 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/cash_on_delivery.dart';
import 'package:flutter_app/app/providers/paypal_pay.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/app/providers/stripe_pay.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
@ -14,8 +13,8 @@ import 'package:flutter_app/bootstrap/helpers.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
const app_payment_gateways = ["Stripe"]; const app_payment_gateways = ["Stripe", "CashOnDelivery", "PayPal"];
// Available: "Stripe", "CashOnDelivery", "RazorPay", "PayPal" // Available: "Stripe", "CashOnDelivery", "PayPal"
// e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery. // e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery.
List<PaymentType> paymentTypeList = [ List<PaymentType> paymentTypeList = [
@ -35,14 +34,6 @@ List<PaymentType> paymentTypeList = [
pay: cashOnDeliveryPay, pay: cashOnDeliveryPay,
), ),
addPayment(
id: 3,
name: "RazorPay",
desc: "Debit or Credit Card",
assetImage: "razorpay.png",
pay: razorPay,
),
addPayment( addPayment(
id: 4, id: 4,
name: "PayPal", name: "PayPal",

View File

@ -1,62 +1,43 @@
import 'package:flutter/material.dart'; 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'; 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(); final TextStyle appThemeFont = GoogleFonts.overpass();
// Theme colors // e.g. custom font in pubspec.yaml - https://flutter.dev/docs/cookbook/design/fonts
class AppColors { // final TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo");
// MAIN
Color _mainLightColor = Color(0xFF232c33);
Color _mainDarkColor = Color(0xFFFAFAFA);
// SECONDARY /*
Color _secondLightColor = Color(0xFF232c33); |--------------------------------------------------------------------------
Color _secondDarkColor = Color(0xFFF1F1F1); | Theme Colors
|
| Customize your theme's light and dark themes: /lib/config/styles/
|--------------------------------------------------------------------------
*/
// ACCENT class NyColors {
Color _accentLightColor = Color(0xFF465f81); // Light Colors
Color _accentDarkColor = Color(0xFF4a4a4a); static LightThemeColors light = LightThemeColors();
// SCAFFOLD // Dark Colors
Color _scaffoldDarkColor = Color(0xFF2C2C2C); static DarkThemeColors dark = DarkThemeColors();
Color _scaffoldLightColor = Color(0xFFFAFAFA);
}
class AppTheme extends AppColors { /// helper to find correct theme from the [context].
Color mainColor( static BaseStyles of(BuildContext context) {
{double opacity = 1, Brightness brightness = Brightness.light}) { return ((Theme.of(context).brightness == Brightness.dark) ? dark : light);
return (brightness == Brightness.light
? _mainLightColor.withOpacity(opacity)
: _mainDarkColor.withOpacity(opacity));
}
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));
} }
} }

View File

@ -5,22 +5,17 @@ import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:flutter_app/config/app_locale.dart'; import 'package:flutter_app/config/app_locale.dart';
import 'package:flutter_app/resources/themes/dark_theme.dart'; import 'package:flutter_app/resources/themes/dark_theme.dart';
import 'package:flutter_app/resources/themes/default_theme.dart'; import 'package:flutter_app/resources/themes/light_theme.dart';
import 'package:flutter_app/config/app_theme.dart';
import 'package:flutter_app/routes/router.dart'; import 'package:flutter_app/routes/router.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
import 'package:nylo_support/nylo.dart'; import 'package:nylo_support/nylo.dart';
import 'package:nylo_framework/nylo_framework.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:woosignal/models/response/woosignal_app.dart';
import 'package:wp_json_api/wp_json_api.dart'; import 'package:wp_json_api/wp_json_api.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
AppTheme appTheme = AppTheme(); Nylo nylo = await Nylo.init(router: appRouter());
Nylo nylo =
await initNylo(theme: defaultTheme(appTheme), router: buildRouter());
await SystemChrome.setPreferredOrientations([ await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp, DeviceOrientation.portraitUp,
@ -43,12 +38,10 @@ void main() async {
); );
} }
if (locale == null) { if (locale == null && wooSignalApp.locale != null) {
if (wooSignalApp.locale != null) { locale = Locale(wooSignalApp.locale);
locale = Locale(wooSignalApp.locale); } else {
} else { locale = Locale(getEnv('DEFAULT_LOCALE', defaultValue: 'en'));
locale = Locale(getEnv('DEFAULT_LOCALE', defaultValue: 'en'));
}
} }
} }
@ -56,8 +49,8 @@ void main() async {
AppBuild( AppBuild(
navigatorKey: nylo.router.navigatorKey, navigatorKey: nylo.router.navigatorKey,
onGenerateRoute: nylo.router.generator(), onGenerateRoute: nylo.router.generator(),
themeData: CurrentTheme.instance.theme, lightTheme: lightTheme(),
darkTheme: darkTheme(appTheme), darkTheme: darkTheme(),
locale: locale, locale: locale,
initialRoute: initialRoute, initialRoute: initialRoute,
supportedLocales: app_locales_supported, supportedLocales: app_locales_supported,

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
@ -33,8 +33,6 @@ class AccountBillingDetailsPage extends StatefulWidget {
class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> { class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
_AccountBillingDetailsPageState(); _AccountBillingDetailsPageState();
AppTheme _appTheme = AppTheme();
// BILLING TEXT CONTROLLERS // BILLING TEXT CONTROLLERS
TextEditingController _txtShippingFirstName = TextEditingController(), TextEditingController _txtShippingFirstName = TextEditingController(),
_txtShippingLastName = TextEditingController(), _txtShippingLastName = TextEditingController(),
@ -75,14 +73,12 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Billing Details"), trans(context, "Billing Details")
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),
@ -165,13 +161,12 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveTheme.isLight color: (Theme.of(context).brightness == Brightness.light)
? Colors.white ? NyColors.light.background
: _appTheme.accentColor( : NyColors.dark.primaryAccent,
brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
adaptiveTheme.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
), ),

View File

@ -8,12 +8,13 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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:bubble_tab_indicator/bubble_tab_indicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.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/app_loader_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -100,10 +101,9 @@ class _AccountDetailPageState extends State<AccountDetailPage>
new Tab(text: trans(context, "Orders")), new Tab(text: trans(context, "Orders")),
new Tab(text: trans(context, "Settings")), new Tab(text: trans(context, "Settings")),
]; ];
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
leading: widget.showLeadingBackButton ? Container( leading: widget.showLeadingBackButton ? Container(
child: IconButton( child: IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
@ -112,8 +112,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
margin: EdgeInsets.only(left: 0), margin: EdgeInsets.only(left: 0),
) : Container(), ) : Container(),
title: Text( title: Text(
trans(context, "Account"), trans(context, "Account")
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),
@ -206,9 +205,8 @@ class _AccountDetailPageState extends State<AccountDetailPage>
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
boxShadow: adaptiveTheme.isLight ? wsBoxShadow() : null, boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: color: NyColors.of(context).backgroundContainer,
adaptiveTheme.isLight ? Colors.white : Colors.white70,
), ),
), ),
Expanded(child: _activeBody), Expanded(child: _activeBody),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/app/models/user.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'; import 'package:wp_json_api/wp_json_api.dart';
class AccountLandingPage extends StatefulWidget { class AccountLandingPage extends StatefulWidget {
AccountLandingPage(); final bool showBackButton;
AccountLandingPage({this.showBackButton = true});
@override @override
_AccountLandingPageState createState() => _AccountLandingPageState(); _AccountLandingPageState createState() => _AccountLandingPageState();
@ -37,7 +38,6 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
bool _hasTappedLogin = false; bool _hasTappedLogin = false;
TextEditingController _tfEmailController = TextEditingController(), TextEditingController _tfEmailController = TextEditingController(),
_tfPasswordController = TextEditingController(); _tfPasswordController = TextEditingController();
AppTheme _appTheme = AppTheme();
@override @override
void initState() { void initState() {
@ -46,7 +46,6 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: SafeArea( body: SafeArea(
@ -79,10 +78,8 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
boxShadow: adaptiveTheme.isLight ? wsBoxShadow() : null, boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: adaptiveTheme.isLight color: NyColors.of(context).backgroundContainer,
? Colors.white
: _appTheme.accentColor(brightness: Brightness.dark),
), ),
padding: EdgeInsets.symmetric(vertical: 18, horizontal: 8), padding: EdgeInsets.symmetric(vertical: 18, horizontal: 8),
margin: EdgeInsets.symmetric(horizontal: 16), margin: EdgeInsets.symmetric(horizontal: 16),
@ -117,7 +114,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
Icon( Icon(
Icons.account_circle, Icons.account_circle,
color: color:
adaptiveTheme.isLight ? Colors.black38 : Colors.white70, (Theme.of(context).brightness == Brightness.light) ? Colors.black38 : Colors.white70,
), ),
Padding( Padding(
child: Text( child: Text(
@ -143,12 +140,17 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
"No URL found for \"forgot password\".\nAdd your forgot password URL here https://woosignal.com/dashboard/apps"); "No URL found for \"forgot password\".\nAdd your forgot password URL here https://woosignal.com/dashboard/apps");
} }
}), }),
Divider(), widget.showBackButton ? Column(
LinkButton( children: [
title: trans(context, "Back"), Divider(),
action: () => Navigator.pop(context), LinkButton(
), title: trans(context, "Back"),
], action: () => Navigator.pop(context),
),
],
) : Padding(padding: EdgeInsets.only(bottom: 20),)
].where((element) => element != null).toList(),
), ),
), ),
); );

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/app/controllers/account_order_detail_controller.dart'; import 'package:flutter_app/app/controllers/account_order_detail_controller.dart';
@ -44,10 +44,9 @@ class _AccountOrderDetailPageState extends NyState<AccountOrderDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
leading: Container( leading: Container(
child: IconButton( child: IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
@ -56,8 +55,7 @@ class _AccountOrderDetailPageState extends NyState<AccountOrderDetailPage> {
margin: EdgeInsets.only(left: 0), margin: EdgeInsets.only(left: 0),
), ),
title: Text( title: Text(
"${trans(context, "Order").capitalize()} #${_orderId.toString()}", "${trans(context, "Order").capitalize()} #${_orderId.toString()}"
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),
@ -110,8 +108,8 @@ class _AccountOrderDetailPageState extends NyState<AccountOrderDetailPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
boxShadow: boxShadow:
adaptiveThemeMode.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: adaptiveThemeMode.isLight color: (Theme.of(context).brightness == Brightness.light)
? Colors.white ? Colors.white
: Color(0xFF2C2C2C), : Color(0xFF2C2C2C),
), ),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/app/models/user.dart'; import 'package:flutter_app/app/models/user.dart';
import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/app_helper.dart';
@ -54,17 +54,15 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
leading: IconButton( leading: IconButton(
icon: Icon(Icons.close), icon: Icon(Icons.close),
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
title: Text( title: Text(
"Register", trans(context, "Register")
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),
@ -131,7 +129,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
style: TextStyle(fontWeight: FontWeight.bold)), style: TextStyle(fontWeight: FontWeight.bold)),
], ],
style: TextStyle( style: TextStyle(
color: adaptiveTheme.isLight color: (Theme.of(context).brightness == Brightness.light)
? Colors.black45 ? Colors.black45
: Colors.white70), : Colors.white70),
), ),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
@ -34,8 +34,6 @@ class _AccountShippingDetailsPageState
extends State<AccountShippingDetailsPage> { extends State<AccountShippingDetailsPage> {
_AccountShippingDetailsPageState(); _AccountShippingDetailsPageState();
AppTheme _appTheme = AppTheme();
// BILLING TEXT CONTROLLERS // BILLING TEXT CONTROLLERS
TextEditingController _txtShippingFirstName = TextEditingController(), TextEditingController _txtShippingFirstName = TextEditingController(),
_txtShippingLastName = TextEditingController(), _txtShippingLastName = TextEditingController(),
@ -91,14 +89,12 @@ class _AccountShippingDetailsPageState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Shipping Details"), trans(context, "Shipping Details")
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),
@ -182,13 +178,12 @@ class _AccountShippingDetailsPageState
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveTheme.isLight color: (Theme.of(context).brightness == Brightness.light)
? Colors.white ? NyColors.light.background
: _appTheme.accentColor( : NyColors.dark.primaryAccent,
brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
adaptiveTheme.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
), ),

View File

@ -83,15 +83,13 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Column( title: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text(trans(context, "Browse"), Text(trans(context, "Browse"),
style: Theme.of(context).textTheme.subtitle1), style: Theme.of(context).textTheme.subtitle1),
Text(parseHtmlString(productCategory.name), Text(parseHtmlString(productCategory.name))
style: Theme.of(context).textTheme.headline6)
], ],
), ),
centerTitle: true, centerTitle: true,

View File

@ -77,15 +77,13 @@ class _BrowseSearchState extends NyState<BrowseSearchPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Column( title: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text(trans(context, "Search results for"), Text(trans(context, "Search results for"),
style: Theme.of(context).textTheme.subtitle1), style: Theme.of(context).textTheme.subtitle1),
Text("\"" + _search + "\"", Text("\"" + _search + "\"")
style: Theme.of(context).textTheme.headline6)
], ],
), ),
centerTitle: true, centerTitle: true,

View File

@ -187,9 +187,7 @@ class _CartPageState extends State<CartPage> {
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Shopping Cart"), trans(context, "Shopping Cart"),
style: Theme.of(context).appBarTheme.textTheme.headline6,
), ),
textTheme: Theme.of(context).textTheme,
elevation: 1, elevation: 1,
actions: <Widget>[ actions: <Widget>[
InkWell( InkWell(
@ -199,7 +197,7 @@ class _CartPageState extends State<CartPage> {
child: Padding( child: Padding(
child: Text( child: Text(
trans(context, "Clear Cart"), trans(context, "Clear Cart"),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText2,
), ),
padding: EdgeInsets.only(right: 8), padding: EdgeInsets.only(right: 8),
), ),

View File

@ -8,7 +8,6 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/app/models/cart.dart'; import 'package:flutter_app/app/models/cart.dart';
import 'package:flutter_app/app/models/checkout_session.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/app/models/customer_country.dart';
import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/bootstrap/helpers.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/app_loader_widget.dart';
import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
@ -178,16 +178,10 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Checkout"), trans(context, "Checkout")
style: Theme.of(context)
.textTheme
.subtitle1
.copyWith(fontWeight: FontWeight.bold),
), ),
centerTitle: true, centerTitle: true,
), ),
@ -203,12 +197,10 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10), padding: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveThemeMode.isLight color: NyColors.of(context).backgroundContainer,
? Colors.white
: Colors.white54,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
adaptiveThemeMode.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
), ),
margin: EdgeInsets.only(top: 5, bottom: 5), margin: EdgeInsets.only(top: 5, bottom: 5),
child: Column( child: Column(
@ -217,7 +209,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: adaptiveThemeMode.isLight boxShadow: (Theme.of(context).brightness == Brightness.light)
? wsBoxShadow(blurRadius: 10) ? wsBoxShadow(blurRadius: 10)
: null, : null,
color: Colors.transparent, color: Colors.transparent,
@ -258,13 +250,13 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
(CheckoutSession.getInstance.paymentType != null (CheckoutSession.getInstance.paymentType != null
? wsCheckoutRow(context, ? wsCheckoutRow(context,
heading: trans(context, "Payment method"), heading: trans(context, "Payment method"),
leadImage: Image.asset( leadImage: Container(
getImageAsset(CheckoutSession color: Colors.white,
.getInstance.paymentType.assetImage), child: Image.asset(
width: 70, getImageAsset(CheckoutSession
color: adaptiveThemeMode.isLight .getInstance.paymentType.assetImage),
? null width: 70,
: Colors.white, ),
), ),
leadTitle: CheckoutSession leadTitle: CheckoutSession
.getInstance.paymentType.desc, .getInstance.paymentType.desc,
@ -386,7 +378,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
return; return;
} }
if (_wooSignalApp.disableShipping == 1 && if (_wooSignalApp.disableShipping == 0 &&
CheckoutSession.getInstance.shippingType == null) { CheckoutSession.getInstance.shippingType == null) {
showToastNotification( showToastNotification(
context, context,
@ -411,7 +403,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
return; return;
} }
if (_wooSignalApp.disableShipping != 1 && if (_wooSignalApp.disableShipping == 0 &&
CheckoutSession.getInstance.shippingType?.minimumValue != null) { CheckoutSession.getInstance.shippingType?.minimumValue != null) {
String total = await Cart.getInstance.getTotal(); String total = await Cart.getInstance.getTotal();
if (total == null) { if (total == null) {

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/app/models/billing_details.dart'; import 'package:flutter_app/app/models/billing_details.dart';
import 'package:flutter_app/app/models/checkout_session.dart'; import 'package:flutter_app/app/models/checkout_session.dart';
@ -34,7 +34,6 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
bool _hasDifferentShippingAddress = false, valRememberDetails = true; bool _hasDifferentShippingAddress = false, valRememberDetails = true;
int activeTabIndex = 0; int activeTabIndex = 0;
AppTheme _appTheme = AppTheme();
// TEXT CONTROLLERS // TEXT CONTROLLERS
TextEditingController TextEditingController
@ -158,14 +157,11 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Billing & Shipping Details"), trans(context, "Billing & Shipping Details"),
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),
@ -229,13 +225,10 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
fit: FlexFit.tight, fit: FlexFit.tight,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveThemeMode.isLight color: NyColors.of(context).backgroundContainer,
? Colors.white
: _appTheme.accentColor(
brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
adaptiveThemeMode.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
), ),
padding: EdgeInsets.only(left: 8, right: 8, top: 8), padding: EdgeInsets.only(left: 8, right: 8, top: 8),
child: (activeTab ?? tabBillingDetails()), child: (activeTab ?? tabBillingDetails()),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/app/models/checkout_session.dart'; import 'package:flutter_app/app/models/checkout_session.dart';
import 'package:flutter_app/app/models/payment_type.dart'; import 'package:flutter_app/app/models/payment_type.dart';
@ -29,8 +29,6 @@ class CheckoutPaymentTypePage extends StatefulWidget {
class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> { class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
_CheckoutPaymentTypePageState(); _CheckoutPaymentTypePageState();
AppTheme _appTheme = AppTheme();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -44,14 +42,12 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Payment Method"), trans(context, "Payment Method")
style: Theme.of(context).textTheme.headline6,
), ),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
centerTitle: true, centerTitle: true,
@ -91,14 +87,18 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
left: 8, left: 8,
right: 8, right: 8,
), ),
leading: Image.asset( leading: Container(
getImageAsset(paymentType.assetImage), decoration: BoxDecoration(
width: 60, color: Colors.white
color: adaptiveThemeMode.isLight ),
? null padding: EdgeInsets.all(4),
: Colors.white, child: Image.asset(
fit: BoxFit.contain, getImageAsset(paymentType.assetImage),
alignment: Alignment.center), width: 60,
fit: BoxFit.contain,
alignment: Alignment.center,
),
),
title: Text(paymentType.desc, title: Text(paymentType.desc,
style: style:
Theme.of(context).textTheme.subtitle1), Theme.of(context).textTheme.subtitle1),
@ -127,12 +127,10 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveThemeMode.isLight color: NyColors.of(context).backgroundContainer,
? Colors.white
: _appTheme.accentColor(brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
adaptiveThemeMode.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
), ),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/app/models/cart.dart'; import 'package:flutter_app/app/models/cart.dart';
import 'package:flutter_app/app/models/cart_line_item.dart'; import 'package:flutter_app/app/models/cart_line_item.dart';
@ -35,7 +35,6 @@ class CheckoutShippingTypePage extends StatefulWidget {
class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> { class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
_CheckoutShippingTypePageState(); _CheckoutShippingTypePageState();
AppTheme _appTheme = AppTheme();
bool _isShippingSupported = true, _isLoading = true; bool _isShippingSupported = true, _isLoading = true;
List<Map<String, dynamic>> _wsShippingOptions = []; List<Map<String, dynamic>> _wsShippingOptions = [];
WSShipping _shipping; WSShipping _shipping;
@ -235,14 +234,11 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Shipping Methods"), trans(context, "Shipping Methods")
style: Theme.of(context).textTheme.headline6,
), ),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
centerTitle: true, centerTitle: true,
@ -261,7 +257,7 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
child: Image.asset( child: Image.asset(
getImageAsset('shipping_icon.png'), getImageAsset('shipping_icon.png'),
height: 100, height: 100,
color: adaptiveThemeMode.isLight ? null : Colors.white, color: (Theme.of(context).brightness == Brightness.light) ? null : Colors.white,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
), ),
), ),
@ -395,12 +391,10 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveThemeMode.isLight color: NyColors.of(context).backgroundContainer,
? Colors.white
: _appTheme.accentColor(brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
adaptiveThemeMode.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
), ),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/app/controllers/checkout_status_controller.dart'; import 'package:flutter_app/app/controllers/checkout_status_controller.dart';
import 'package:flutter_app/app/models/cart.dart'; import 'package:flutter_app/app/models/cart.dart';
@ -43,7 +43,7 @@ class _CheckoutStatusState extends NyState<CheckoutStatusPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: 0.0, elevation: 0.0,
@ -94,7 +94,7 @@ class _CheckoutStatusState extends NyState<CheckoutStatusPage> {
border: Border( border: Border(
bottom: BorderSide(color: Colors.black12, width: 1.0), 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), padding: EdgeInsets.only(bottom: 20),
), ),
Container( Container(
@ -164,7 +164,7 @@ class _CheckoutStatusState extends NyState<CheckoutStatusPage> {
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
color: color:
adaptiveThemeMode.isLight ? Colors.white : null); (Theme.of(context).brightness == Brightness.light) ? Colors.white : null);
}), }),
), ),
Align( Align(

View File

@ -44,10 +44,8 @@ class _CustomerCountriesPageState extends State<CustomerCountriesPage> {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text( title: Text(
trans(context, "Select a country"), trans(context, "Select a country")
style: Theme.of(context).textTheme.headline6,
), ),
centerTitle: true, centerTitle: true,
), ),

View File

@ -47,7 +47,6 @@ class _HomeSearchPageState extends State<HomeSearchPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
title: StoreLogo(height: 55), title: StoreLogo(height: 55),
centerTitle: true, centerTitle: true,
), ),

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
import 'package:flutter_app/app/controllers/product_detail_controller.dart'; import 'package:flutter_app/app/controllers/product_detail_controller.dart';
@ -42,7 +42,6 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
int _quantityIndicator = 1; int _quantityIndicator = 1;
List<WS.ProductVariation> _productVariations = []; List<WS.ProductVariation> _productVariations = [];
Map<int, dynamic> _tmpAttributeObj = {}; Map<int, dynamic> _tmpAttributeObj = {};
AppTheme _appTheme = AppTheme();
@override @override
widgetDidLoad() async { widgetDidLoad() async {
@ -283,14 +282,12 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.transparent,
actions: <Widget>[ actions: <Widget>[
CartIconWidget(), CartIconWidget(),
], ],
title: StoreLogo(height: 55, showBgWhite: !adaptiveTheme.isLight), title: StoreLogo(height: 55, showBgWhite: (Theme.of(context).brightness == Brightness.dark)),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeArea(
@ -309,7 +306,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
child: Swiper( child: Swiper(
itemBuilder: (BuildContext context, int index) => itemBuilder: (BuildContext context, int index) =>
CachedImageWidget( CachedImageWidget(
image: _product.images[index].src, image: _product.images.length != 0 ? _product.images[index].src : getEnv("PRODUCT_PLACEHOLDER_IMAGE"),
), ),
itemCount: _product.images.length == 0 itemCount: _product.images.length == 0
? 1 ? 1
@ -381,9 +378,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveTheme.isLight color: NyColors.of(context).background,
? Colors.white
: Colors.black26,
// boxShadow: wsBoxShadow(), // boxShadow: wsBoxShadow(),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
@ -444,10 +439,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveTheme.isLight color: NyColors.of(context).background,
? Colors.white
: _appTheme.scaffoldColor(
brightness: Brightness.dark),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black12, color: Colors.black12,

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/config/app_theme.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) { ThemeData darkTheme() {
return TextTheme( TextTheme darkTheme =
headline5: TextStyle( getAppTextTheme(appThemeFont, defaultTextTheme.merge(_darkTextTheme()));
fontSize: 22.0, return ThemeData(
color: appTheme.secondColor(brightness: Brightness.dark), 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( textButtonTheme: TextButtonThemeData(
fontSize: 24.0, style: TextButton.styleFrom(primary: NyColors.dark.primaryContent),
fontWeight: FontWeight.w600,
color: appTheme.secondColor(brightness: Brightness.dark),
), ),
headline3: TextStyle( elevatedButtonTheme: ElevatedButtonThemeData(
fontSize: 26.0, style: TextButton.styleFrom(
fontWeight: FontWeight.w700, primary: NyColors.dark.buttonPrimaryContent,
color: appTheme.secondColor(brightness: Brightness.dark), backgroundColor: NyColors.dark.buttonBackground),
), ),
headline2: TextStyle( inputDecorationTheme: InputDecorationTheme(
fontSize: 28.0, focusedBorder:UnderlineInputBorder(
fontWeight: FontWeight.w600, borderSide:BorderSide(color: Colors.black)
color: appTheme.mainColor(brightness: Brightness.dark), ),
), ),
headline1: TextStyle( bottomNavigationBarTheme: BottomNavigationBarThemeData(
fontSize: 36.0, backgroundColor: NyColors.dark.bottomTabBarBackground,
fontWeight: FontWeight.w300, unselectedIconTheme:
color: appTheme.secondColor(brightness: Brightness.dark), IconThemeData(color: NyColors.dark.bottomTabBarIconUnselected),
), selectedIconTheme:
subtitle2: TextStyle( IconThemeData(color: NyColors.dark.bottomTabBarIconSelected),
fontSize: 14.0, unselectedLabelStyle:
fontWeight: FontWeight.w500, TextStyle(color: NyColors.dark.bottomTabBarLabelUnselected),
color: appTheme.secondColor(brightness: Brightness.dark), selectedLabelStyle:
), TextStyle(color: NyColors.dark.bottomTabBarLabelSelected),
subtitle1: TextStyle( selectedItemColor: NyColors.dark.bottomTabBarLabelSelected,
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),
), ),
textTheme: darkTheme,
textSelectionTheme: TextSelectionThemeData(cursorColor: NyColors.dark.inputPrimaryContent),
); );
} }
ThemeData darkTheme(AppTheme appTheme) => ThemeData( /*
primaryColor: appTheme.mainColor(brightness: Brightness.dark), |--------------------------------------------------------------------------
backgroundColor: Colors.white, | Dark Text Theme
brightness: Brightness.dark, |--------------------------------------------------------------------------
accentColor: appTheme.accentColor(brightness: Brightness.dark), */
iconTheme: IconThemeData(
color: appTheme.secondColor(brightness: Brightness.dark)), TextTheme _darkTextTheme() {
primaryColorLight: appTheme.accentColor( final Color darkPrimaryContent = NyColors.dark.primaryContent;
brightness: Brightness.light, return TextTheme(
), headline6: TextStyle(
primaryColorDark: appTheme.accentColor( color: darkPrimaryContent.withOpacity(0.8),
brightness: Brightness.dark, ),
), headline5: TextStyle(
primaryTextTheme: _defaultTextTheme(appTheme).copyWith( color: darkPrimaryContent,
bodyText2: ),
TextStyle(color: Colors.white70, fontWeight: FontWeight.bold), headline4: TextStyle(
bodyText1: color: darkPrimaryContent,
TextStyle(color: Colors.grey, fontWeight: FontWeight.bold)), ),
accentColorBrightness: Brightness.dark, headline3: TextStyle(
accentTextTheme: _defaultTextTheme(appTheme).apply( color: darkPrimaryContent,
bodyColor: appTheme.accentColor(brightness: Brightness.dark), ),
displayColor: appTheme.accentColor(brightness: Brightness.dark), headline2: TextStyle(
), color: darkPrimaryContent,
focusColor: appTheme.accentColor(brightness: Brightness.dark), ),
scaffoldBackgroundColor: headline1: TextStyle(
appTheme.scaffoldColor(brightness: Brightness.dark), color: darkPrimaryContent,
hintColor: appTheme.secondColor(brightness: Brightness.dark), ),
appBarTheme: AppBarTheme( subtitle2: TextStyle(
textTheme: getAppTextTheme(appThemeFont, _defaultTextTheme(appTheme)), color: darkPrimaryContent,
color: ),
appTheme.scaffoldColor(brightness: Brightness.dark, opacity: 0.5), subtitle1: TextStyle(
iconTheme: IconThemeData( color: darkPrimaryContent,
color: appTheme.mainColor(brightness: Brightness.dark)), ),
elevation: 1.0, overline: TextStyle(
brightness: Brightness.dark, color: darkPrimaryContent,
), ),
buttonColor: Colors.white, button: TextStyle(
buttonTheme: ButtonThemeData( color: darkPrimaryContent.withOpacity(0.8),
buttonColor: appTheme.accentColor(), ),
), bodyText2: TextStyle(
textTheme: getAppTextTheme(appThemeFont, _defaultTextTheme(appTheme)), color: darkPrimaryContent.withOpacity(0.8),
); ),
bodyText1: TextStyle(
color: NyColors.dark.primaryContent,
),
caption: TextStyle(
color: darkPrimaryContent.withOpacity(0.8),
),
);
}

View File

@ -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),
);
}

View File

@ -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,
),
);
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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,
),
);

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -18,10 +18,9 @@ class AppLoaderWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode; bool isDark = (Theme.of(context).brightness == Brightness.dark);
return SpinKitDoubleBounce( return SpinKitDoubleBounce(
color: color: HexColor(!isDark ? "#424242" : "#c7c7c7")
adaptiveThemeMode.isLight ? HexColor("#424242") : HexColor("#c7c7c7"),
); );
} }
} }

View File

@ -33,7 +33,7 @@ class AppVersionWidget extends StatelessWidget {
"${trans(context, "Version")}: ${snapshot.data.version}", "${trans(context, "Version")}: ${snapshot.data.version}",
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText1 .bodyText2
.copyWith(fontWeight: FontWeight.w300)), .copyWith(fontWeight: FontWeight.w300)),
padding: EdgeInsets.only(top: 15, bottom: 15), padding: EdgeInsets.only(top: 15, bottom: 15),
); );

View File

@ -30,7 +30,7 @@ class PrimaryButton extends StatelessWidget {
textStyle: Theme.of(context) textStyle: Theme.of(context)
.textTheme .textTheme
.button .button
.copyWith(fontSize: 16, fontWeight: FontWeight.bold), .copyWith(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white),
bgColor: HexColor("#529cda"), bgColor: HexColor("#529cda"),
); );
} }

View File

@ -21,6 +21,7 @@ class CachedImageWidget extends StatelessWidget {
child: CircularProgressIndicator( child: CircularProgressIndicator(
strokeWidth: 2, strokeWidth: 2,
backgroundColor: Colors.black12, backgroundColor: Colors.black12,
color: Colors.black54
), ),
), ),
this.fit = BoxFit.contain, this.fit = BoxFit.contain,

View File

@ -55,7 +55,7 @@ class _CartIconWidgetState extends State<CartIconWidget> {
} }
return Text( return Text(
cartValue, cartValue,
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
); );
} }

View File

@ -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/app/models/customer_address.dart';
import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:nylo_framework/nylo_framework.dart';
import 'dart:async'; import 'dart:async';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
import 'package:nylo_support/widgets/ny_state.dart'; import 'package:nylo_support/widgets/ny_state.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
class PayPalCheckout extends StatefulWidget { class PayPalCheckout extends StatefulWidget {
@ -25,7 +25,9 @@ class PayPalCheckout extends StatefulWidget {
} }
class WebViewState extends NyState<PayPalCheckout> { class WebViewState extends NyState<PayPalCheckout> {
final flutterWebViewPlugin = new FlutterWebviewPlugin(); final Completer<WebViewController> _controller =
Completer<WebViewController>();
String payerId = ''; String payerId = '';
int intCount = 0; int intCount = 0;
StreamSubscription<String> _onUrlChanged; StreamSubscription<String> _onUrlChanged;
@ -67,7 +69,7 @@ class WebViewState extends NyState<PayPalCheckout> {
} }
String getPayPalItemName() { String getPayPalItemName() {
return truncateString(widget.description, 124); return truncateString(widget.description.replaceAll(new RegExp(r'[^\w\s]+'),''), 124);
} }
String getPayPalPaymentType() { String getPayPalPaymentType() {
@ -84,33 +86,17 @@ class WebViewState extends NyState<PayPalCheckout> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
setCheckoutShippingAddress( setCheckoutShippingAddress(
CheckoutSession.getInstance.billingDetails.shippingAddress); CheckoutSession.getInstance.billingDetails.shippingAddress);
setState(() {}); 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 @override
void dispose() { void dispose() {
_onUrlChanged.cancel(); if (_onUrlChanged != null) {
flutterWebViewPlugin.dispose(); _onUrlChanged.cancel();
}
super.dispose(); super.dispose();
} }
@ -146,14 +132,39 @@ $formCheckoutShippingAddress
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WebviewScaffold( return Scaffold(
url: Uri.dataFromString(_loadHTML(), mimeType: 'text/html').toString(), resizeToAvoidBottomInset: false,
appBar: AppBar( body: SafeArea(
centerTitle: true, child: WebView(
automaticallyImplyLeading: false, initialUrl: Uri.dataFromString(_loadHTML(), mimeType: 'text/html').toString(),
title: Text( javascriptMode: JavascriptMode.unrestricted,
trans(context, "PayPal Checkout"), onWebViewCreated: (WebViewController webViewController) {
textAlign: TextAlign.center, _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,
), ),
), ),
); );

View File

@ -8,12 +8,14 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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/material.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.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/app_version_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.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:nylo_support/helpers/helper.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
@ -30,19 +32,17 @@ class HomeDrawerWidget extends StatefulWidget {
class _HomeDrawerWidgetState extends State<HomeDrawerWidget> { class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode; bool isDark = (Theme.of(context).brightness == Brightness.dark);
return Drawer( return Drawer(
child: Container( child: Container(
color: adaptiveTheme == AdaptiveThemeMode.light color: NyColors.of(context).background,
? Colors.white
: Color(0xFF2C2C2C),
child: ListView( child: ListView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
children: <Widget>[ children: <Widget>[
DrawerHeader( DrawerHeader(
child: Center(child: StoreLogo()), child: Center(child: StoreLogo()),
decoration: BoxDecoration( decoration: BoxDecoration(
color: adaptiveTheme.isLight ? Colors.white : Colors.black87, color: NyColors.of(context).background,
), ),
), ),
Padding( Padding(
@ -54,15 +54,20 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
), ),
if (widget.wooSignalApp.wpLoginEnabled == 1) if (widget.wooSignalApp.wpLoginEnabled == 1)
ListTile( 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), leading: Icon(Icons.account_circle),
onTap: _actionProfile, onTap: _actionProfile,
), ),
ListTile( 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), leading: Icon(Icons.shopping_cart),
onTap: _actionCart, onTap: _actionCart,
), ),
if (widget.wooSignalApp.appTermslink != null && widget.wooSignalApp.appPrivacylink != null)
Padding( Padding(
child: Text( child: Text(
trans(context, "About Us"), trans(context, "About Us"),
@ -73,7 +78,10 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
if (widget.wooSignalApp.appTermslink != null && if (widget.wooSignalApp.appTermslink != null &&
widget.wooSignalApp.appTermslink.isNotEmpty) widget.wooSignalApp.appTermslink.isNotEmpty)
ListTile( 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), leading: Icon(Icons.menu_book_rounded),
trailing: Icon(Icons.keyboard_arrow_right_rounded), trailing: Icon(Icons.keyboard_arrow_right_rounded),
onTap: _actionTerms, onTap: _actionTerms,
@ -81,25 +89,25 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
if (widget.wooSignalApp.appPrivacylink != null && if (widget.wooSignalApp.appPrivacylink != null &&
widget.wooSignalApp.appPrivacylink.isNotEmpty) widget.wooSignalApp.appPrivacylink.isNotEmpty)
ListTile( 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), trailing: Icon(Icons.keyboard_arrow_right_rounded),
leading: Icon(Icons.account_balance), leading: Icon(Icons.account_balance),
onTap: _actionPrivacy, onTap: _actionPrivacy,
), ),
ListTile( ListTile(
title: Text( title: Text(
adaptiveTheme.isDark trans(context, (isDark ? "Light Mode" : "Dark Mode")),
? trans(context, "Light Mode") style: Theme.of(context).textTheme.bodyText2.copyWith(
: trans(context, "Dark Mode"), fontSize: 16
)
), ),
leading: Icon(Icons.brightness_4_rounded), leading: Icon(Icons.brightness_4_rounded),
onTap: () { onTap: () {
if (adaptiveTheme.isDark) { setState(() {
AdaptiveTheme.of(context).setLight(); NyTheme.set(context, id: isDark ? "default_light_theme" : "default_dark_theme");
} else { });
AdaptiveTheme.of(context).setDark();
}
setState(() {});
}, },
), ),
ListTile( ListTile(

View File

@ -117,6 +117,7 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
onTap: _modalBottomSheetMenu, onTap: _modalBottomSheetMenu,
child: Text( child: Text(
trans(context, "Categories"), trans(context, "Categories"),
style: Theme.of(context).textTheme.bodyText2,
), ),
), ),
), ),

View File

@ -89,7 +89,7 @@ class _NoticThemeWidgetState extends State<NoticThemeWidget> {
} }
case 3: case 3:
{ {
activeWidget = (await authCheck()) ? AccountDetailPage(showLeadingBackButton: false) : AccountLandingPage(); activeWidget = (await authCheck()) ? AccountDetailPage(showLeadingBackButton: false) : AccountLandingPage(showBackButton: false,);
break; break;
} }
} }

View File

@ -36,7 +36,7 @@ class TopNavWidget extends StatelessWidget {
AutoSizeText( AutoSizeText(
trans(context, "Newest"), trans(context, "Newest"),
style: Theme.of(context) style: Theme.of(context)
.primaryTextTheme .textTheme
.bodyText2 .bodyText2
.copyWith(fontWeight: FontWeight.bold), .copyWith(fontWeight: FontWeight.bold),
maxLines: 1, maxLines: 1,

View File

@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 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:auto_size_text/auto_size_text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/app/models/checkout_session.dart';
import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/bootstrap/helpers.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/app_loader_widget.dart';
import 'package:flutter_app/resources/widgets/cached_image_widget.dart'; import 'package:flutter_app/resources/widgets/cached_image_widget.dart';
import 'package:flutter_app/resources/widgets/no_results_for_products_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: Padding(
child: Text( child: Text(
heading, heading,
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText1.copyWith(
color: NyColors.of(context).primaryContent
),
), ),
padding: EdgeInsets.only(bottom: 2), padding: EdgeInsets.only(bottom: 2),
), ),
@ -375,7 +378,9 @@ class ProductItemContainer extends StatelessWidget {
margin: const EdgeInsets.only(top: 2, bottom: 2), margin: const EdgeInsets.only(top: 2, bottom: 2),
child: Text( child: Text(
product.name, product.name,
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: 15
),
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
@ -438,7 +443,7 @@ class ProductItemContainer extends StatelessWidget {
wsModalBottom(BuildContext context, wsModalBottom(BuildContext context,
{String title, Widget bodyWidget, Widget extraWidget}) { {String title, Widget bodyWidget, Widget extraWidget}) {
AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
@ -451,9 +456,7 @@ wsModalBottom(BuildContext context,
child: new Container( child: new Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: adaptiveThemeMode.isLight color: NyColors.of(context).background,
? Colors.white
: Color(0xFF2C2C2C),
borderRadius: new BorderRadius.only( borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(10.0), topLeft: const Radius.circular(10.0),
topRight: const Radius.circular(10.0), topRight: const Radius.circular(10.0),
@ -476,10 +479,8 @@ wsModalBottom(BuildContext context,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: boxShadow:
adaptiveThemeMode.isLight ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: adaptiveThemeMode.isLight color: NyColors.of(context).background,
? Colors.white
: Color(0xFF4a4a4a),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: bodyWidget, child: bodyWidget,
@ -487,7 +488,8 @@ wsModalBottom(BuildContext context,
), ),
extraWidget ?? null extraWidget ?? null
].where((t) => t != null).toList(), ].where((t) => t != null).toList(),
)), ),
),
), ),
); );
}, },

View File

@ -29,7 +29,7 @@ import 'package:page_transition/page_transition.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
buildRouter() => nyCreateRoutes((router) { appRouter() => nyRoutes((router) {
router.route("/home", (context) => HomePage()); router.route("/home", (context) => HomePage());
router.route("/cart", (context) => CartPage()); router.route("/cart", (context) => CartPage());

View File

@ -7,21 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "21.0.0" version: "22.0.0"
adaptive_theme:
dependency: "direct main"
description:
name: adaptive_theme
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
analyzer: analyzer:
dependency: "direct main" dependency: "direct main"
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.0" version: "1.7.2"
animate_do: animate_do:
dependency: "direct main" dependency: "direct main"
description: description:
@ -42,14 +35,14 @@ packages:
name: args name: args
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.2.0"
async: async:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.6.1" version: "2.8.1"
auto_size_text: auto_size_text:
dependency: "direct main" dependency: "direct main"
description: description:
@ -91,7 +84,7 @@ packages:
name: cached_network_image_web name: cached_network_image_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -105,14 +98,14 @@ packages:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.3.1"
cli_util: cli_util:
dependency: transitive dependency: transitive
description: description:
name: cli_util name: cli_util
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.3.0" version: "0.3.3"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@ -133,7 +126,7 @@ packages:
name: convert name: convert
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -176,13 +169,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
eventify:
dependency: transitive
description:
name: eventify
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -196,14 +182,14 @@ packages:
name: ffi name: ffi
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.1.2"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.0" version: "6.1.2"
flare_dart: flare_dart:
dependency: transitive dependency: transitive
description: description:
@ -236,21 +222,21 @@ packages:
name: flutter_cache_manager name: flutter_cache_manager
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.1.2"
flutter_dotenv: flutter_dotenv:
dependency: transitive dependency: transitive
description: description:
name: flutter_dotenv name: flutter_dotenv
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.0" version: "5.0.2"
flutter_launcher_icons: flutter_launcher_icons:
dependency: "direct main" dependency: transitive
description: description:
name: flutter_launcher_icons name: flutter_launcher_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.0" version: "0.9.2"
flutter_localizations: flutter_localizations:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -269,21 +255,28 @@ packages:
name: flutter_secure_storage name: flutter_secure_storage
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.2.0" version: "4.2.1"
flutter_spinkit: flutter_spinkit:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_spinkit name: flutter_spinkit
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.0" version: "5.1.0"
flutter_staggered_grid_view: flutter_staggered_grid_view:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_staggered_grid_view name: flutter_staggered_grid_view
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted 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: flutter_styled_toast:
dependency: "direct main" dependency: "direct main"
description: description:
@ -309,19 +302,19 @@ packages:
name: flutter_web_browser name: flutter_web_browser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.14.0" version: "0.15.0"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: transitive
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_webview_plugin: freezed_annotation:
dependency: "direct main" dependency: transitive
description: description:
name: flutter_webview_plugin name: freezed_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.0" version: "0.14.3"
glob: glob:
dependency: transitive dependency: transitive
description: description:
@ -342,7 +335,7 @@ packages:
name: hexcolor name: hexcolor
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
html: html:
dependency: "direct main" dependency: "direct main"
description: description:
@ -356,7 +349,7 @@ packages:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.13.1" version: "0.13.3"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
@ -385,13 +378,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3" version: "0.6.3"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"
logger: logger:
dependency: transitive dependency: transitive
description: description:
name: logger name: logger
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.1.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -405,14 +405,14 @@ packages:
name: math_expressions name: math_expressions
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.2.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.7.0"
money_formatter: money_formatter:
dependency: "direct main" dependency: "direct main"
description: description:
@ -426,14 +426,14 @@ packages:
name: nylo_framework name: nylo_framework
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "2.0.4"
nylo_support: nylo_support:
dependency: "direct main" dependency: transitive
description: description:
name: nylo_support name: nylo_support
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "2.1.0"
octo_image: octo_image:
dependency: transitive dependency: transitive
description: description:
@ -461,7 +461,7 @@ packages:
name: page_transition name: page_transition
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.0.4"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -475,21 +475,21 @@ packages:
name: path_provider name: path_provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.3"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.2"
path_provider_macos: path_provider_macos:
dependency: transitive dependency: transitive
description: description:
name: path_provider_macos name: path_provider_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.2"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -503,28 +503,28 @@ packages:
name: path_provider_windows name: path_provider_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.3"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.11.0" version: "1.11.1"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
name: petitparser name: petitparser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.3.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
name: platform name: platform
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.2"
platform_alert_dialog: platform_alert_dialog:
dependency: "direct main" dependency: "direct main"
description: description:
@ -538,14 +538,14 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.1"
process: process:
dependency: transitive dependency: transitive
description: description:
name: process name: process
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.2.1" version: "4.2.3"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -560,41 +560,34 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" 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: rxdart:
dependency: transitive dependency: transitive
description: description:
name: rxdart name: rxdart
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.26.0" version: "0.27.2"
shared_preferences: shared_preferences:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.6" version: "2.0.7"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.2"
shared_preferences_macos: shared_preferences_macos:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_macos name: shared_preferences_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.2"
shared_preferences_platform_interface: shared_preferences_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -608,14 +601,14 @@ packages:
name: shared_preferences_web name: shared_preferences_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.2"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_windows name: shared_preferences_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.2"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -634,14 +627,14 @@ packages:
name: sqflite name: sqflite
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0+3" version: "2.0.0+4"
sqflite_common: sqflite_common:
dependency: transitive dependency: transitive
description: description:
name: sqflite_common name: sqflite_common
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0+2" version: "2.0.1+1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -670,6 +663,27 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" 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: synchronized:
dependency: transitive dependency: transitive
description: description:
@ -690,7 +704,14 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted 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: transformer_page_view:
dependency: transitive dependency: transitive
description: description:
@ -726,13 +747,41 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" 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: win32:
dependency: transitive dependency: transitive
description: description:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.5" version: "2.2.9"
woosignal: woosignal:
dependency: "direct main" dependency: "direct main"
description: description:
@ -740,20 +789,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" 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: wp_json_api:
dependency: "direct main" dependency: "direct main"
description: description:
name: wp_json_api name: wp_json_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.1.3"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
@ -767,7 +809,7 @@ packages:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.1.0" version: "5.3.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:
@ -776,5 +818,5 @@ packages:
source: hosted source: hosted
version: "3.1.0" version: "3.1.0"
sdks: sdks:
dart: ">=2.12.0 <3.0.0" dart: ">=2.14.0 <3.0.0"
flutter: ">=2.0.1" flutter: ">=2.5.0"

View File

@ -1,14 +1,14 @@
# Official WooSignal App Template for WooCommerce # Official WooSignal App Template for WooCommerce
# Label StoreMax # Label StoreMax
# Version: 5.1.0 # Version: 5.2.0
# Author: Anthony Gordon # Author: Anthony Gordon
# Homepage: https://woosignal.com # Homepage: https://woosignal.com
# Documentation: https://woosignal.com/docs/app/ios/label-storemax # Documentation: https://woosignal.com/docs/app/ios/label-storemax
### Change App Icon ### Change App Icon
# 1 Replace: public/assets/icon/appicon.png (1024px1024px icon size) # 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 ### Uploading the IOS/Android app
# IOS https://flutter.dev/docs/deployment/ios # IOS https://flutter.dev/docs/deployment/ios
@ -27,34 +27,30 @@ environment:
dependencies: dependencies:
google_fonts: ^2.1.0 google_fonts: ^2.1.0
analyzer: ^1.5.0 analyzer: ^1.5.0
adaptive_theme: ^2.2.0
intl: ^0.17.0 intl: ^0.17.0
page_transition: ^2.0.2 page_transition: ^2.0.4
nylo_framework: ^1.0.0 nylo_framework: ^2.0.4
nylo_support: ^1.0.0
woosignal: ^2.1.0 woosignal: ^2.1.0
woosignal_stripe: ^1.1.0 flutter_stripe: ^2.0.0
razorpay_flutter: ^1.2.5 wp_json_api: ^3.1.3
wp_json_api: ^3.0.0
cached_network_image: ^3.1.0 cached_network_image: ^3.1.0
package_info: ^2.0.2 package_info: ^2.0.2
money_formatter: ^0.0.3 money_formatter: ^0.0.3
platform_alert_dialog: ^1.0.0+2 platform_alert_dialog: ^1.0.0+2
flutter_web_browser: ^0.14.0 flutter_web_browser: ^0.15.0
flutter_webview_plugin: ^0.4.0 webview_flutter: ^2.1.1
pull_to_refresh: 2.0.0 pull_to_refresh: 2.0.0
flutter_swiper: ^1.1.6 flutter_swiper: ^1.1.6
flutter_styled_toast: ^2.0.0 flutter_styled_toast: ^2.0.0
animate_do: ^2.0.0 animate_do: ^2.0.0
bubble_tab_indicator: ^0.1.5 bubble_tab_indicator: ^0.1.5
status_alert: ^0.1.3 status_alert: ^0.1.3
math_expressions: ^2.1.1 math_expressions: ^2.2.0
hexcolor: ^2.0.3 hexcolor: ^2.0.5
flutter_spinkit: ^5.0.0 flutter_spinkit: ^5.1.0
flutter_launcher_icons: ^0.9.0
auto_size_text: ^2.1.0 auto_size_text: ^2.1.0
html: ^0.15.0 html: ^0.15.0
flutter_staggered_grid_view: ^0.4.0 flutter_staggered_grid_view: ^0.4.1
flutter: flutter:
sdk: flutter sdk: flutter
flutter_localizations: flutter_localizations:

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.1.0 ### Label StoreMax - v5.2.0
[Official WooSignal WooCommerce App](https://woosignal.com) [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 - Change app name, logo, customize default language, currency + more
- Light and dark mode - Light and dark mode
- Theme customization - Theme customization
- Stripe, Cash On Delivery, RazorPay and PayPal - Stripe, Cash On Delivery and PayPal
- Localized for en, es, pt, it, hi, fr, zh - Localized for en, es, pt, it, hi, fr, zh
- Orders show as normal in WooCommerce - Orders show as normal in WooCommerce