v5.4.0 - updates

This commit is contained in:
Anthony 2021-12-10 08:50:23 +00:00
parent 1d7b0287c5
commit 6bc9dcd09a
66 changed files with 821 additions and 800 deletions

View File

@ -1,3 +1,10 @@
## [5.4.0] - 2021-12-10
* New localization keys added
* Refactor as per Dart Analysis
* Upgrade to latest Nylo version
* Pubspec.yaml dependency updates
## [5.3.1] - 2021-11-17 ## [5.3.1] - 2021-11-17
* Fix shipping method not handling async call * Fix shipping method not handling async call

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.3.1 ### Label StoreMax - v5.4.0
[Official WooSignal WooCommerce App](https://woosignal.com) [Official WooSignal WooCommerce App](https://woosignal.com)

View File

@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1300;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1020" LastUpgradeVersion = "1300"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View File

@ -186,5 +186,9 @@
"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", "Register": "Registrieren",
"No payment methods are available": "Es sind keine Zahlungsmethoden verfügbar" "No payment methods are available": "Es sind keine Zahlungsmethoden verfügbar",
"Please enter a valid billing email": "Bitte geben Sie eine gültige Rechnungs-E-Mail-Adresse ein",
"Please enter a valid shipping email": "Bitte geben Sie eine gültige Versand-E-Mail ein",
"Free postage": "Portofrei",
"PROCESSING": "WIRD BEARBEITET"
} }

View File

@ -186,5 +186,9 @@
"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", "Register": "Register",
"No payment methods are available": "No payment methods are available" "No payment methods are available": "No payment methods are available",
"Please enter a valid billing email": "Please enter a valid billing email",
"Please enter a valid shipping email": "Please enter a valid shipping email",
"Free postage": "Free postage",
"PROCESSING": "PROCESSING"
} }

View File

@ -186,5 +186,9 @@
"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", "Register": "Registrarse",
"No payment methods are available": "No hay métodos de pago disponibles." "No payment methods are available": "No hay métodos de pago disponibles.",
"Please enter a valid billing email": "Ingrese un correo electrónico de facturación válido",
"Please enter a valid shipping email": "Ingrese un correo electrónico de envío válido",
"Free postage": "Gastos de envío gratis",
"PROCESSING": "PROCESANDO"
} }

View File

@ -186,5 +186,9 @@
"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", "Register": "S'inscrire",
"No payment methods are available": "Aucun mode de paiement n'est disponible" "No payment methods are available": "Aucun mode de paiement n'est disponible",
"Please enter a valid billing email": "Veuillez saisir une adresse e-mail de facturation valide",
"Please enter a valid shipping email": "Veuillez saisir un e-mail de livraison valide",
"Free postage": "Sans frais de port",
"PROCESSING": "EN TRAITEMENT"
} }

View File

@ -186,5 +186,9 @@
"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", "Register": "rajistar karen",
"No payment methods are available": "koee bhugataan vidhiyaan upalabdh nahin hain" "No payment methods are available": "koee bhugataan vidhiyaan upalabdh nahin hain",
"Please enter a valid billing email": "krpaya ek maany biling eemel darj karen",
"Please enter a valid shipping email": "krpaya ek maany shiping eemel darj karen",
"Free postage": "mupht daak",
"PROCESSING": "prasanskaran"
} }

View File

@ -186,5 +186,9 @@
"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", "Register": "Registrati",
"No payment methods are available": "Non sono disponibili metodi di pagamento" "No payment methods are available": "Non sono disponibili metodi di pagamento",
"Please enter a valid billing email": "Si prega di inserire un'e-mail di fatturazione valida",
"Please enter a valid shipping email": "Si prega di inserire un'e-mail di spedizione valida",
"Free postage": "Spedizione gratuita",
"PROCESSING": "IN LAVORAZIONE"
} }

View File

@ -186,5 +186,9 @@
"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", "Register": "Registro",
"No payment methods are available": "Nenhum método de pagamento disponível" "No payment methods are available": "Nenhum método de pagamento disponível",
"Please enter a valid billing email": "Por favor, insira um e-mail de faturamento válido",
"Please enter a valid shipping email": "Por favor, insira um e-mail de envio válido",
"Free postage": "Postagem grátis",
"PROCESSING": "EM PROCESSAMENTO"
} }

View File

@ -186,5 +186,9 @@
"Must have": "一定有", "Must have": "一定有",
"Our selection of new items": "我们精选的新品", "Our selection of new items": "我们精选的新品",
"Register": "登记", "Register": "登记",
"No payment methods are available": "没有可用的付款方式" "No payment methods are available": "没有可用的付款方式",
"Please enter a valid billing email": "请输入有效的结算电子邮件",
"Please enter a valid shipping email": "请输入有效的送货电子邮件",
"Free postage": "免邮费",
"PROCESSING": "加工"
} }

View File

@ -15,7 +15,7 @@ import 'package:flutter/widgets.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:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.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';
@ -32,16 +32,16 @@ cashOnDeliveryPay(context,
} else { } else {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans("Error"),
description: trans(context, "Something went wrong, please contact our store"), description: trans("Something went wrong, please contact our store"),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }
} catch (_) { } catch (_) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans("Error"),
description: trans(context, "Something went wrong, please contact our store"), description: trans("Something went wrong, please contact our store"),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }

View File

@ -15,7 +15,7 @@ import 'package:flutter/widgets.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:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.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';
@ -52,8 +52,8 @@ examplePay(context,
} else { } else {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans("Error"),
description: trans(context, "Something went wrong, please contact our store"), description: trans("Something went wrong, please contact our store"),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }

View File

@ -12,13 +12,12 @@
// //
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_app/app/models/cart_line_item.dart'; import 'package:flutter_app/app/models/cart_line_item.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_app/resources/widgets/checkout_paypal.dart'; import 'package:flutter_app/resources/widgets/checkout_paypal.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.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';
@ -39,9 +38,9 @@ payPalPay(context,
if (!(value is Map<String, dynamic>)) { if (!(value is Map<String, dynamic>)) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Payment Cancelled"), title: trans("Payment Cancelled"),
description: description:
trans(context, "The payment has been cancelled"), trans("The payment has been cancelled"),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
return; return;
@ -56,9 +55,8 @@ payPalPay(context,
if (order == null) { if (order == null) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans("Error"),
description: trans(context, description: trans("Something went wrong, please contact our store"),
"Something went wrong, please contact our store"),
); );
return; return;
} }
@ -67,8 +65,8 @@ payPalPay(context,
} else { } else {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Payment Cancelled"), title: trans("Payment Cancelled"),
description: trans(context, "The payment has been cancelled"), description: trans("The payment has been cancelled"),
); );
} }
} }

View File

@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// //
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/bootstrap/app_helper.dart'; 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';
@ -19,7 +18,6 @@ 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:flutter_stripe/flutter_stripe.dart';
import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:nylo_support/helpers/helper.dart';
import 'package:woosignal/models/payload/order_wc.dart'; import 'package:woosignal/models/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';
@ -70,9 +68,9 @@ stripePay(context,
if (rsp == null) { if (rsp == null) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: description:
trans(context, "Something went wrong, please try again."), trans("Something went wrong, please try again."),
icon: Icons.payment, icon: Icons.payment,
style: ToastNotificationStyleType.WARNING); style: ToastNotificationStyleType.WARNING);
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
@ -99,9 +97,8 @@ stripePay(context,
if (order == null) { if (order == null) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans("Error"),
description: trans(context, description: trans("Something went wrong, please contact our store"),
"Something went wrong, please contact our store"),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
return; return;
@ -115,7 +112,7 @@ stripePay(context,
} }
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: e.error.localizedMessage, description: e.error.localizedMessage,
icon: Icons.payment, icon: Icons.payment,
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
@ -127,8 +124,8 @@ stripePay(context,
} }
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Something went wrong, please try again."), description: trans("Something went wrong, please try again."),
icon: Icons.payment, icon: Icons.payment,
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
); );

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_app/config/app_theme.dart';
import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_framework/nylo_framework.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
@ -60,54 +60,43 @@ class AppBuild extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ThemeProvider( return LocalizedApp(
themes: [ child: ThemeProvider(
AppTheme( themes: appThemes.map((appTheme) => appTheme.toAppTheme(defaultTheme: appTheme.theme.brightness == Brightness.light ? lightTheme : darkTheme)).toList(),
id: "default_light_theme", child: ThemeConsumer(
data: this.lightTheme ?? ThemeData.fallback(), child: Builder(
description: 'Light theme'), builder: (themeContext) => ValueListenableBuilder(
AppTheme( valueListenable: ValueNotifier(locale),
id: "default_dark_theme", builder: (context, Locale locale, _) => MaterialApp(
data: this.darkTheme ?? ThemeData.fallback(), navigatorKey: navigatorKey,
description: 'Dark theme'), themeMode: themeMode,
], onGenerateTitle: onGenerateTitle,
child: ThemeConsumer( onGenerateInitialRoutes: onGenerateInitialRoutes,
child: Builder( onUnknownRoute: onUnknownRoute,
builder: (themeContext) => ValueListenableBuilder( builder: builder,
valueListenable: ValueNotifier(locale), navigatorObservers: navigatorObservers,
builder: (context, Locale locale, _) => MaterialApp( color: color,
navigatorKey: navigatorKey, debugShowMaterialGrid: debugShowMaterialGrid,
themeMode: themeMode, showPerformanceOverlay: showPerformanceOverlay,
onGenerateTitle: onGenerateTitle, checkerboardRasterCacheImages: checkerboardRasterCacheImages,
onGenerateInitialRoutes: onGenerateInitialRoutes, checkerboardOffscreenLayers: checkerboardOffscreenLayers,
onUnknownRoute: onUnknownRoute, showSemanticsDebugger: showSemanticsDebugger,
builder: builder, debugShowCheckedModeBanner: debugShowCheckedModeBanner,
navigatorObservers: navigatorObservers, shortcuts: shortcuts,
color: color, actions: actions,
supportedLocales: supportedLocales, title: title ?? "",
debugShowMaterialGrid: debugShowMaterialGrid, initialRoute: initialRoute,
showPerformanceOverlay: showPerformanceOverlay, onGenerateRoute: this.onGenerateRoute,
checkerboardRasterCacheImages: checkerboardRasterCacheImages, darkTheme: this.darkTheme == null ? ThemeConfig.dark().theme : this.darkTheme,
checkerboardOffscreenLayers: checkerboardOffscreenLayers, theme: themeData ?? ThemeProvider.themeOf(context).data,
showSemanticsDebugger: showSemanticsDebugger, localeResolutionCallback:
debugShowCheckedModeBanner: debugShowCheckedModeBanner, (Locale locale, Iterable<Locale> supportedLocales) {
shortcuts: shortcuts, return locale;
actions: actions, },
title: title ?? "", localizationsDelegates: NyLocalization.instance.delegates,
darkTheme: darkTheme, locale: NyLocalization.instance.locale,
initialRoute: initialRoute, supportedLocales: supportedLocales ?? NyLocalization.instance.locals(),
onGenerateRoute: this.onGenerateRoute, ),
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

@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'package:flutter_app/resources/themes/styles/base_styles.dart';
import 'package:nylo_framework/nylo_framework.dart';
class BaseThemeConfig {
final String id;
final String description;
final ThemeData theme;
final BaseColorStyles colors;
final dynamic meta;
BaseThemeConfig({this.id, this.description, this.theme, this.colors, this.meta = const {}});
AppTheme toAppTheme({ThemeData defaultTheme}) => AppTheme(
id: this.id,
data: defaultTheme == null ? this.theme : defaultTheme,
description: this.description,
);
}

View File

@ -9,7 +9,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import 'dart:convert'; import 'dart:convert';
import 'package:animate_do/animate_do.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.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/cart.dart'; import 'package:flutter_app/app/models/cart.dart';
@ -23,17 +22,18 @@ import 'package:flutter_app/bootstrap/enums/symbol_position_enums.dart';
import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart'; import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
import 'package:flutter_app/config/app_currency.dart'; import 'package:flutter_app/config/app_currency.dart';
import 'package:flutter_app/config/app_payment_gateways.dart'; import 'package:flutter_app/config/app_payment_gateways.dart';
import 'package:flutter_app/config/app_theme.dart';
import 'package:flutter_app/resources/themes/styles/base_styles.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';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:html/parser.dart'; import 'package:html/parser.dart';
import 'package:flutter_web_browser/flutter_web_browser.dart'; import 'package:flutter_web_browser/flutter_web_browser.dart';
import 'package:math_expressions/math_expressions.dart'; import 'package:math_expressions/math_expressions.dart';
import 'package:money_formatter/money_formatter.dart'; import 'package:money_formatter/money_formatter.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:platform_alert_dialog/platform_alert_dialog.dart'; import 'package:platform_alert_dialog/platform_alert_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:status_alert/status_alert.dart'; import 'package:status_alert/status_alert.dart';
@ -52,6 +52,20 @@ appWooSignal(Function(WooSignal) api) async {
return await api(wooSignal); return await api(wooSignal);
} }
/// helper to find correct color from the [context].
class ThemeColor {
static BaseColorStyles get(BuildContext context) {
return ((Theme.of(context).brightness == Brightness.light) ? ThemeConfig.light().colors : ThemeConfig.dark().colors);
}
}
/// helper to set colors on TextStyle
extension ColorsHelper on TextStyle {
TextStyle setColor(BuildContext context, Color Function(BaseColorStyles color) newColor) {
return this.copyWith(color: newColor(ThemeColor.get(context)));
}
}
List<PaymentType> getPaymentTypes() { List<PaymentType> getPaymentTypes() {
List<PaymentType> paymentTypes = []; List<PaymentType> paymentTypes = [];
app_payment_gateways.forEach((element) { app_payment_gateways.forEach((element) {
@ -99,168 +113,6 @@ showStatusAlert(context,
); );
} }
enum ToastNotificationStyleType {
SUCCESS,
WARNING,
INFO,
DANGER,
}
class ToastNotificationStyleMetaHelper {
static ToastMeta getValue(ToastNotificationStyleType style) {
switch (style) {
case ToastNotificationStyleType.SUCCESS:
return ToastMeta.success(action: () {
ToastManager().dismissAll(showAnim: true);
});
case ToastNotificationStyleType.WARNING:
return ToastMeta.warning(action: () {
ToastManager().dismissAll(showAnim: true);
});
case ToastNotificationStyleType.INFO:
return ToastMeta.info(action: () {
ToastManager().dismissAll(showAnim: true);
});
case ToastNotificationStyleType.DANGER:
return ToastMeta.danger(action: () {
ToastManager().dismissAll(showAnim: true);
});
default:
return ToastMeta.success(action: () {
ToastManager().dismissAll(showAnim: true);
});
}
}
}
class ToastMeta {
Widget icon;
String title;
String description;
Color color;
Function action;
Duration duration;
ToastMeta(
{this.icon,
this.title,
this.description,
this.color,
this.action,
this.duration = const Duration(seconds: 2)});
ToastMeta.success(
{this.icon = const Icon(Icons.check, color: Colors.white, size: 30),
this.title = "Success",
this.description = "",
this.color = Colors.green,
this.action,
this.duration = const Duration(seconds: 5)});
ToastMeta.info(
{this.icon = const Icon(Icons.info, color: Colors.white, size: 30),
this.title = "",
this.description = "",
this.color = Colors.teal,
this.action,
this.duration = const Duration(seconds: 5)});
ToastMeta.warning(
{this.icon =
const Icon(Icons.error_outline, color: Colors.white, size: 30),
this.title = "Oops!",
this.description = "",
this.color = Colors.orange,
this.action,
this.duration = const Duration(seconds: 6)});
ToastMeta.danger(
{this.icon = const Icon(Icons.warning, color: Colors.white, size: 30),
this.title = "Oops!",
this.description = "",
this.color = Colors.redAccent,
this.action,
this.duration = const Duration(seconds: 7)});
}
showToastNotification(BuildContext context,
{ToastNotificationStyleType style,
String title,
IconData icon,
String description = "",
Duration duration}) {
ToastMeta toastMeta = ToastNotificationStyleMetaHelper.getValue(style);
toastMeta.title = trans(context, toastMeta.title);
if (title != null) {
toastMeta.title = title;
}
toastMeta.description = description;
Widget _icon = toastMeta.icon;
if (icon != null) {
_icon = Icon(icon, color: Colors.white);
}
showToastWidget(
InkWell(
onTap: () => ToastManager().dismissAll(showAnim: true),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 18.0),
margin: EdgeInsets.symmetric(horizontal: 8.0),
height: 100,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
color: toastMeta.color,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Pulse(
child: Container(
child: Center(
child: IconButton(
onPressed: () {},
icon: _icon,
padding: EdgeInsets.only(right: 16),
),
),
),
infinite: true,
duration: Duration(milliseconds: 1500),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
toastMeta.title,
style: Theme.of(context)
.textTheme
.headline5
.copyWith(color: Colors.white),
),
Text(
toastMeta.description,
style: Theme.of(context)
.textTheme
.bodyText1
.copyWith(color: Colors.white),
),
],
),
),
],
),
),
),
context: context,
isIgnoring: false,
position: StyledToastPosition.top,
animation: StyledToastAnimation.slideFromTopFade,
duration: duration ?? toastMeta.duration,
);
}
String parseHtmlString(String htmlString) { String parseHtmlString(String htmlString) {
var document = parse(htmlString); var document = parse(htmlString);
return parse(document.body.text).documentElement.text; return parse(document.body.text).documentElement.text;
@ -307,8 +159,6 @@ openBrowserTab({@required String url}) async {
customTabsOptions: CustomTabsOptions(toolbarColor: Colors.white70)); customTabsOptions: CustomTabsOptions(toolbarColor: Colors.white70));
} }
EdgeInsets safeAreaDefault() => EdgeInsets.only(left: 16, right: 16, bottom: 8);
bool isNumeric(String str) { bool isNumeric(String str) {
if (str == null) { if (str == null) {
return false; return false;
@ -546,7 +396,7 @@ showPlatformAlertDialog(BuildContext context,
bool showDoneAction = true}) { bool showDoneAction = true}) {
if (showDoneAction) { if (showDoneAction) {
actions actions
.add(dialogAction(context, title: trans(context, "Done"), action: () { .add(dialogAction(context, title: trans("Done"), action: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
})); }));
} }
@ -602,7 +452,7 @@ String formatForDateTime(FormatType formatType) {
} }
} }
double parseWcPrice(String price) => (double.tryParse(price) ?? 0); double parseWcPrice(String price) => (double.tryParse(price ?? "0") ?? 0);
void appLogOutput(dynamic message) => void appLogOutput(dynamic message) =>
(getEnv('APP_DEBUG', defaultValue: true) ? NyLogger.debug(message) : null); (getEnv('APP_DEBUG', defaultValue: true) ? NyLogger.debug(message) : null);
@ -621,15 +471,15 @@ Widget refreshableScroll(context,
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
Widget body; Widget body;
if (mode == LoadStatus.idle) { if (mode == LoadStatus.idle) {
body = Text(trans(context, "pull up load")); body = Text(trans("pull up load"));
} else if (mode == LoadStatus.loading) { } else if (mode == LoadStatus.loading) {
body = CupertinoActivityIndicator(); body = CupertinoActivityIndicator();
} else if (mode == LoadStatus.failed) { } else if (mode == LoadStatus.failed) {
body = Text(trans(context, "Load Failed! Click retry!")); body = Text(trans("Load Failed! Click retry!"));
} else if (mode == LoadStatus.canLoading) { } else if (mode == LoadStatus.canLoading) {
body = Text(trans(context, "release to load more")); body = Text(trans("release to load more"));
} else { } else {
body = Text(trans(context, "No more products")); body = Text(trans("No more products"));
} }
return Container( return Container(
height: 55.0, height: 55.0,

View File

@ -0,0 +1,10 @@
import 'package:flutter/services.dart';
/// boot application
Future<void> boot() async {
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
}

View File

@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
/*
|--------------------------------------------------------------------------
| Font
|
| 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();
|--------------------------------------------------------------------------
*/
final TextStyle appFont = GoogleFonts.poppins();
// e.g. custom font in pubspec.yaml - https://flutter.dev/docs/cookbook/design/fonts
// final TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo");

View File

@ -1,20 +0,0 @@
import 'package:flutter/cupertino.dart';
/*
|--------------------------------------------------------------------------
| APP LOCALE
|
| Configure the language by setting the locale.
| You can only use one of the supported locales below in app_locales_supported.
|--------------------------------------------------------------------------
*/
const List<Locale> app_locales_supported = [
Locale('en'),
Locale('es'),
Locale('fr'),
Locale('hi'),
Locale('it'),
Locale('pt'),
Locale('zh'),
];

View File

@ -0,0 +1,57 @@
import 'package:nylo_framework/nylo_framework.dart';
/*
|--------------------------------------------------------------------------
| localeType
| -------------------------------------------------------------------------
| Define if you want the application to read the locale from the users
| device settings or as you've defined in the [languageCode].
|--------------------------------------------------------------------------
*/
final LocaleType localeType = LocaleType.asDefined; // device, asDefined
/*
|--------------------------------------------------------------------------
| languageCode
| -------------------------------------------------------------------------
| Define the language code you want to use. E.g. en, es, ar.
| The language code should match the name of the file i.e /lang/es.json
|--------------------------------------------------------------------------
*/
final String languageCode = getEnv('DEFAULT_LOCALE', defaultValue: "en");
/*
|--------------------------------------------------------------------------
| languagesList
| -------------------------------------------------------------------------
| Add a list of supported languages.
|--------------------------------------------------------------------------
*/
final List<String> languagesList = const [
'en',
'es',
'fr',
'hi',
'it',
'pt',
'zh'
];
/*
|--------------------------------------------------------------------------
| assetsDirectory
| -------------------------------------------------------------------------
| Asset directory for your languages.
|--------------------------------------------------------------------------
*/
final String assetsDirectory = 'lang/';
/*
|--------------------------------------------------------------------------
| valuesAsMap
| -------------------------------------------------------------------------
| If you want to define your own language map in code rather than using
| the asset json files.
|--------------------------------------------------------------------------
*/
final Map<String, String> valuesAsMap = {};

View File

@ -1,43 +1,84 @@
import 'package:flutter/material.dart'; import 'package:flutter_app/bootstrap/base_theme_config.dart';
import 'package:flutter_app/resources/themes/dark_theme.dart';
import 'package:flutter_app/resources/themes/light_theme.dart';
import 'package:flutter_app/resources/themes/styles/base_styles.dart';
import 'package:flutter_app/resources/themes/styles/dark_theme_colors.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/light_theme_colors.dart';
import 'package:flutter_app/resources/themes/styles/theme_styles.dart';
import 'package:google_fonts/google_fonts.dart';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Theme Font | Theme Config
|
| 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();
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
final TextStyle appThemeFont = GoogleFonts.poppins(); // App Themes
final appThemes = [
// e.g. custom font in pubspec.yaml - https://flutter.dev/docs/cookbook/design/fonts ThemeConfig.light(),
// final TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo");
ThemeConfig.dark(),
];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Theme Colors | Theme Colors
|
| Customize your theme's light and dark themes: /lib/config/styles/
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
class NyColors { // Light Colors
// Light Colors BaseColorStyles lightColors = LightThemeColors();
static LightThemeColors light = LightThemeColors();
// Dark Colors // Dark Colors
static DarkThemeColors dark = DarkThemeColors(); BaseColorStyles darkColors = DarkThemeColors();
/// helper to find correct theme from the [context]. /*
static BaseStyles of(BuildContext context) { |--------------------------------------------------------------------------
return ((Theme.of(context).brightness == Brightness.dark) ? dark : light); | Themes
} |--------------------------------------------------------------------------
*/
// Preset Themes
class ThemeConfig {
// LIGHT
static BaseThemeConfig light() => BaseThemeConfig(
id: "default_light_theme",
description: "Light theme",
theme: lightTheme(lightColors),
colors: lightColors,
);
// DARK
static BaseThemeConfig dark() => BaseThemeConfig(
id: "default_dark_theme",
description: "Dark theme",
theme: darkTheme(darkColors),
colors: darkColors,
);
// E.G. CUSTOM THEME
/// Run: "flutter pub run nylo_framework:main make:theme bright_theme" // example bright_theme
// Creates a basic theme in /resources/themes/bright_theme.dart
// Creates the themes colors in /resources/themes/styles/bright_theme_colors.dart
// First add the colors which was created into the above section like the following:
// Bright Colors
/// BaseColorStyles brightColors = BrightThemeColors();
// Next, uncomment the below:
/// static BaseThemeConfig bright() => BaseThemeConfig(
/// id: "default_bright_theme",
/// description: "Bright theme",
/// theme: brightTheme(brightColors),
/// colors: brightColors,
/// );
// To then use this theme, add it to the [appThemes] above like the following:
// final appThemes = [
/// ThemeConfig.bright(), // new theme
//
// ThemeConfig.light(),
//
// ThemeConfig.dark(),
// ];
} }

View File

@ -1,25 +1,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/bootstrap/app.dart'; import 'package:flutter_app/bootstrap/app.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_locale.dart'; import 'package:flutter_app/bootstrap/setup.dart';
import 'package:flutter_app/resources/themes/dark_theme.dart'; import 'package:flutter_app/config/app_localization.dart';
import 'package:flutter_app/resources/themes/light_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/nylo.dart';
import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_framework/nylo_framework.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();
Nylo nylo = await Nylo.init(router: appRouter()); Nylo nylo = await Nylo.init(router: appRouter(), setup: boot);
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
String initialRoute = '/no-connection'; String initialRoute = '/no-connection';
WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp()); WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp());
@ -41,15 +33,21 @@ void main() async {
locale = Locale((getEnv('DEFAULT_LOCALE', defaultValue: null) == null && wooSignalApp.locale != null) ? wooSignalApp.locale : envVal('DEFAULT_LOCALE', defaultValue: 'en')); locale = Locale((getEnv('DEFAULT_LOCALE', defaultValue: null) == null && wooSignalApp.locale != null) ? wooSignalApp.locale : envVal('DEFAULT_LOCALE', defaultValue: 'en'));
} }
/// NyLocalization
await NyLocalization.instance.init(
localeType: localeType,
languageCode: locale != null ? locale.languageCode : Locale(getEnv('DEFAULT_LOCALE', defaultValue: 'en')),
languagesList: languagesList,
assetsDirectory: assetsDirectory,
valuesAsMap: valuesAsMap
);
runApp( runApp(
AppBuild( AppBuild(
navigatorKey: nylo.router.navigatorKey, navigatorKey: nylo.router.navigatorKey,
onGenerateRoute: nylo.router.generator(), onGenerateRoute: nylo.router.generator(),
lightTheme: lightTheme(),
darkTheme: darkTheme(),
locale: locale, locale: locale,
initialRoute: initialRoute, initialRoute: initialRoute,
supportedLocales: app_locales_supported,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
), ),
); );

View File

@ -8,16 +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: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/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:wp_json_api/models/responses/wc_customer_info_response.dart'; import 'package:wp_json_api/models/responses/wc_customer_info_response.dart';
import 'package:wp_json_api/models/responses/wc_customer_updated_response.dart'; import 'package:wp_json_api/models/responses/wc_customer_updated_response.dart';
import 'package:wp_json_api/wp_json_api.dart'; import 'package:wp_json_api/wp_json_api.dart';
@ -78,12 +76,11 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Billing Details") trans("Billing Details")
), ),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: GestureDetector( child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(new FocusNode()), onTap: () => FocusScope.of(context).requestFocus(new FocusNode()),
child: _isLoading child: _isLoading
@ -104,14 +101,14 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "First Name"), heading: trans("First Name"),
controller: _txtShippingFirstName, controller: _txtShippingFirstName,
shouldAutoFocus: true, shouldAutoFocus: true,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Last Name"), heading: trans("Last Name"),
controller: _txtShippingLastName, controller: _txtShippingLastName,
), ),
), ),
@ -121,19 +118,19 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
), ),
TextEditingRow( TextEditingRow(
heading: trans(context, "Address Line"), heading: trans("Address Line"),
controller: _txtShippingAddressLine, controller: _txtShippingAddressLine,
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "City"), heading: trans("City"),
controller: _txtShippingCity, controller: _txtShippingCity,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "State"), heading: trans("State"),
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
controller: _txtShippingState), controller: _txtShippingState),
), ),
@ -142,13 +139,13 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Postal code"), heading: trans("Postal code"),
controller: _txtShippingPostalCode, controller: _txtShippingPostalCode,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Country"), heading: trans("Country"),
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
controller: _txtShippingCountry, controller: _txtShippingCountry,
), ),
@ -161,9 +158,7 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (Theme.of(context).brightness == Brightness.light) color: ThemeColor.get(context).surfaceBackground,
? NyColors.light.background
: NyColors.dark.primaryAccent,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
@ -177,7 +172,7 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
Column( Column(
children: <Widget>[ children: <Widget>[
PrimaryButton( PrimaryButton(
title: trans(context, "UPDATE DETAILS"), title: trans("UPDATE DETAILS"),
action: action:
_isUpdating ? () {} : _updateBillingDetails), _isUpdating ? () {} : _updateBillingDetails),
], ],
@ -218,8 +213,8 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
billingCountry: country)); billingCountry: country));
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Something went wrong"), description: trans("Something went wrong"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} finally { } finally {
setState(() { setState(() {
@ -230,8 +225,8 @@ class _AccountBillingDetailsPageState extends State<AccountBillingDetailsPage> {
if (wcCustomerUpdatedResponse != null && if (wcCustomerUpdatedResponse != null &&
wcCustomerUpdatedResponse.status == 200) { wcCustomerUpdatedResponse.status == 200) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Success"), title: trans("Success"),
description: trans(context, "Account updated"), description: trans("Account updated"),
style: ToastNotificationStyleType.SUCCESS); style: ToastNotificationStyleType.SUCCESS);
Navigator.pop(context); Navigator.pop(context);
} }

View File

@ -14,11 +14,11 @@ 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/safearea_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';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:woosignal/models/response/order.dart'; import 'package:woosignal/models/response/order.dart';
import 'package:wp_json_api/models/responses/wc_customer_info_response.dart'; import 'package:wp_json_api/models/responses/wc_customer_info_response.dart';
@ -77,8 +77,8 @@ class _AccountDetailPageState extends State<AccountDetailPage>
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Something went wrong"), description: trans("Something went wrong"),
style: ToastNotificationStyleType.DANGER, style: ToastNotificationStyleType.DANGER,
); );
} finally { } finally {
@ -98,8 +98,8 @@ class _AccountDetailPageState extends State<AccountDetailPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_tabs = [ _tabs = [
new Tab(text: trans(context, "Orders")), new Tab(text: trans("Orders")),
new Tab(text: trans(context, "Settings")), new Tab(text: trans("Settings")),
]; ];
return Scaffold( return Scaffold(
@ -112,13 +112,12 @@ 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("Account")
), ),
centerTitle: true, centerTitle: true,
), ),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: _isLoading child: _isLoading
? AppLoaderWidget() ? AppLoaderWidget()
: Column( : Column(
@ -206,7 +205,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: NyColors.of(context).backgroundContainer, color: ThemeColor.get(context).backgroundContainer,
), ),
), ),
Expanded(child: _activeBody), Expanded(child: _activeBody),
@ -239,7 +238,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
Card( Card(
child: ListTile( child: ListTile(
leading: Icon(Icons.account_circle), leading: Icon(Icons.account_circle),
title: Text(trans(context, "Update details")), title: Text(trans("Update details")),
onTap: () => onTap: () =>
Navigator.pushNamed(context, "/account-update").then((onValue) { Navigator.pushNamed(context, "/account-update").then((onValue) {
setState(() { setState(() {
@ -252,7 +251,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
Card( Card(
child: ListTile( child: ListTile(
leading: Icon(Icons.local_shipping), leading: Icon(Icons.local_shipping),
title: Text(trans(context, "Shipping Details")), title: Text(trans("Shipping Details")),
onTap: () => onTap: () =>
Navigator.pushNamed(context, "/account-shipping-details"), Navigator.pushNamed(context, "/account-shipping-details"),
), ),
@ -260,7 +259,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
Card( Card(
child: ListTile( child: ListTile(
leading: Icon(Icons.credit_card), leading: Icon(Icons.credit_card),
title: Text(trans(context, "Billing Details")), title: Text(trans("Billing Details")),
onTap: () => onTap: () =>
Navigator.pushNamed(context, "/account-billing-details"), Navigator.pushNamed(context, "/account-billing-details"),
), ),
@ -268,7 +267,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
Card( Card(
child: ListTile( child: ListTile(
leading: Icon(Icons.exit_to_app), leading: Icon(Icons.exit_to_app),
title: Text(trans(context, "Logout")), title: Text(trans("Logout")),
onTap: () => authLogout(context), onTap: () => authLogout(context),
), ),
), ),
@ -317,15 +316,15 @@ class _AccountDetailPageState extends State<AccountDetailPage>
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
Widget body; Widget body;
if (mode == LoadStatus.idle) { if (mode == LoadStatus.idle) {
body = Text(trans(context, "pull up load")); body = Text(trans("pull up load"));
} else if (mode == LoadStatus.loading) { } else if (mode == LoadStatus.loading) {
body = CupertinoActivityIndicator(); body = CupertinoActivityIndicator();
} else if (mode == LoadStatus.failed) { } else if (mode == LoadStatus.failed) {
body = Text(trans(context, "Load Failed! Click retry!")); body = Text(trans("Load Failed! Click retry!"));
} else if (mode == LoadStatus.canLoading) { } else if (mode == LoadStatus.canLoading) {
body = Text(trans(context, "release to load more")); body = Text(trans("release to load more"));
} else { } else {
body = Text(trans(context, "No more orders")); body = Text(trans("No more orders"));
} }
return Container( return Container(
height: 55.0, height: 55.0,
@ -392,7 +391,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
Text( Text(
_orders[i].lineItems.length.toString() + _orders[i].lineItems.length.toString() +
" " + " " +
trans(context, "items"), trans("items"),
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText1 .bodyText1
@ -448,7 +447,7 @@ class _AccountDetailPageState extends State<AccountDetailPage>
size: 40, size: 40,
), ),
Text( Text(
trans(context, "No orders found"), trans("No orders found"),
), ),
], ],
), ),

View File

@ -8,17 +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: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';
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/bootstrap/shared_pref/shared_key.dart'; import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
import 'package:flutter_app/config/app_theme.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';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:wp_json_api/exceptions/incorrect_password_exception.dart'; import 'package:wp_json_api/exceptions/incorrect_password_exception.dart';
import 'package:wp_json_api/exceptions/invalid_email_exception.dart'; import 'package:wp_json_api/exceptions/invalid_email_exception.dart';
import 'package:wp_json_api/exceptions/invalid_nonce_exception.dart'; import 'package:wp_json_api/exceptions/invalid_nonce_exception.dart';
@ -66,7 +63,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
margin: EdgeInsets.symmetric(horizontal: 20), margin: EdgeInsets.symmetric(horizontal: 20),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Text( child: Text(
trans(context, "Login"), trans("Login"),
textAlign: TextAlign.left, textAlign: TextAlign.left,
style: Theme.of(context).textTheme.headline4.copyWith( style: Theme.of(context).textTheme.headline4.copyWith(
fontSize: 24, fontSize: 24,
@ -79,7 +76,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, boxShadow: (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: NyColors.of(context).backgroundContainer, color: ThemeColor.get(context).backgroundContainer,
), ),
padding: EdgeInsets.symmetric(vertical: 18, horizontal: 8), padding: EdgeInsets.symmetric(vertical: 18, horizontal: 8),
margin: EdgeInsets.symmetric(horizontal: 16), margin: EdgeInsets.symmetric(horizontal: 16),
@ -88,16 +85,16 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
TextEditingRow( TextEditingRow(
heading: trans(context, "Email"), heading: trans("Email"),
controller: _tfEmailController, controller: _tfEmailController,
keyboardType: TextInputType.emailAddress), keyboardType: TextInputType.emailAddress),
TextEditingRow( TextEditingRow(
heading: trans(context, "Password"), heading: trans("Password"),
controller: _tfPasswordController, controller: _tfPasswordController,
keyboardType: TextInputType.visiblePassword, keyboardType: TextInputType.visiblePassword,
obscureText: true), obscureText: true),
PrimaryButton( PrimaryButton(
title: trans(context, "Login"), title: trans("Login"),
action: _hasTappedLogin == true ? () {} : _loginUser, action: _hasTappedLogin == true ? () {} : _loginUser,
), ),
], ],
@ -118,7 +115,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
), ),
Padding( Padding(
child: Text( child: Text(
trans(context, "Create an account"), trans("Create an account"),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText1,
), ),
padding: EdgeInsets.only(left: 8), padding: EdgeInsets.only(left: 8),
@ -129,7 +126,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
Navigator.pushNamed(context, "/account-register"), Navigator.pushNamed(context, "/account-register"),
), ),
LinkButton( LinkButton(
title: trans(context, "Forgot Password"), title: trans("Forgot Password"),
action: () { action: () {
String forgotPasswordUrl = String forgotPasswordUrl =
AppHelper.instance.appConfig.wpLoginForgotPasswordUrl; AppHelper.instance.appConfig.wpLoginForgotPasswordUrl;
@ -144,7 +141,7 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
children: [ children: [
Divider(), Divider(),
LinkButton( LinkButton(
title: trans(context, "Back"), title: trans("Back"),
action: () => Navigator.pop(context), action: () => Navigator.pop(context),
), ),
], ],
@ -166,17 +163,17 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
if (email == "" || password == "") { if (email == "" || password == "") {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: description:
trans(context, "The email and password field cannot be empty"), trans("The email and password field cannot be empty"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
return; return;
} }
if (!isEmail(email)) { if (!isEmail(email)) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, "That email address is not valid"), description: trans("That email address is not valid"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
return; return;
} }
@ -192,32 +189,31 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
(request) => request.wpLogin(email: email, password: password)); (request) => request.wpLogin(email: email, password: password));
} on InvalidNonceException catch (_) { } on InvalidNonceException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: trans( description: trans("Something went wrong, please contact our store"),
context, "Something went wrong, please contact our store"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on InvalidEmailException catch (_) { } on InvalidEmailException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: description:
trans(context, "That email does not match our records"), trans("That email does not match our records"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on InvalidUsernameException catch (_) { } on InvalidUsernameException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: description:
trans(context, "That username does not match our records"), trans("That username does not match our records"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on IncorrectPasswordException catch (_) { } on IncorrectPasswordException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: description:
trans(context, "That password does not match our records"), trans("That password does not match our records"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Invalid login credentials"), description: trans("Invalid login credentials"),
style: ToastNotificationStyleType.DANGER, style: ToastNotificationStyleType.DANGER,
icon: Icons.account_circle); icon: Icons.account_circle);
} finally { } finally {
@ -233,8 +229,8 @@ class _AccountLandingPageState extends State<AccountLandingPage> {
user.save(SharedKey.authUser); user.save(SharedKey.authUser);
showToastNotification(context, showToastNotification(context,
title: trans(context, "Hello"), title: trans("Hello"),
description: trans(context, "Welcome back"), description: trans("Welcome back"),
style: ToastNotificationStyleType.SUCCESS, style: ToastNotificationStyleType.SUCCESS,
icon: Icons.account_circle); icon: Icons.account_circle);
navigatorPush(context, navigatorPush(context,

View File

@ -8,12 +8,11 @@
// 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: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';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.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/safearea_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';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
@ -55,20 +54,19 @@ 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("Order").capitalize()} #${_orderId.toString()}"
), ),
centerTitle: true, centerTitle: true,
), ),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: _isLoading child: _isLoading
? AppLoaderWidget() ? AppLoaderWidget()
: Column( : Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text("${trans(context, "Date Ordered").capitalize()}: " + Text("${trans("Date Ordered").capitalize()}: " +
dateFormatted( dateFormatted(
date: _order.dateCreated, date: _order.dateCreated,
formatType: formatForDateTime(FormatType.Date))), formatType: formatForDateTime(FormatType.Date))),
@ -81,7 +79,7 @@ class _AccountOrderDetailPageState extends NyState<AccountOrderDetailPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: Text( child: Text(
"${trans(context, "Ships to").capitalize()}:"), "${trans("Ships to").capitalize()}:"),
), ),
Flexible( Flexible(
child: Text( child: Text(

View File

@ -8,14 +8,12 @@
// 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: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/shared_pref/sp_auth.dart'; import 'package:flutter_app/bootstrap/shared_pref/sp_auth.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';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:wp_json_api/models/responses/wp_user_info_response.dart'; import 'package:wp_json_api/models/responses/wp_user_info_response.dart';
import 'package:wp_json_api/models/responses/wp_user_info_updated_response.dart'; import 'package:wp_json_api/models/responses/wp_user_info_updated_response.dart';
import 'package:wp_json_api/wp_json_api.dart'; import 'package:wp_json_api/wp_json_api.dart';
@ -64,7 +62,7 @@ class _AccountProfileUpdatePageState extends State<AccountProfileUpdatePage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Update Details"), trans("Update Details"),
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
), ),
@ -88,14 +86,14 @@ class _AccountProfileUpdatePageState extends State<AccountProfileUpdatePage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "First Name"), heading: trans("First Name"),
controller: _tfFirstName, controller: _tfFirstName,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Last Name"), heading: trans("Last Name"),
controller: _tfLastName, controller: _tfLastName,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
), ),
@ -110,7 +108,7 @@ class _AccountProfileUpdatePageState extends State<AccountProfileUpdatePage> {
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
), ),
PrimaryButton( PrimaryButton(
title: trans(context, "Update details"), title: trans("Update details"),
action: _updateDetails) action: _updateDetails)
], ],
), ),
@ -141,8 +139,8 @@ class _AccountProfileUpdatePageState extends State<AccountProfileUpdatePage> {
firstName: firstName, lastName: lastName)); firstName: firstName, lastName: lastName));
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: trans(context, "Please check your email and password"), description: trans("Please check your email and password"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} finally { } finally {
setState(() { setState(() {
@ -153,8 +151,8 @@ class _AccountProfileUpdatePageState extends State<AccountProfileUpdatePage> {
if (wpUserInfoUpdatedResponse != null && if (wpUserInfoUpdatedResponse != null &&
wpUserInfoUpdatedResponse.status == 200) { wpUserInfoUpdatedResponse.status == 200) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Success"), title: trans("Success"),
description: trans(context, "Account updated"), description: trans("Account updated"),
style: ToastNotificationStyleType.SUCCESS); style: ToastNotificationStyleType.SUCCESS);
Navigator.pop(context); Navigator.pop(context);
} }

View File

@ -15,8 +15,9 @@ 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/bootstrap/shared_pref/shared_key.dart'; import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:woosignal/helpers/shared_pref.dart'; import 'package:woosignal/helpers/shared_pref.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
import 'package:wp_json_api/exceptions/empty_username_exception.dart'; import 'package:wp_json_api/exceptions/empty_username_exception.dart';
@ -62,13 +63,12 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
title: Text( title: Text(
trans(context, "Register") trans("Register")
), ),
centerTitle: true, centerTitle: true,
), ),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
@ -77,7 +77,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "First Name"), heading: trans("First Name"),
controller: _tfFirstNameController, controller: _tfFirstNameController,
shouldAutoFocus: true, shouldAutoFocus: true,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
@ -85,7 +85,7 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Last Name"), heading: trans("Last Name"),
controller: _tfLastNameController, controller: _tfLastNameController,
shouldAutoFocus: false, shouldAutoFocus: false,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
@ -94,20 +94,20 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
], ],
)), )),
TextEditingRow( TextEditingRow(
heading: trans(context, "Email address"), heading: trans("Email address"),
controller: _tfEmailAddressController, controller: _tfEmailAddressController,
shouldAutoFocus: false, shouldAutoFocus: false,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
), ),
TextEditingRow( TextEditingRow(
heading: trans(context, "Password"), heading: trans("Password"),
controller: _tfPasswordController, controller: _tfPasswordController,
shouldAutoFocus: true, shouldAutoFocus: true,
obscureText: true, obscureText: true,
), ),
Padding( Padding(
child: PrimaryButton( child: PrimaryButton(
title: trans(context, "Sign up"), title: trans("Sign up"),
action: _hasTappedRegister ? () {} : _signUpTapped), action: _hasTappedRegister ? () {} : _signUpTapped),
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
), ),
@ -115,17 +115,16 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
child: InkWell( child: InkWell(
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: trans( text: trans("By tapping \"Register\" you agree to ") +
context, "By tapping \"Register\" you agree to ") +
AppHelper.instance.appConfig.appName + AppHelper.instance.appConfig.appName +
'\'s ', '\'s ',
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: trans(context, "terms and conditions"), text: trans("terms and conditions"),
style: TextStyle(fontWeight: FontWeight.bold)), style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(text: ' ' + trans(context, "and") + ' '), TextSpan(text: ' ' + trans("and") + ' '),
TextSpan( TextSpan(
text: trans(context, "privacy policy"), text: trans("privacy policy"),
style: TextStyle(fontWeight: FontWeight.bold)), style: TextStyle(fontWeight: FontWeight.bold)),
], ],
style: TextStyle( style: TextStyle(
@ -157,16 +156,16 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
if (!isEmail(email)) { if (!isEmail(email)) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, "That email address is not valid"), description: trans("That email address is not valid"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
return; return;
} }
if (password.length <= 5) { if (password.length <= 5) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, "Password must be a min 6 characters"), description: trans("Password must be a min 6 characters"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
return; return;
} }
@ -190,39 +189,38 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
); );
} on UsernameTakenException catch (e) { } on UsernameTakenException catch (e) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, e.message), description: trans(e.message),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on InvalidNonceException catch (_) { } on InvalidNonceException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Invalid details"), title: trans("Invalid details"),
description: trans( description: trans("Something went wrong, please contact our store"),
context, "Something went wrong, please contact our store"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on ExistingUserLoginException catch (_) { } on ExistingUserLoginException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "A user already exists"), description: trans("A user already exists"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on ExistingUserEmailException catch (_) { } on ExistingUserEmailException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "That email is taken, try another"), description: trans("That email is taken, try another"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on UserAlreadyExistException catch (_) { } on UserAlreadyExistException catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "A user already exists"), description: trans("A user already exists"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on EmptyUsernameException catch (e) { } on EmptyUsernameException catch (e) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, e.message), description: trans(e.message),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Something went wrong"), description: trans("Something went wrong"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} finally { } finally {
setState(() { setState(() {
@ -241,8 +239,8 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
.wpUpdateUserInfo(token, firstName: firstName, lastName: lastName)); .wpUpdateUserInfo(token, firstName: firstName, lastName: lastName));
showToastNotification(context, showToastNotification(context,
title: "${trans(context, "Hello")} $firstName", title: "${trans("Hello")} $firstName",
description: trans(context, "you're now logged in"), description: trans("you're now logged in"),
style: ToastNotificationStyleType.SUCCESS, style: ToastNotificationStyleType.SUCCESS,
icon: Icons.account_circle); icon: Icons.account_circle);
navigatorPush(context, navigatorPush(context,
@ -254,14 +252,14 @@ class _AccountRegistrationPageState extends State<AccountRegistrationPage> {
_viewTOSModal() { _viewTOSModal() {
showPlatformAlertDialog( showPlatformAlertDialog(
context, context,
title: trans(context, "Actions"), title: trans("Actions"),
subtitle: trans(context, "View Terms and Conditions or Privacy policy"), subtitle: trans("View Terms and Conditions or Privacy policy"),
actions: [ actions: [
dialogAction(context, dialogAction(context,
title: trans(context, "Terms and Conditions"), title: trans("Terms and Conditions"),
action: _viewTermsConditions), action: _viewTermsConditions),
dialogAction(context, dialogAction(context,
title: trans(context, "Privacy Policy"), title: trans("Privacy Policy"),
action: _viewPrivacyPolicy), action: _viewPrivacyPolicy),
], ],
); );

View File

@ -8,16 +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: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/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:wp_json_api/models/responses/wc_customer_info_response.dart'; import 'package:wp_json_api/models/responses/wc_customer_info_response.dart';
import 'package:wp_json_api/models/responses/wc_customer_updated_response.dart'; import 'package:wp_json_api/models/responses/wc_customer_updated_response.dart';
import 'package:wp_json_api/wp_json_api.dart'; import 'package:wp_json_api/wp_json_api.dart';
@ -61,8 +59,8 @@ class _AccountShippingDetailsPageState
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Something went wrong"), description: trans("Something went wrong"),
style: ToastNotificationStyleType.DANGER, style: ToastNotificationStyleType.DANGER,
); );
Navigator.pop(context); Navigator.pop(context);
@ -94,12 +92,11 @@ class _AccountShippingDetailsPageState
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Shipping Details") trans("Shipping Details")
), ),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
@ -122,14 +119,14 @@ class _AccountShippingDetailsPageState
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "First Name"), heading: trans("First Name"),
controller: _txtShippingFirstName, controller: _txtShippingFirstName,
shouldAutoFocus: true, shouldAutoFocus: true,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Last Name"), heading: trans("Last Name"),
controller: _txtShippingLastName, controller: _txtShippingLastName,
), ),
), ),
@ -139,19 +136,19 @@ class _AccountShippingDetailsPageState
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
), ),
TextEditingRow( TextEditingRow(
heading: trans(context, "Address Line"), heading: trans("Address Line"),
controller: _txtShippingAddressLine, controller: _txtShippingAddressLine,
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "City"), heading: trans("City"),
controller: _txtShippingCity, controller: _txtShippingCity,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "State"), heading: trans("State"),
controller: _txtShippingState, controller: _txtShippingState,
), ),
), ),
@ -160,13 +157,13 @@ class _AccountShippingDetailsPageState
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Postal code"), heading: trans("Postal code"),
controller: _txtShippingPostalCode, controller: _txtShippingPostalCode,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Country"), heading: trans("Country"),
controller: _txtShippingCountry, controller: _txtShippingCountry,
), ),
), ),
@ -178,9 +175,10 @@ class _AccountShippingDetailsPageState
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (Theme.of(context).brightness == Brightness.light) color: ThemeColor.get(context).surfaceBackground,
? NyColors.light.background // (Theme.of(context).brightness == Brightness.light)
: NyColors.dark.primaryAccent, // ? NyColors.light.background
// : NyColors.dark.primaryAccent,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
@ -194,7 +192,7 @@ class _AccountShippingDetailsPageState
Column( Column(
children: <Widget>[ children: <Widget>[
PrimaryButton( PrimaryButton(
title: trans(context, "UPDATE DETAILS"), title: trans("UPDATE DETAILS"),
action: action:
_isUpdating ? () {} : _updateShippingDetails), _isUpdating ? () {} : _updateShippingDetails),
], ],
@ -242,8 +240,8 @@ class _AccountShippingDetailsPageState
); );
} on Exception catch (_) { } on Exception catch (_) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops!"), title: trans("Oops!"),
description: trans(context, "Something went wrong"), description: trans("Something went wrong"),
style: ToastNotificationStyleType.DANGER); style: ToastNotificationStyleType.DANGER);
} finally { } finally {
setState(() { setState(() {
@ -254,8 +252,8 @@ class _AccountShippingDetailsPageState
if (wcCustomerUpdatedResponse != null && if (wcCustomerUpdatedResponse != null &&
wcCustomerUpdatedResponse.status == 200) { wcCustomerUpdatedResponse.status == 200) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Success"), title: trans("Success"),
description: trans(context, "Account updated"), description: trans("Account updated"),
style: ToastNotificationStyleType.SUCCESS); style: ToastNotificationStyleType.SUCCESS);
Navigator.pop(context); Navigator.pop(context);
} }

View File

@ -8,13 +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:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/app/controllers/browse_category_controller.dart'; import 'package:flutter_app/app/controllers/browse_category_controller.dart';
import 'package:flutter_app/bootstrap/enums/sort_enums.dart'; import 'package:flutter_app/bootstrap/enums/sort_enums.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.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/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.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';
@ -87,7 +87,7 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text(trans(context, "Browse"), Text(trans("Browse"),
style: Theme.of(context).textTheme.subtitle1), style: Theme.of(context).textTheme.subtitle1),
Text(parseHtmlString(productCategory.name)) Text(parseHtmlString(productCategory.name))
], ],
@ -100,8 +100,7 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
) )
], ],
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: _isLoading child: _isLoading
? Center( ? Center(
child: AppLoaderWidget(), child: AppLoaderWidget(),
@ -171,38 +170,38 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
_modalSheetTune() { _modalSheetTune() {
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Sort results"), title: trans("Sort results"),
bodyWidget: ListView( bodyWidget: ListView(
children: <Widget>[ children: <Widget>[
LinkButton( LinkButton(
title: trans(context, "Sort: Low to high"), title: trans("Sort: Low to high"),
action: () => _sortProducts(by: SortByType.LowToHigh), action: () => _sortProducts(by: SortByType.LowToHigh),
), ),
Divider( Divider(
height: 0, height: 0,
), ),
LinkButton( LinkButton(
title: trans(context, "Sort: High to low"), title: trans("Sort: High to low"),
action: () => _sortProducts(by: SortByType.HighToLow), action: () => _sortProducts(by: SortByType.HighToLow),
), ),
Divider( Divider(
height: 0, height: 0,
), ),
LinkButton( LinkButton(
title: trans(context, "Sort: Name A-Z"), title: trans("Sort: Name A-Z"),
action: () => _sortProducts(by: SortByType.NameAZ), action: () => _sortProducts(by: SortByType.NameAZ),
), ),
Divider( Divider(
height: 0, height: 0,
), ),
LinkButton( LinkButton(
title: trans(context, "Sort: Name Z-A"), title: trans("Sort: Name Z-A"),
action: () => _sortProducts(by: SortByType.NameZA), action: () => _sortProducts(by: SortByType.NameZA),
), ),
Divider( Divider(
height: 0, height: 0,
), ),
LinkButton(title: trans(context, "Cancel"), action: _dismissModal) LinkButton(title: trans("Cancel"), action: _dismissModal)
], ],
), ),
); );

View File

@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_app/app/controllers/browse_search_controller.dart'; import 'package:flutter_app/app/controllers/browse_search_controller.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.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/safearea_widget.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:nylo_support/widgets/ny_stateful_widget.dart'; import 'package:nylo_support/widgets/ny_stateful_widget.dart';
@ -81,15 +82,14 @@ class _BrowseSearchState extends NyState<BrowseSearchPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text(trans(context, "Search results for"), Text(trans("Search results for"),
style: Theme.of(context).textTheme.subtitle1), style: Theme.of(context).textTheme.subtitle1),
Text("\"" + _search + "\"") Text("\"" + _search + "\"")
], ],
), ),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: _isLoading child: _isLoading
? Center( ? Center(
child: AppLoaderWidget(), child: AppLoaderWidget(),

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:flutter/cupertino.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';
@ -19,9 +18,10 @@ 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/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/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/text_row_widget.dart'; import 'package:flutter_app/resources/widgets/text_row_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
class CartPage extends StatefulWidget { class CartPage extends StatefulWidget {
CartPage(); CartPage();
@ -83,8 +83,8 @@ class _CartPageState extends State<CartPage> {
if (cartLineItems.length == 0) { if (cartLineItems.length == 0) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Cart"), title: trans("Cart"),
description: trans(context, "You need items in your cart to checkout"), description: trans("You need items in your cart to checkout"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
); );
@ -95,8 +95,8 @@ class _CartPageState extends State<CartPage> {
(c) => c.stockStatus == 'instock' || c.stockStatus == 'onbackorder')) { (c) => c.stockStatus == 'instock' || c.stockStatus == 'onbackorder')) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Cart"), title: trans("Cart"),
description: trans(context, "There is an item out of stock"), description: trans("There is an item out of stock"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
); );
@ -129,8 +129,8 @@ class _CartPageState extends State<CartPage> {
cartLineItem.quantity + 1 > cartLineItem.stockQuantity) { cartLineItem.quantity + 1 > cartLineItem.stockQuantity) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Cart"), title: trans("Cart"),
description: trans(context, "Maximum stock reached"), description: trans("Maximum stock reached"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
); );
@ -157,8 +157,8 @@ class _CartPageState extends State<CartPage> {
_cartLines.removeAt(index); _cartLines.removeAt(index);
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Updated"), title: trans("Updated"),
description: trans(context, "Item removed"), description: trans("Item removed"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.remove_shopping_cart, icon: Icons.remove_shopping_cart,
); );
@ -172,8 +172,8 @@ class _CartPageState extends State<CartPage> {
Cart.getInstance.clear(); Cart.getInstance.clear();
_cartLines = []; _cartLines = [];
showToastNotification(context, showToastNotification(context,
title: trans(context, "Success"), title: trans("Success"),
description: trans(context, "Cart cleared"), description: trans("Cart cleared"),
style: ToastNotificationStyleType.SUCCESS, style: ToastNotificationStyleType.SUCCESS,
icon: Icons.delete_outline); icon: Icons.delete_outline);
_isCartEmpty = true; _isCartEmpty = true;
@ -186,7 +186,7 @@ class _CartPageState extends State<CartPage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Shopping Cart"), trans("Shopping Cart"),
), ),
elevation: 1, elevation: 1,
actions: <Widget>[ actions: <Widget>[
@ -196,7 +196,7 @@ class _CartPageState extends State<CartPage> {
child: Align( child: Align(
child: Padding( child: Padding(
child: Text( child: Text(
trans(context, "Clear Cart"), trans("Clear Cart"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
), ),
padding: EdgeInsets.only(right: 8), padding: EdgeInsets.only(right: 8),
@ -208,8 +208,7 @@ class _CartPageState extends State<CartPage> {
], ],
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -228,7 +227,7 @@ class _CartPageState extends State<CartPage> {
), ),
Padding( Padding(
child: Text( child: Text(
trans(context, "Empty Basket"), trans("Empty Basket"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
), ),
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
@ -278,7 +277,7 @@ class _CartPageState extends State<CartPage> {
else else
return new Padding( return new Padding(
child: TextRowWidget( child: TextRowWidget(
title: trans(context, "Total"), title: trans("Total"),
text: (_isLoading ? "" : snapshot.data), text: (_isLoading ? "" : snapshot.data),
), ),
padding: EdgeInsets.only(bottom: 15, top: 15), padding: EdgeInsets.only(bottom: 15, top: 15),
@ -287,7 +286,7 @@ class _CartPageState extends State<CartPage> {
}, },
), ),
PrimaryButton( PrimaryButton(
title: trans(context, "PROCEED TO CHECKOUT"), title: trans("PROCEED TO CHECKOUT"),
action: _actionProceedToCheckout, action: _actionProceedToCheckout,
), ),
], ],

View File

@ -15,11 +15,11 @@ 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/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.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';
@ -166,8 +166,8 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
CheckoutSession.getInstance.billingDetails.shippingAddress; CheckoutSession.getInstance.billingDetails.shippingAddress;
if (shippingAddress == null || shippingAddress.customerCountry == null) { if (shippingAddress == null || shippingAddress.customerCountry == null) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, "Add your shipping details first"), description: trans("Add your shipping details first"),
icon: Icons.local_shipping); icon: Icons.local_shipping);
return; return;
} }
@ -181,13 +181,12 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Checkout") trans("Checkout")
), ),
centerTitle: true, centerTitle: true,
), ),
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: !_showFullLoader child: !_showFullLoader
? Column( ? Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -197,7 +196,7 @@ 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: NyColors.of(context).backgroundContainer, color: ThemeColor.get(context).backgroundContainer,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
@ -225,16 +224,14 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
.billingAddress != .billingAddress !=
null) null)
? wsCheckoutRow(context, ? wsCheckoutRow(context,
heading: trans( heading: trans("Billing/shipping details"),
context, "Billing/shipping details"),
leadImage: Icon(Icons.home), leadImage: Icon(Icons.home),
leadTitle: leadTitle:
(CheckoutSession.getInstance.billingDetails == null || (CheckoutSession.getInstance.billingDetails == null ||
CheckoutSession.getInstance CheckoutSession.getInstance
.billingDetails.billingAddress .billingDetails.billingAddress
.hasMissingFields() .hasMissingFields()
? trans( ? trans("Billing address is incomplete")
context, "Billing address is incomplete")
: CheckoutSession.getInstance : CheckoutSession.getInstance
.billingDetails.billingAddress .billingDetails.billingAddress
.addressFull()), .addressFull()),
@ -242,14 +239,14 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
showBorderBottom: true) showBorderBottom: true)
: wsCheckoutRow(context, : wsCheckoutRow(context,
heading: heading:
trans(context, "Billing/shipping details"), trans("Billing/shipping details"),
leadImage: Icon(Icons.home), leadImage: Icon(Icons.home),
leadTitle: trans(context, "Add billing & shipping details"), leadTitle: trans("Add billing & shipping details"),
action: _actionCheckoutDetails, action: _actionCheckoutDetails,
showBorderBottom: true)), showBorderBottom: true)),
(CheckoutSession.getInstance.paymentType != null (CheckoutSession.getInstance.paymentType != null
? wsCheckoutRow(context, ? wsCheckoutRow(context,
heading: trans(context, "Payment method"), heading: trans("Payment method"),
leadImage: Container( leadImage: Container(
color: Colors.white, color: Colors.white,
child: Image.asset( child: Image.asset(
@ -263,10 +260,9 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
action: _actionPayWith, action: _actionPayWith,
showBorderBottom: true) showBorderBottom: true)
: wsCheckoutRow(context, : wsCheckoutRow(context,
heading: trans(context, "Pay with"), heading: trans("Pay with"),
leadImage: Icon(Icons.payment), leadImage: Icon(Icons.payment),
leadTitle: trans( leadTitle: trans("Select a payment method"),
context, "Select a payment method"),
action: _actionPayWith, action: _actionPayWith,
showBorderBottom: true)), showBorderBottom: true)),
_wooSignalApp.disableShipping == 1 _wooSignalApp.disableShipping == 1
@ -275,7 +271,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
null null
? wsCheckoutRow(context, ? wsCheckoutRow(context,
heading: heading:
trans(context, "Shipping selected"), trans("Shipping selected"),
leadImage: Icon(Icons.local_shipping), leadImage: Icon(Icons.local_shipping),
leadTitle: CheckoutSession leadTitle: CheckoutSession
.getInstance.shippingType .getInstance.shippingType
@ -284,10 +280,9 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
: wsCheckoutRow( : wsCheckoutRow(
context, context,
heading: heading:
trans(context, "Select shipping"), trans("Select shipping"),
leadImage: Icon(Icons.local_shipping), leadImage: Icon(Icons.local_shipping),
leadTitle: trans(context, leadTitle: trans("Select a shipping option"),
"Select a shipping option"),
action: _actionSelectShipping, action: _actionSelectShipping,
)), )),
].where((e) => e != null).toList()), ].where((e) => e != null).toList()),
@ -302,23 +297,23 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
thickness: 1, thickness: 1,
), ),
wsCheckoutSubtotalWidgetFB( wsCheckoutSubtotalWidgetFB(
title: trans(context, "Subtotal"), title: trans("Subtotal"),
), ),
_wooSignalApp.disableShipping == 1 _wooSignalApp.disableShipping == 1
? null ? null
: widgetCheckoutMeta(context, : widgetCheckoutMeta(context,
title: trans(context, "Shipping fee"), title: trans("Shipping fee"),
amount: amount:
CheckoutSession.getInstance.shippingType == CheckoutSession.getInstance.shippingType ==
null null
? trans(context, "Select shipping") ? trans("Select shipping")
: CheckoutSession.getInstance.shippingType : CheckoutSession.getInstance.shippingType
.getTotal(withFormatting: true)), .getTotal(withFormatting: true)),
(_taxRate != null (_taxRate != null
? wsCheckoutTaxAmountWidgetFB(taxRate: _taxRate) ? wsCheckoutTaxAmountWidgetFB(taxRate: _taxRate)
: null), : null),
wsCheckoutTotalWidgetFB( wsCheckoutTotalWidgetFB(
title: trans(context, "Total"), taxRate: _taxRate), title: trans("Total"), taxRate: _taxRate),
Divider( Divider(
color: Colors.black12, color: Colors.black12,
thickness: 1, thickness: 1,
@ -327,8 +322,8 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
), ),
PrimaryButton( PrimaryButton(
title: _isProcessingPayment title: _isProcessingPayment
? "PROCESSING..." ? "${trans("PROCESSING")}..."
: trans(context, "CHECKOUT"), : trans("CHECKOUT"),
action: _isProcessingPayment ? null : _handleCheckout, action: _isProcessingPayment ? null : _handleCheckout,
), ),
], ],
@ -341,7 +336,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
Padding( Padding(
padding: const EdgeInsets.only(top: 15), padding: const EdgeInsets.only(top: 15),
child: Text( child: Text(
"${trans(context, "One moment")}...", "${trans("One moment")}...",
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
) )
@ -356,9 +351,8 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
if (CheckoutSession.getInstance.billingDetails.billingAddress == null) { if (CheckoutSession.getInstance.billingDetails.billingAddress == null) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, description: trans("Please select add your billing/shipping address to proceed"),
"Please select add your billing/shipping address to proceed"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.local_shipping, icon: Icons.local_shipping,
); );
@ -369,9 +363,9 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
.hasMissingFields()) { .hasMissingFields()) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops"), title: trans("Oops"),
description: description:
trans(context, "Your billing/shipping details are incomplete"), trans("Your billing/shipping details are incomplete"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.local_shipping, icon: Icons.local_shipping,
); );
@ -382,9 +376,9 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
CheckoutSession.getInstance.shippingType == null) { CheckoutSession.getInstance.shippingType == null) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops"), title: trans("Oops"),
description: description:
trans(context, "Please select a shipping method to proceed"), trans("Please select a shipping method to proceed"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.local_shipping, icon: Icons.local_shipping,
); );
@ -394,9 +388,9 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
if (CheckoutSession.getInstance.paymentType == null) { if (CheckoutSession.getInstance.paymentType == null) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops"), title: trans("Oops"),
description: description:
trans(context, "Please select a payment method to proceed"), trans("Please select a payment method to proceed"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.payment, icon: Icons.payment,
); );
@ -415,9 +409,9 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
if (doubleTotal < doubleMinimumValue) { if (doubleTotal < doubleMinimumValue) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Sorry"), title: trans("Sorry"),
description: description:
"${trans(context, "Spend a minimum of")} ${formatDoubleCurrency(total: doubleMinimumValue)} ${trans(context, "for")} ${CheckoutSession.getInstance.shippingType.getTitle()}", "${trans("Spend a minimum of")} ${formatDoubleCurrency(total: doubleMinimumValue)} ${trans("for")} ${CheckoutSession.getInstance.shippingType.getTitle()}",
style: ToastNotificationStyleType.INFO, style: ToastNotificationStyleType.INFO,
duration: Duration(seconds: 3)); duration: Duration(seconds: 3));
return; return;
@ -428,8 +422,8 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
if (!appStatus) { if (!appStatus) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Sorry"), title: trans("Sorry"),
description: "${trans(context, "Retry later")}", description: "${trans("Retry later")}",
style: ToastNotificationStyleType.INFO, style: ToastNotificationStyleType.INFO,
duration: Duration(seconds: 3)); duration: Duration(seconds: 3));
return; return;

View File

@ -15,12 +15,13 @@ 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/app/models/customer_country.dart'; import 'package:flutter_app/app/models/customer_country.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/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/customer_address_input.dart'; import 'package:flutter_app/resources/widgets/customer_address_input.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/switch_address_tab.dart'; import 'package:flutter_app/resources/widgets/switch_address_tab.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:validated/validated.dart' as validate;
class CheckoutDetailsPage extends StatefulWidget { class CheckoutDetailsPage extends StatefulWidget {
CheckoutDetailsPage(); CheckoutDetailsPage();
@ -161,12 +162,11 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Billing & Shipping Details"), trans("Billing & Shipping Details"),
), ),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: GestureDetector( child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(new FocusNode()), onTap: () => FocusScope.of(context).requestFocus(new FocusNode()),
child: Column( child: Column(
@ -195,7 +195,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
children: <Widget>[ children: <Widget>[
SwitchAddressTab( SwitchAddressTab(
title: title:
trans(context, "Billing Details"), trans("Billing Details"),
currentTabIndex: activeTabIndex, currentTabIndex: activeTabIndex,
type: "billing", type: "billing",
onTapAction: () => setState(() { onTapAction: () => setState(() {
@ -203,8 +203,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
activeTab = tabBillingDetails(); activeTab = tabBillingDetails();
})), })),
SwitchAddressTab( SwitchAddressTab(
title: trans( title: trans("Shipping Address"),
context, "Shipping Address"),
currentTabIndex: activeTabIndex, currentTabIndex: activeTabIndex,
type: "shipping", type: "shipping",
onTapAction: () => setState(() { onTapAction: () => setState(() {
@ -225,7 +224,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
fit: FlexFit.tight, fit: FlexFit.tight,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: NyColors.of(context).backgroundContainer, color: ThemeColor.get(context).backgroundContainer,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
@ -246,7 +245,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text( Text(
trans(context, "Ship to a different address?"), trans("Ship to a different address?"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
), ),
Checkbox( Checkbox(
@ -260,7 +259,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text( Text(
trans(context, "Remember my details"), trans("Remember my details"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
), ),
Checkbox( Checkbox(
@ -274,7 +273,7 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
], ],
), ),
PrimaryButton( PrimaryButton(
title: trans(context, "USE DETAILS"), title: trans("USE DETAILS"),
action: () => _useDetailsTapped(), action: () => _useDetailsTapped(),
), ),
], ],
@ -315,9 +314,31 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
if (customerShippingAddress.hasMissingFields()) { if (customerShippingAddress.hasMissingFields()) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, description: trans("Invalid shipping address, please check your shipping details"),
"Invalid shipping address, please check your shipping details"), style: ToastNotificationStyleType.WARNING,
);
return;
}
// Email validation
String billingEmail = _txtBillingEmailAddress.text;
String shippingEmail = _txtShippingEmailAddress.text;
if (billingEmail.length > 0 && !validate.isEmail(billingEmail)) {
showToastNotification(
context,
title: trans("Oops"),
description: trans("Please enter a valid billing email"),
style: ToastNotificationStyleType.WARNING,
);
return;
}
if (shippingEmail.length > 0 && !validate.isEmail(shippingEmail)) {
showToastNotification(
context,
title: trans("Oops"),
description: trans("Please enter a valid shipping email"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
); );
return; return;

View File

@ -13,8 +13,8 @@ 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';
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/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
@ -51,13 +51,12 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Payment Method") trans("Payment Method")
), ),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: GestureDetector( child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(new FocusNode()), onTap: () => FocusScope.of(context).requestFocus(new FocusNode()),
child: LayoutBuilder( child: LayoutBuilder(
@ -81,7 +80,7 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
Expanded( Expanded(
child: paymentTypes.length == 0 ? Container( child: paymentTypes.length == 0 ? Container(
padding: EdgeInsets.only(top: 20), padding: EdgeInsets.only(top: 20),
child: Text(trans(context, "No payment methods are available"), style: Theme.of(context).textTheme.bodyText1,), child: Text(trans("No payment methods are available"), style: Theme.of(context).textTheme.bodyText1,),
) : ListView.separated( ) : ListView.separated(
itemCount: paymentTypes.length, itemCount: paymentTypes.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
@ -128,13 +127,13 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
), ),
), ),
LinkButton( LinkButton(
title: trans(context, "CANCEL"), title: trans("CANCEL"),
action: () => Navigator.pop(context), action: () => Navigator.pop(context),
), ),
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: NyColors.of(context).backgroundContainer, color: ThemeColor.get(context).backgroundContainer,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,

View File

@ -17,9 +17,9 @@ 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/app/models/shipping_type.dart'; import 'package:flutter_app/app/models/shipping_type.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/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
import 'package:woosignal/models/response/shipping_method.dart'; import 'package:woosignal/models/response/shipping_method.dart';
@ -238,13 +238,12 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Shipping Methods") trans("Shipping Methods")
), ),
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: GestureDetector( child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(new FocusNode()), onTap: () => FocusScope.of(context).requestFocus(new FocusNode()),
child: LayoutBuilder( child: LayoutBuilder(
@ -254,8 +253,7 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
children: <Widget>[ children: <Widget>[
Padding( Padding(
child: Center( child: Center(
child: Image.asset( child: Image.asset(getImageAsset('shipping_icon.png'),
getImageAsset('shipping_icon.png'),
height: 100, height: 100,
color: (Theme.of(context).brightness == Brightness.light) ? null : Colors.white, color: (Theme.of(context).brightness == Brightness.light) ? null : Colors.white,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
@ -328,17 +326,17 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
is FreeShipping is FreeShipping
? TextSpan( ? TextSpan(
text: text:
"Free postage", trans("Free postage"),
) )
: TextSpan( : TextSpan(
text: text:
"${trans(context, "Price")}: ${formatStringCurrency(total: snapshot.data)}", "${trans("Price")}: ${formatStringCurrency(total: snapshot.data)}",
)), )),
if (shippingOption[ if (shippingOption[
"min_amount"] != "min_amount"] !=
null) null)
TextSpan( TextSpan(
text: "\nSpend a minimum of " + text: "\n${trans("Spend a minimum of")} " +
formatStringCurrency( formatStringCurrency(
total: shippingOption[ total: shippingOption[
"min_amount"]), "min_amount"]),
@ -378,20 +376,19 @@ class _CheckoutShippingTypePageState extends State<CheckoutShippingTypePage> {
), ),
) )
: Text( : Text(
trans(context, trans("Shipping is not supported for your country, sorry"),
"Shipping is not supported for your country, sorry"),
style: style:
Theme.of(context).textTheme.headline6, Theme.of(context).textTheme.headline6,
textAlign: TextAlign.center, textAlign: TextAlign.center,
))), ))),
LinkButton( LinkButton(
title: trans(context, "CANCEL"), title: trans("CANCEL"),
action: () => Navigator.pop(context), action: () => Navigator.pop(context),
), ),
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: NyColors.of(context).backgroundContainer, color: ThemeColor.get(context).backgroundContainer,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,

View File

@ -67,23 +67,23 @@ class _CheckoutStatusState extends NyState<CheckoutStatusPage> {
children: <Widget>[ children: <Widget>[
Padding( Padding(
child: Text( child: Text(
trans(context, "Order Status"), trans("Order Status"),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
padding: EdgeInsets.only(bottom: 15), padding: EdgeInsets.only(bottom: 15),
), ),
Text( Text(
trans(context, "Thank You!"), trans("Thank You!"),
style: Theme.of(context).textTheme.headline6, style: Theme.of(context).textTheme.headline6,
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
Text( Text(
trans(context, "Your transaction details"), trans("Your transaction details"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
Text( Text(
"${trans(context, "Order Ref")}. #${_order.id.toString()}", "${trans("Order Ref")}. #${_order.id.toString()}",
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText1,
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
@ -112,7 +112,7 @@ class _CheckoutStatusState extends NyState<CheckoutStatusPage> {
Align( Align(
child: Padding( child: Padding(
child: Text( child: Text(
trans(context, "Items"), trans("Items"),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
@ -169,7 +169,7 @@ class _CheckoutStatusState extends NyState<CheckoutStatusPage> {
), ),
Align( Align(
child: LinkButton( child: LinkButton(
title: trans(context, "Back to Home"), title: trans("Back to Home"),
action: () => Navigator.pushNamed(context, "/home"), action: () => Navigator.pushNamed(context, "/home"),
), ),
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,

View File

@ -11,7 +11,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/app/models/default_shipping.dart'; import 'package:flutter_app/app/models/default_shipping.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/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
@ -46,12 +46,11 @@ class _CustomerCountriesPageState extends State<CustomerCountriesPage> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
title: Text( title: Text(
trans(context, "Select a country") trans("Select a country")
), ),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -67,7 +66,7 @@ class _CustomerCountriesPageState extends State<CustomerCountriesPage> {
offset: Offset(0, 2), offset: Offset(0, 2),
), ),
], ],
color: NyColors.of(context).background color: ThemeColor.get(context).background
), ),
height: 60, height: 60,
child: Row( child: Row(
@ -146,7 +145,7 @@ class _CustomerCountriesPageState extends State<CustomerCountriesPage> {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Select a state"), title: trans("Select a state"),
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
itemCount: defaultShipping.states.length, itemCount: defaultShipping.states.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {

View File

@ -10,8 +10,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.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/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
import '../widgets/woosignal_ui.dart'; import '../widgets/woosignal_ui.dart';
@ -50,8 +50,7 @@ class _HomeSearchPageState extends State<HomeSearchPage> {
title: StoreLogo(height: 55), title: StoreLogo(height: 55),
centerTitle: true, centerTitle: true,
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -71,7 +70,7 @@ class _HomeSearchPageState extends State<HomeSearchPage> {
Padding( Padding(
padding: const EdgeInsets.only(top: 10), padding: const EdgeInsets.only(top: 10),
child: PrimaryButton( child: PrimaryButton(
title: trans(context, "Search"), title: trans("Search"),
action: _actionSearch, action: _actionSearch,
), ),
) )

View File

@ -12,7 +12,8 @@ import 'package:flutter/material.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/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:nylo_framework/nylo_framework.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
class NoConnectionPage extends StatefulWidget { class NoConnectionPage extends StatefulWidget {
@ -34,8 +35,7 @@ class _NoConnectionPageState extends State<NoConnectionPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Center( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -49,12 +49,12 @@ class _NoConnectionPageState extends State<NoConnectionPage> {
Padding( Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Text( child: Text(
trans(context, "Oops, something went wrong"), trans("Oops, something went wrong"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
LinkButton(title: trans(context, "Retry"), action: _retry), LinkButton(title: trans("Retry"), action: _retry),
], ],
), ),
), ),
@ -67,8 +67,8 @@ class _NoConnectionPageState extends State<NoConnectionPage> {
if (wooSignalApp == null) { if (wooSignalApp == null) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: trans(context, "Retry later")); description: trans("Retry later"));
return; return;
} }

View File

@ -10,20 +10,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.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';
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';
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/cached_image_widget.dart'; import 'package:flutter_app/resources/widgets/cached_image_widget.dart';
import 'package:flutter_app/resources/widgets/cart_icon_widget.dart'; import 'package:flutter_app/resources/widgets/cart_icon_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_framework/nylo_framework.dart';
import 'package:nylo_support/widgets/ny_state.dart';
import 'package:nylo_support/widgets/ny_stateful_widget.dart';
import 'package:woosignal/models/response/product_variation.dart' as WS; import 'package:woosignal/models/response/product_variation.dart' as WS;
import 'package:woosignal/models/response/products.dart' as WSProduct; import 'package:woosignal/models/response/products.dart' as WSProduct;
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
@ -106,7 +102,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
wsModalBottom( wsModalBottom(
context, context,
title: title:
"${trans(context, "Select a")} ${_product.attributes[attributeIndex].name}", "${trans("Select a")} ${_product.attributes[attributeIndex].name}",
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
itemCount: _product.attributes[attributeIndex].options.length, itemCount: _product.attributes[attributeIndex].options.length,
separatorBuilder: (BuildContext context, int index) => Divider(), separatorBuilder: (BuildContext context, int index) => Divider(),
@ -140,8 +136,8 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
_itemAddToCart({CartLineItem cartLineItem}) async { _itemAddToCart({CartLineItem cartLineItem}) async {
await Cart.getInstance.addToCart(cartLineItem: cartLineItem); await Cart.getInstance.addToCart(cartLineItem: cartLineItem);
showStatusAlert(context, showStatusAlert(context,
title: trans(context, "Success"), title: trans("Success"),
subtitle: trans(context, "Added to cart"), subtitle: trans("Added to cart"),
duration: 1, duration: 1,
icon: Icons.add_shopping_cart); icon: Icons.add_shopping_cart);
setState(() {}); setState(() {});
@ -151,7 +147,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
WS.ProductVariation productVariation = findProductVariation(); WS.ProductVariation productVariation = findProductVariation();
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Options"), title: trans("Options"),
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
itemCount: _product.attributes.length, itemCount: _product.attributes.length,
separatorBuilder: (BuildContext context, int index) => Divider( separatorBuilder: (BuildContext context, int index) => Divider(
@ -167,7 +163,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
? Text(_tmpAttributeObj[index]["value"], ? Text(_tmpAttributeObj[index]["value"],
style: Theme.of(context).textTheme.bodyText1) style: Theme.of(context).textTheme.bodyText1)
: Text( : Text(
"${trans(context, "Select a")} ${_product.attributes[index].name}"), "${trans("Select a")} ${_product.attributes[index].name}"),
trailing: (_tmpAttributeObj.isNotEmpty && trailing: (_tmpAttributeObj.isNotEmpty &&
_tmpAttributeObj.containsKey(index)) _tmpAttributeObj.containsKey(index))
? Icon(Icons.check, color: Colors.blueAccent) ? Icon(Icons.check, color: Colors.blueAccent)
@ -184,49 +180,49 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
children: <Widget>[ children: <Widget>[
Text( Text(
(productVariation != null (productVariation != null
? "${trans(context, "Price")}: ${formatStringCurrency(total: productVariation.price)}" ? "${trans("Price")}: ${formatStringCurrency(total: productVariation.price)}"
: (((_product.attributes.length == : (((_product.attributes.length ==
_tmpAttributeObj.values.length) && _tmpAttributeObj.values.length) &&
productVariation == null) productVariation == null)
? trans(context, "This variation is unavailable") ? trans("This variation is unavailable")
: trans(context, "Choose your options"))), : trans("Choose your options"))),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
Text( Text(
(productVariation != null (productVariation != null
? productVariation.stockStatus != "instock" ? productVariation.stockStatus != "instock"
? trans(context, "Out of stock") ? trans("Out of stock")
: "" : ""
: ""), : ""),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
PrimaryButton( PrimaryButton(
title: trans(context, "Add to cart"), title: trans("Add to cart"),
action: () { action: () {
if (_product.attributes.length != if (_product.attributes.length !=
_tmpAttributeObj.values.length) { _tmpAttributeObj.values.length) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: description:
trans(context, "Please select valid options first"), trans("Please select valid options first"),
style: ToastNotificationStyleType.WARNING); style: ToastNotificationStyleType.WARNING);
return; return;
} }
if (productVariation == null) { if (productVariation == null) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans("Oops"),
description: description:
trans(context, "Product variation does not exist"), trans("Product variation does not exist"),
style: ToastNotificationStyleType.WARNING); style: ToastNotificationStyleType.WARNING);
return; return;
} }
if (productVariation.stockStatus != "instock") { if (productVariation.stockStatus != "instock") {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Sorry"), title: trans("Sorry"),
description: description:
trans(context, "This item is not in stock"), trans("This item is not in stock"),
style: ToastNotificationStyleType.WARNING); style: ToastNotificationStyleType.WARNING);
return; return;
} }
@ -271,7 +267,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
_modalBottomSheetMenu() { _modalBottomSheetMenu() {
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Description"), title: trans("Description"),
bodyWidget: SingleChildScrollView( bodyWidget: SingleChildScrollView(
child: Text( child: Text(
parseHtmlString(_product.description), parseHtmlString(_product.description),
@ -378,7 +374,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: NyColors.of(context).background, color: ThemeColor.get(context).background,
// boxShadow: wsBoxShadow(), // boxShadow: wsBoxShadow(),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
), ),
@ -395,7 +391,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text( Text(
trans(context, "Description"), trans("Description"),
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.caption .caption
@ -404,7 +400,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
), ),
MaterialButton( MaterialButton(
child: Text( child: Text(
trans(context, "Full description"), trans("Full description"),
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText2 .bodyText2
@ -439,7 +435,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: NyColors.of(context).background, color: ThemeColor.get(context).background,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black12, color: Colors.black12,
@ -463,7 +459,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text( Text(
trans(context, "Quantity"), trans("Quantity"),
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText1 .bodyText1
@ -515,14 +511,14 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
_product.type == "external" _product.type == "external"
? Flexible( ? Flexible(
child: PrimaryButton( child: PrimaryButton(
title: trans(context, "Buy Product"), title: trans("Buy Product"),
action: () => widget.controller action: () => widget.controller
.viewExternalProduct(_product), .viewExternalProduct(_product),
), ),
) )
: Flexible( : Flexible(
child: PrimaryButton( child: PrimaryButton(
title: trans(context, "Add to cart"), title: trans("Add to cart"),
action: () => _addItemToCart(), action: () => _addItemToCart(),
), ),
), ),
@ -545,8 +541,8 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
} }
if (_product.stockStatus != "instock") { if (_product.stockStatus != "instock") {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Sorry"), title: trans("Sorry"),
description: trans(context, "This item is out of stock"), description: trans("This item is out of stock"),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
icon: Icons.local_shipping); icon: Icons.local_shipping);
return; return;
@ -574,9 +570,9 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
if (_product.manageStock != null && _product.manageStock == true) { if (_product.manageStock != null && _product.manageStock == true) {
if (_quantityIndicator >= _product.stockQuantity) { if (_quantityIndicator >= _product.stockQuantity) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Maximum quantity reached"), title: trans("Maximum quantity reached"),
description: description:
"${trans(context, "Sorry, only")} ${_product.stockQuantity} ${trans(context, "left")}", "${trans("Sorry, only")} ${_product.stockQuantity} ${trans("left")}",
style: ToastNotificationStyleType.INFO); style: ToastNotificationStyleType.INFO);
return; return;
} }

View File

@ -8,11 +8,10 @@
// 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:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/app/controllers/product_image_viewer_controller.dart'; import 'package:flutter_app/app/controllers/product_image_viewer_controller.dart';
import 'package:flutter_app/bootstrap/helpers.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/safearea_widget.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.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';
@ -33,16 +32,16 @@ class _ProductImageViewerPageState extends NyState<ProductImageViewerPage> {
@override @override
void initState() { void initState() {
this._initialIndex = widget.controller.data()['index']; Map<String, dynamic> imageData = widget.controller.data();
this._arrImageSrc = widget.controller.data()['images']; this._initialIndex = imageData['index'];
this._arrImageSrc = imageData['images'];
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/config/app_font.dart';
import 'package:flutter_app/resources/themes/styles/base_styles.dart';
import 'package:flutter_app/resources/themes/text_theme/default_text_theme.dart'; import 'package:flutter_app/resources/themes/text_theme/default_text_theme.dart';
import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_framework/nylo_framework.dart';
@ -12,56 +13,48 @@ import 'package:nylo_framework/nylo_framework.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
ThemeData darkTheme() { ThemeData darkTheme(BaseColorStyles darkColors) {
TextTheme darkTheme = TextTheme darkTheme =
getAppTextTheme(appThemeFont, defaultTextTheme.merge(_darkTextTheme())); getAppTextTheme(appFont, defaultTextTheme.merge(_darkTextTheme(darkColors)));
return ThemeData( return ThemeData(
primaryColor: NyColors.light.primaryContent, primaryColor: darkColors.primaryContent,
backgroundColor: NyColors.dark.background, backgroundColor: darkColors.background,
colorScheme: ColorScheme.dark(), colorScheme: ColorScheme.dark(),
primaryColorLight: NyColors.light.primaryAccent, primaryColorDark: darkColors.primaryContent,
primaryColorDark: NyColors.dark.primaryContent, focusColor: darkColors.primaryContent,
focusColor: NyColors.dark.primaryContent, scaffoldBackgroundColor: darkColors.background,
scaffoldBackgroundColor: NyColors.dark.background,
hintColor: NyColors.light.primaryAccent,
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
backgroundColor: NyColors.dark.appBarBackground, backgroundColor: darkColors.appBarBackground,
titleTextStyle: darkTheme.headline6 titleTextStyle: darkTheme.headline6
.copyWith(color: NyColors.dark.appBarPrimaryContent), .copyWith(color: darkColors.appBarPrimaryContent),
iconTheme: IconThemeData(color: NyColors.dark.appBarPrimaryContent), iconTheme: IconThemeData(color: darkColors.appBarPrimaryContent),
elevation: 1.0, elevation: 1.0,
systemOverlayStyle: SystemUiOverlayStyle.light), systemOverlayStyle: SystemUiOverlayStyle.light),
buttonTheme: ButtonThemeData( buttonTheme: ButtonThemeData(
buttonColor: NyColors.dark.primaryAccent, buttonColor: darkColors.primaryAccent,
colorScheme: ColorScheme.light(primary: NyColors.dark.buttonBackground), colorScheme: ColorScheme.light(primary: darkColors.buttonBackground),
), ),
textButtonTheme: TextButtonThemeData( textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(primary: NyColors.dark.primaryContent), style: TextButton.styleFrom(primary: darkColors.primaryContent),
), ),
elevatedButtonTheme: ElevatedButtonThemeData( elevatedButtonTheme: ElevatedButtonThemeData(
style: TextButton.styleFrom( style: TextButton.styleFrom(
primary: NyColors.dark.buttonPrimaryContent, primary: darkColors.buttonPrimaryContent,
backgroundColor: NyColors.dark.buttonBackground), backgroundColor: darkColors.buttonBackground),
),
inputDecorationTheme: InputDecorationTheme(
focusedBorder:UnderlineInputBorder(
borderSide:BorderSide(color: Colors.black)
),
), ),
bottomNavigationBarTheme: BottomNavigationBarThemeData( bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: NyColors.dark.bottomTabBarBackground, backgroundColor: darkColors.bottomTabBarBackground,
unselectedIconTheme: unselectedIconTheme:
IconThemeData(color: NyColors.dark.bottomTabBarIconUnselected), IconThemeData(color: darkColors.bottomTabBarIconUnselected),
selectedIconTheme: selectedIconTheme:
IconThemeData(color: NyColors.dark.bottomTabBarIconSelected), IconThemeData(color: darkColors.bottomTabBarIconSelected),
unselectedLabelStyle: unselectedLabelStyle:
TextStyle(color: NyColors.dark.bottomTabBarLabelUnselected), TextStyle(color: darkColors.bottomTabBarLabelUnselected),
selectedLabelStyle: selectedLabelStyle:
TextStyle(color: NyColors.dark.bottomTabBarLabelSelected), TextStyle(color: darkColors.bottomTabBarLabelSelected),
selectedItemColor: NyColors.dark.bottomTabBarLabelSelected, selectedItemColor: darkColors.bottomTabBarLabelSelected,
), ),
textTheme: darkTheme, textTheme: darkTheme,
textSelectionTheme: TextSelectionThemeData(cursorColor: NyColors.dark.inputPrimaryContent),
); );
} }
@ -71,8 +64,8 @@ ThemeData darkTheme() {
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
TextTheme _darkTextTheme() { TextTheme _darkTextTheme(BaseColorStyles dark) {
final Color darkPrimaryContent = NyColors.dark.primaryContent; final Color darkPrimaryContent = dark.primaryContent;
return TextTheme( return TextTheme(
headline6: TextStyle( headline6: TextStyle(
color: darkPrimaryContent.withOpacity(0.8), color: darkPrimaryContent.withOpacity(0.8),
@ -108,7 +101,7 @@ TextTheme _darkTextTheme() {
color: darkPrimaryContent.withOpacity(0.8), color: darkPrimaryContent.withOpacity(0.8),
), ),
bodyText1: TextStyle( bodyText1: TextStyle(
color: NyColors.dark.primaryContent, color: darkPrimaryContent,
), ),
caption: TextStyle( caption: TextStyle(
color: darkPrimaryContent.withOpacity(0.8), color: darkPrimaryContent.withOpacity(0.8),

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/config/app_font.dart';
import 'package:flutter_app/resources/themes/styles/base_styles.dart';
import 'package:flutter_app/resources/themes/text_theme/default_text_theme.dart'; import 'package:flutter_app/resources/themes/text_theme/default_text_theme.dart';
import 'package:nylo_framework/nylo_framework.dart'; import 'package:nylo_framework/nylo_framework.dart';
@ -12,60 +13,51 @@ import 'package:nylo_framework/nylo_framework.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
ThemeData lightTheme() { ThemeData lightTheme(BaseColorStyles lightColors) {
TextTheme lightTheme = TextTheme lightTheme =
getAppTextTheme(appThemeFont, defaultTextTheme.merge(_lightTextTheme())); getAppTextTheme(appFont, defaultTextTheme.merge(_lightTextTheme(lightColors)));
final Color lightPrimaryContent = NyColors.light.primaryContent;
final Color darkPrimaryContent = NyColors.dark.primaryContent;
return ThemeData( return ThemeData(
primaryColor: lightPrimaryContent, primaryColor: lightColors.primaryContent,
backgroundColor: NyColors.light.background, backgroundColor: lightColors.background,
colorScheme: ColorScheme.light(), colorScheme: ColorScheme.light(),
primaryColorLight: NyColors.light.primaryAccent, primaryColorLight: lightColors.primaryAccent,
primaryColorDark: darkPrimaryContent, focusColor: lightColors.primaryContent,
focusColor: lightPrimaryContent, scaffoldBackgroundColor: lightColors.background,
scaffoldBackgroundColor: NyColors.light.background, hintColor: lightColors.primaryAccent,
hintColor: NyColors.light.primaryAccent,
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
backgroundColor: NyColors.light.appBarBackground, backgroundColor: lightColors.appBarBackground,
titleTextStyle: lightTheme.headline6 titleTextStyle: lightTheme.headline6
.copyWith(color: NyColors.light.appBarPrimaryContent), .copyWith(color: lightColors.appBarPrimaryContent),
iconTheme: IconThemeData(color: NyColors.light.appBarPrimaryContent), iconTheme: IconThemeData(color: lightColors.appBarPrimaryContent),
elevation: 1.0, elevation: 1.0,
systemOverlayStyle: SystemUiOverlayStyle.dark, systemOverlayStyle: SystemUiOverlayStyle.dark,
), ),
buttonTheme: ButtonThemeData( buttonTheme: ButtonThemeData(
buttonColor: NyColors.light.buttonPrimaryContent, buttonColor: lightColors.buttonPrimaryContent,
colorScheme: ColorScheme.light(primary: NyColors.light.buttonBackground), colorScheme: ColorScheme.light(primary: lightColors.buttonBackground),
), ),
textButtonTheme: TextButtonThemeData( textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(primary: lightPrimaryContent), style: TextButton.styleFrom(primary: lightColors.primaryContent),
), ),
elevatedButtonTheme: ElevatedButtonThemeData( elevatedButtonTheme: ElevatedButtonThemeData(
style: TextButton.styleFrom( style: TextButton.styleFrom(
primary: NyColors.light.buttonPrimaryContent, primary: lightColors.buttonPrimaryContent,
backgroundColor: NyColors.light.buttonBackground), backgroundColor: lightColors.buttonBackground),
), ),
inputDecorationTheme: InputDecorationTheme(
focusedBorder:UnderlineInputBorder(
borderSide:BorderSide(color: Colors.black)
),
),
bottomNavigationBarTheme: BottomNavigationBarThemeData( bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: NyColors.light.bottomTabBarBackground, backgroundColor: lightColors.bottomTabBarBackground,
unselectedIconTheme: unselectedIconTheme:
IconThemeData(color: NyColors.light.bottomTabBarIconUnselected), IconThemeData(color: lightColors.bottomTabBarIconUnselected),
selectedIconTheme: selectedIconTheme:
IconThemeData(color: NyColors.light.bottomTabBarIconSelected), IconThemeData(color: lightColors.bottomTabBarIconSelected),
unselectedLabelStyle: unselectedLabelStyle:
TextStyle(color: NyColors.light.bottomTabBarLabelUnselected), TextStyle(color: lightColors.bottomTabBarLabelUnselected),
selectedLabelStyle: selectedLabelStyle:
TextStyle(color: NyColors.light.bottomTabBarLabelSelected), TextStyle(color: lightColors.bottomTabBarLabelSelected),
selectedItemColor: NyColors.light.bottomTabBarLabelSelected, selectedItemColor: lightColors.bottomTabBarLabelSelected,
), ),
textTheme: lightTheme, textTheme: lightTheme,
textSelectionTheme: TextSelectionThemeData(cursorColor: NyColors.light.inputPrimaryContent)
); );
} }
@ -75,8 +67,8 @@ ThemeData lightTheme() {
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
TextTheme _lightTextTheme() { TextTheme _lightTextTheme(BaseColorStyles lightColors) {
final Color lightPrimaryContent = NyColors.light.primaryContent; Color lightPrimaryContent = lightColors.primaryContent;
return TextTheme( return TextTheme(
headline6: TextStyle( headline6: TextStyle(
color: lightPrimaryContent, color: lightPrimaryContent,

View File

@ -3,13 +3,16 @@ import 'package:flutter/material.dart';
/// Interface for your base styles. /// Interface for your base styles.
/// Add more styles here and then implement in /// Add more styles here and then implement in
/// light_theme_colors.dart and dark_theme_colors.dart. /// light_theme_colors.dart and dark_theme_colors.dart.
abstract class BaseStyles { abstract class BaseColorStyles {
// general // general
Color get background; Color get background;
Color get backgroundContainer; Color get backgroundContainer;
Color get primaryContent; Color get primaryContent;
Color get primaryAccent; Color get primaryAccent;
Color get surfaceBackground;
Color get surfaceContent;
// app bar // app bar
Color get appBarBackground; Color get appBarBackground;
Color get appBarPrimaryContent; Color get appBarPrimaryContent;

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/resources/themes/styles/theme_styles.dart'; import 'package:flutter_app/resources/themes/styles/base_styles.dart';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -7,7 +7,7 @@ import 'package:flutter_app/resources/themes/styles/theme_styles.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
class DarkThemeColors implements BaseStyles { class DarkThemeColors implements BaseColorStyles {
// general // general
Color get background => const Color(0xFF212121); Color get background => const Color(0xFF212121);
Color get backgroundContainer => const Color(0xFF4a4a4a); Color get backgroundContainer => const Color(0xFF4a4a4a);
@ -15,6 +15,9 @@ class DarkThemeColors implements BaseStyles {
Color get primaryContent => const Color(0xFFE1E1E1); Color get primaryContent => const Color(0xFFE1E1E1);
Color get primaryAccent => const Color(0xFF818181); Color get primaryAccent => const Color(0xFF818181);
Color get surfaceBackground => Color(0xFF818181);
Color get surfaceContent => Colors.black;
// app bar // app bar
Color get appBarBackground => const Color(0xFF2C2C2C); Color get appBarBackground => const Color(0xFF2C2C2C);
Color get appBarPrimaryContent => Colors.white; Color get appBarPrimaryContent => Colors.white;

View File

@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/resources/themes/styles/theme_styles.dart'; import 'package:flutter_app/resources/themes/styles/base_styles.dart';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -7,13 +7,16 @@ import 'package:flutter_app/resources/themes/styles/theme_styles.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
class LightThemeColors implements BaseStyles { class LightThemeColors implements BaseColorStyles {
// general // general
Color get background => const Color(0xFFFFFFFF); Color get background => const Color(0xFFFFFFFF);
Color get backgroundContainer => Colors.white; Color get backgroundContainer => Colors.white;
Color get primaryContent => const Color(0xFF000000); Color get primaryContent => const Color(0xFF000000);
Color get primaryAccent => const Color(0xFF87c694); Color get primaryAccent => const Color(0xFF87c694);
Color get surfaceBackground => Colors.white;
Color get surfaceContent => Colors.black;
// app bar // app bar
Color get appBarBackground => Colors.white; Color get appBarBackground => Colors.white;
Color get appBarPrimaryContent => const Color(0xFF3a3d40); Color get appBarPrimaryContent => const Color(0xFF3a3d40);

View File

@ -30,7 +30,7 @@ class AppVersionWidget extends StatelessWidget {
if (snapshot.hasError) return Text(""); if (snapshot.hasError) return Text("");
return Padding( return Padding(
child: Text( child: Text(
"${trans(context, "Version")}: ${snapshot.data.version}", "${trans("Version")}: ${snapshot.data.version}",
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText2 .bodyText2

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:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';

View File

@ -8,8 +8,6 @@ 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 'package:nylo_framework/nylo_framework.dart';
import 'dart:async'; import 'dart:async';
import 'package:nylo_support/helpers/helper.dart';
import 'package:nylo_support/widgets/ny_state.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
@ -101,9 +99,9 @@ class WebViewState extends NyState<PayPalCheckout> {
} }
String _loadHTML() { String _loadHTML() {
final String strProcessingPayment = trans(context, "Processing Payment"); final String strProcessingPayment = trans("Processing Payment");
final String strPleaseWait = trans(context, "Please wait, your order is being processed and you will be redirected to the PayPal website."); final String strPleaseWait = trans("Please wait, your order is being processed and you will be redirected to the PayPal website.");
final String strRedirectMessage = trans(context, "If you are not automatically redirected to PayPal within 5 seconds"); final String strRedirectMessage = trans("If you are not automatically redirected to PayPal within 5 seconds");
return ''' return '''
<html><head><title>$strProcessingPayment...</title></head> <html><head><title>$strProcessingPayment...</title></head>

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:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/app/models/customer_country.dart'; import 'package:flutter_app/app/models/customer_country.dart';
import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
@ -49,14 +48,14 @@ class CustomerAddressInput extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "First Name"), heading: trans("First Name"),
controller: txtControllerFirstName, controller: txtControllerFirstName,
shouldAutoFocus: true, shouldAutoFocus: true,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Last Name"), heading: trans("Last Name"),
controller: txtControllerLastName, controller: txtControllerLastName,
), ),
), ),
@ -70,13 +69,13 @@ class CustomerAddressInput extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Address Line"), heading: trans("Address Line"),
controller: txtControllerAddressLine, controller: txtControllerAddressLine,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "City"), heading: trans("City"),
controller: txtControllerCity, controller: txtControllerCity,
), ),
), ),
@ -88,13 +87,13 @@ class CustomerAddressInput extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Postal code"), heading: trans("Postal code"),
controller: txtControllerPostalCode, controller: txtControllerPostalCode,
), ),
), ),
Flexible( Flexible(
child: TextEditingRow( child: TextEditingRow(
heading: trans(context, "Email address"), heading: trans("Email address"),
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
controller: txtControllerEmailAddress), controller: txtControllerEmailAddress),
), ),
@ -113,7 +112,7 @@ class CustomerAddressInput extends StatelessWidget {
Container( Container(
height: 23, height: 23,
child: Text( child: Text(
trans(context, "State"), trans("State"),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText1,
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
@ -123,7 +122,7 @@ class CustomerAddressInput extends StatelessWidget {
child: SecondaryButton( child: SecondaryButton(
title: (customerCountry.state != null title: (customerCountry.state != null
? (customerCountry?.state?.name ?? "") ? (customerCountry?.state?.name ?? "")
: trans(context, "Select state")), : trans("Select state")),
action: onTapCountry, action: onTapCountry,
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
@ -137,7 +136,7 @@ class CustomerAddressInput extends StatelessWidget {
Container( Container(
height: 23, height: 23,
child: Text( child: Text(
trans(context, "Country"), trans("Country"),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText1,
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
@ -148,7 +147,7 @@ class CustomerAddressInput extends StatelessWidget {
title: (customerCountry != null && title: (customerCountry != null &&
(customerCountry?.name ?? "").isNotEmpty (customerCountry?.name ?? "").isNotEmpty
? customerCountry.name ? customerCountry.name
: trans(context, "Select country")), : trans("Select country")),
action: onTapCountry, action: onTapCountry,
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),

View File

@ -12,7 +12,6 @@
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_framework/theme/helper/ny_theme.dart';
@ -35,33 +34,33 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
bool isDark = (Theme.of(context).brightness == Brightness.dark); bool isDark = (Theme.of(context).brightness == Brightness.dark);
return Drawer( return Drawer(
child: Container( child: Container(
color: NyColors.of(context).background, color: ThemeColor.get(context).background,
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: NyColors.of(context).background, color: ThemeColor.get(context).background,
), ),
), ),
Padding( Padding(
child: Text( child: Text(
trans(context, "Menu"), trans("Menu"),
style: Theme.of(context).textTheme.subtitle2, style: Theme.of(context).textTheme.subtitle2,
), ),
padding: EdgeInsets.only(left: 16, top: 8, bottom: 8), padding: EdgeInsets.only(left: 16, top: 8, bottom: 8),
), ),
if (widget.wooSignalApp.wpLoginEnabled == 1) if (widget.wooSignalApp.wpLoginEnabled == 1)
ListTile( ListTile(
title: Text(trans(context, "Profile"), style: Theme.of(context).textTheme.bodyText2.copyWith( title: Text(trans("Profile"), style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: 16 fontSize: 16
),), ),),
leading: Icon(Icons.account_circle), leading: Icon(Icons.account_circle),
onTap: _actionProfile, onTap: _actionProfile,
), ),
ListTile( ListTile(
title: Text(trans(context, "Cart"), style: Theme.of(context).textTheme.bodyText2.copyWith( title: Text(trans("Cart"), style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: 16 fontSize: 16
),), ),),
leading: Icon(Icons.shopping_cart), leading: Icon(Icons.shopping_cart),
@ -70,7 +69,7 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
if (widget.wooSignalApp.appTermslink != null && widget.wooSignalApp.appPrivacylink != null) if (widget.wooSignalApp.appTermslink != null && widget.wooSignalApp.appPrivacylink != null)
Padding( Padding(
child: Text( child: Text(
trans(context, "About Us"), trans("About Us"),
style: Theme.of(context).textTheme.subtitle2, style: Theme.of(context).textTheme.subtitle2,
), ),
padding: EdgeInsets.only(left: 16, top: 8, bottom: 8), padding: EdgeInsets.only(left: 16, top: 8, bottom: 8),
@ -78,7 +77,7 @@ 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("Terms and conditions"),
style: Theme.of(context).textTheme.bodyText2.copyWith( style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: 16 fontSize: 16
),), ),),
@ -89,7 +88,7 @@ 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"), style: Theme.of(context).textTheme.bodyText2.copyWith( title: Text(trans("Privacy policy"), style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: 16 fontSize: 16
),), ),),
trailing: Icon(Icons.keyboard_arrow_right_rounded), trailing: Icon(Icons.keyboard_arrow_right_rounded),
@ -98,7 +97,7 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
), ),
ListTile( ListTile(
title: Text( title: Text(
trans(context, (isDark ? "Light Mode" : "Dark Mode")), trans((isDark ? "Light Mode" : "Dark Mode")),
style: Theme.of(context).textTheme.bodyText2.copyWith( style: Theme.of(context).textTheme.bodyText2.copyWith(
fontSize: 16 fontSize: 16
) )

View File

@ -3,6 +3,7 @@ import 'package:flutter_app/bootstrap/helpers.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/cart_icon_widget.dart'; import 'package:flutter_app/resources/widgets/cart_icon_widget.dart';
import 'package:flutter_app/resources/widgets/home_drawer_widget.dart'; import 'package:flutter_app/resources/widgets/home_drawer_widget.dart';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -81,7 +82,7 @@ class _MelloThemeWidgetState extends State<MelloThemeWidget> {
widget.globalKey.currentState.setState(() {}); widget.globalKey.currentState.setState(() {});
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Categories"), title: trans("Categories"),
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
itemCount: _categories.length, itemCount: _categories.length,
separatorBuilder: (cxt, i) => Divider(), separatorBuilder: (cxt, i) => Divider(),
@ -119,8 +120,7 @@ class _MelloThemeWidgetState extends State<MelloThemeWidget> {
CartIconWidget(key: widget.globalKey), CartIconWidget(key: widget.globalKey),
], ],
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -18,7 +18,7 @@ class NoResultsForProductsWidget extends StatelessWidget {
Widget build(BuildContext context) => Column( Widget build(BuildContext context) => Column(
children: <Widget>[ children: <Widget>[
Text( Text(
trans(context, "No results"), trans("No results"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
), ),
], ],

View File

@ -5,6 +5,7 @@ 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/home_drawer_widget.dart'; import 'package:flutter_app/resources/widgets/home_drawer_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';
import 'package:flutter_app/resources/widgets/safearea_widget.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:flutter_swiper/flutter_swiper.dart';
@ -83,7 +84,7 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
_modalBottomSheetMenu() { _modalBottomSheetMenu() {
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Categories"), title: trans("Categories"),
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
itemCount: _categories.length, itemCount: _categories.length,
separatorBuilder: (cxt, i) => Divider(), separatorBuilder: (cxt, i) => Divider(),
@ -116,7 +117,7 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
onTap: _modalBottomSheetMenu, onTap: _modalBottomSheetMenu,
child: Text( child: Text(
trans(context, "Categories"), trans("Categories"),
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
), ),
), ),
@ -124,8 +125,7 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
), ),
], ],
), ),
body: SafeArea( body: SafeAreaWidget(
minimum: safeAreaDefault(),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -156,10 +156,10 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(trans(context, "Must have")), Text(trans("Must have")),
Flexible( Flexible(
child: Text( child: Text(
trans(context, "Our selection of new items"), trans("Our selection of new items"),
style: Theme.of(context).textTheme.headline4, style: Theme.of(context).textTheme.headline4,
maxLines: 2, overflow: TextOverflow.ellipsis, maxLines: 2, overflow: TextOverflow.ellipsis,
), ),
@ -176,18 +176,17 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
Widget body; Widget body;
if (mode == LoadStatus.idle) { if (mode == LoadStatus.idle) {
body = Text(trans(context, "pull up load")); body = Text(trans("pull up load"));
} else if (mode == LoadStatus.loading) { } else if (mode == LoadStatus.loading) {
body = CupertinoActivityIndicator(); body = CupertinoActivityIndicator();
} else if (mode == LoadStatus.failed) { } else if (mode == LoadStatus.failed) {
body = Text(trans( body = Text(trans("Load Failed! Click retry!"));
context, "Load Failed! Click retry!"));
} else if (mode == LoadStatus.canLoading) { } else if (mode == LoadStatus.canLoading) {
body = Text( body = Text(
trans(context, "release to load more")); trans("release to load more"));
} else { } else {
body = body =
Text(trans(context, "No more products")); Text(trans("No more products"));
} }
return Container( return Container(
height: 55.0, height: 55.0,

View File

@ -1,4 +1,16 @@
import 'package:flutter/cupertino.dart'; //
// 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/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart'; import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';

View File

@ -17,7 +17,7 @@ class SafeAreaWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
minimum: EdgeInsets.symmetric(horizontal: 16, vertical: 8), minimum: EdgeInsets.only(left: 16, right: 16, bottom: 8),
child: child, child: child,
); );
} }

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:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SwitchAddressTab extends StatelessWidget { class SwitchAddressTab extends StatelessWidget {

View File

@ -26,7 +26,7 @@ class TopNavWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
"${(trans(context, "Shop").capitalize())} / ", "${(trans("Shop").capitalize())} / ",
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.subtitle1 .subtitle1
@ -34,7 +34,7 @@ class TopNavWidget extends StatelessWidget {
maxLines: 1, maxLines: 1,
), ),
AutoSizeText( AutoSizeText(
trans(context, "Newest"), trans("Newest"),
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText2 .bodyText2
@ -48,7 +48,7 @@ class TopNavWidget extends StatelessWidget {
minWidth: 100, minWidth: 100,
height: 60, height: 60,
child: AutoSizeText( child: AutoSizeText(
trans(context, "Browse categories"), trans("Browse categories"),
style: Theme.of(context).textTheme.bodyText1, style: Theme.of(context).textTheme.bodyText1,
maxLines: 1, maxLines: 1,
textAlign: TextAlign.right, textAlign: TextAlign.right,

View File

@ -12,13 +12,11 @@
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';
import 'package:flutter/widgets.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';
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';
@ -62,15 +60,15 @@ class RefreshableScrollContainer extends StatelessWidget {
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
Widget body; Widget body;
if (mode == LoadStatus.idle) { if (mode == LoadStatus.idle) {
body = Text(trans(context, "pull up load")); body = Text(trans("pull up load"));
} else if (mode == LoadStatus.loading) { } else if (mode == LoadStatus.loading) {
body = CupertinoActivityIndicator(); body = CupertinoActivityIndicator();
} else if (mode == LoadStatus.failed) { } else if (mode == LoadStatus.failed) {
body = Text(trans(context, "Load Failed! Click retry!")); body = Text(trans("Load Failed! Click retry!"));
} else if (mode == LoadStatus.canLoading) { } else if (mode == LoadStatus.canLoading) {
body = Text(trans(context, "release to load more")); body = Text(trans("release to load more"));
} else { } else {
body = Text(trans(context, "No more products")); body = Text(trans("No more products"));
} }
return Container( return Container(
height: 55.0, height: 55.0,
@ -239,7 +237,7 @@ class TextEditingRow extends StatelessWidget {
child: Text( child: Text(
heading, heading,
style: Theme.of(context).textTheme.bodyText1.copyWith( style: Theme.of(context).textTheme.bodyText1.copyWith(
color: NyColors.of(context).primaryContent color: ThemeColor.get(context).primaryContent
), ),
), ),
padding: EdgeInsets.only(bottom: 2), padding: EdgeInsets.only(bottom: 2),
@ -356,7 +354,7 @@ class ProductItemContainer extends StatelessWidget {
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: text:
"${workoutSaleDiscount(salePrice: product.salePrice, priceBefore: product.regularPrice)}% ${trans(context, "off")}", "${workoutSaleDiscount(salePrice: product.salePrice, priceBefore: product.regularPrice)}% ${trans("off")}",
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText1 .bodyText1
@ -404,7 +402,7 @@ class ProductItemContainer extends StatelessWidget {
? RichText( ? RichText(
text: TextSpan(children: [ text: TextSpan(children: [
TextSpan( TextSpan(
text: '${trans(context, "Was")}: ', text: '${trans("Was")}: ',
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.bodyText1 .bodyText1
@ -456,7 +454,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: NyColors.of(context).background, color: ThemeColor.get(context).background,
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),
@ -480,7 +478,7 @@ wsModalBottom(BuildContext context,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: boxShadow:
(Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null, (Theme.of(context).brightness == Brightness.light) ? wsBoxShadow() : null,
color: NyColors.of(context).background, color: ThemeColor.get(context).background,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: bodyWidget, child: bodyWidget,
@ -508,7 +506,7 @@ FutureBuilder getTotalWidget() => FutureBuilder<String>(
else else
return new Padding( return new Padding(
child: TextRowWidget( child: TextRowWidget(
title: trans(context, "Total"), title: trans("Total"),
text: snapshot.data, text: snapshot.data,
), ),
padding: EdgeInsets.only(bottom: 15, top: 15), padding: EdgeInsets.only(bottom: 15, top: 15),
@ -555,7 +553,7 @@ FutureBuilder wsCheckoutTaxAmountWidgetFB({TaxRate taxRate}) {
: Padding( : Padding(
child: widgetCheckoutMeta( child: widgetCheckoutMeta(
context, context,
title: trans(context, "Tax"), title: trans("Tax"),
amount: formatStringCurrency(total: snapshot.data), amount: formatStringCurrency(total: snapshot.data),
), ),
padding: EdgeInsets.only(bottom: 0, top: 0), padding: EdgeInsets.only(bottom: 0, top: 0),
@ -688,8 +686,8 @@ class CartItemContainer extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Text( Text(
(cartLineItem.stockStatus == "outofstock" (cartLineItem.stockStatus == "outofstock"
? trans(context, "Out of stock") ? trans("Out of stock")
: trans(context, "In Stock")), : trans("In Stock")),
style: (cartLineItem.stockStatus == "outofstock" style: (cartLineItem.stockStatus == "outofstock"
? Theme.of(context).textTheme.caption ? Theme.of(context).textTheme.caption
: Theme.of(context).textTheme.bodyText2), : Theme.of(context).textTheme.bodyText2),

View File

@ -35,14 +35,14 @@ packages:
name: args name: args
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.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.8.1" version: "2.8.2"
auto_size_text: auto_size_text:
dependency: "direct main" dependency: "direct main"
description: description:
@ -91,7 +91,7 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
@ -255,7 +255,42 @@ 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.1" version: "5.0.2"
flutter_secure_storage_linux:
dependency: transitive
description:
name: flutter_secure_storage_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
flutter_secure_storage_macos:
dependency: transitive
description:
name: flutter_secure_storage_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
flutter_secure_storage_platform_interface:
dependency: transitive
description:
name: flutter_secure_storage_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_secure_storage_web:
dependency: transitive
description:
name: flutter_secure_storage_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
flutter_secure_storage_windows:
dependency: transitive
description:
name: flutter_secure_storage_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
flutter_spinkit: flutter_spinkit:
dependency: "direct main" dependency: "direct main"
description: description:
@ -398,7 +433,7 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.10" version: "0.12.11"
math_expressions: math_expressions:
dependency: "direct main" dependency: "direct main"
description: description:
@ -426,14 +461,14 @@ packages:
name: nylo_framework name: nylo_framework
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.4" version: "2.1.1"
nylo_support: nylo_support:
dependency: transitive 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: "2.1.0" version: "2.2.1"
octo_image: octo_image:
dependency: transitive dependency: transitive
description: description:
@ -560,6 +595,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.0"
recase:
dependency: transitive
description:
name: recase
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
rxdart: rxdart:
dependency: transitive dependency: transitive
description: description:
@ -704,7 +746,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.2" version: "0.4.3"
theme_provider: theme_provider:
dependency: transitive dependency: transitive
description: description:
@ -733,13 +775,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.5" version: "3.0.5"
validated:
dependency: "direct main"
description:
name: validated
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
watcher: watcher:
dependency: transitive dependency: transitive
description: description:
@ -818,5 +867,5 @@ packages:
source: hosted source: hosted
version: "3.1.0" version: "3.1.0"
sdks: sdks:
dart: ">=2.14.4 <3.0.0" dart: ">=2.15.0 <3.0.0"
flutter: ">=2.5.0" flutter: ">=2.5.0"

View File

@ -1,7 +1,7 @@
# Official WooSignal App Template for WooCommerce # Official WooSignal App Template for WooCommerce
# Label StoreMax # Label StoreMax
# Version: 5.3.1 # Version: 5.4.0
# Author: Anthony Gordon # Author: Anthony Gordon
# Homepage: https://woosignal.com # Homepage: https://woosignal.com
# Documentation: https://woosignal.com/docs/app/label-storemax # Documentation: https://woosignal.com/docs/app/label-storemax
@ -29,7 +29,7 @@ dependencies:
analyzer: ^1.5.0 analyzer: ^1.5.0
intl: ^0.17.0 intl: ^0.17.0
page_transition: ^2.0.4 page_transition: ^2.0.4
nylo_framework: ^2.0.4 nylo_framework: ^2.1.1
woosignal: ^2.2.1 woosignal: ^2.2.1
flutter_stripe: ^2.0.2 flutter_stripe: ^2.0.2
wp_json_api: ^3.1.3 wp_json_api: ^3.1.3
@ -46,6 +46,7 @@ dependencies:
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.2.0 math_expressions: ^2.2.0
validated: ^2.0.0
hexcolor: ^2.0.5 hexcolor: ^2.0.5
flutter_spinkit: ^5.1.0 flutter_spinkit: ^5.1.0
auto_size_text: ^3.0.0 auto_size_text: ^3.0.0
@ -91,12 +92,5 @@ flutter:
- public/assets/images/razorpay.png - public/assets/images/razorpay.png
- public/assets/images/paypal_logo.png - public/assets/images/paypal_logo.png
- public/assets/json/default_shipping.json - public/assets/json/default_shipping.json
- lang/en.json - lang/
- lang/es.json
- lang/fr.json
- lang/it.json
- lang/de.json
- lang/hi.json
- lang/pt.json
- lang/zh.json
- .env - .env

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.3.1 ### Label StoreMax - v5.4.0
[Official WooSignal WooCommerce App](https://woosignal.com) [Official WooSignal WooCommerce App](https://woosignal.com)