diff --git a/LabelStoreMax/.env b/LabelStoreMax/.env
new file mode 100644
index 0000000..7e67e4b
--- /dev/null
+++ b/LabelStoreMax/.env
@@ -0,0 +1,34 @@
+# **
+
+APP_NAME="MyApp"
+APP_ENV="local"
+APP_DEBUG="true"
+APP_URL="https://mywoocommercestore.com"
+
+ASSET_PATH_PUBLIC="public/assets/"
+ASSET_PATH_IMAGES="public/assets/images"
+TIMEZONE="UTC"
+DEFAULT_LOCALE="en"
+
+# **
+
+APP_KEY="your app key"
+# App key from WooSignal link: https://woosignal.com/dashboard/apps
+
+# **
+
+STRIPE_ACCOUNT="Stripe account key from WooSignal"
+# Stripe account key from WooSignal https://woosignal.com/dashboard
+
+STRIPE_LIVE_MODE="false"
+# Change to 'true' for live payments and update the "Environment for Stripe" here https://woosignal.com/dashboard
+
+# **
+
+RAZORPAY_ID=""
+# Razorpay ID from https://razorpay.com
+
+# **
+
+PRODUCT_PLACEHOLDER_IMAGE="https://woosignal.com/images/woocommerce-placeholder.png"
+# Sets the default placeholder image for products with no image
\ No newline at end of file
diff --git a/LabelStoreMax/CHANGELOG.md b/LabelStoreMax/CHANGELOG.md
index 04f45b1..56fe171 100644
--- a/LabelStoreMax/CHANGELOG.md
+++ b/LabelStoreMax/CHANGELOG.md
@@ -1,3 +1,15 @@
+## [4.0.0] - 2020-03-28
+
+* Major release
+* New config structure
+* Dark mode added
+* Menu drawer added
+* Project refactor to use Nylo Framework
+* Performance boost
+* Bug fixes
+* Dart code formatted
+* Pubspec.yaml dependency updates
+
## [3.0.0] - 2020-03-08
* Major release
diff --git a/LabelStoreMax/LICENSE b/LabelStoreMax/LICENSE
new file mode 100644
index 0000000..541ae49
--- /dev/null
+++ b/LabelStoreMax/LICENSE
@@ -0,0 +1,25 @@
+BSD 2-Clause License
+
+Copyright (c) 2021, WooSignal Ltd
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LabelStoreMax/README.md b/LabelStoreMax/README.md
index 2070cd9..d68588d 100644
--- a/LabelStoreMax/README.md
+++ b/LabelStoreMax/README.md
@@ -1,30 +1,60 @@
-# label_storemax
+
+
+
-LabelStoreMAX
-Created by Anthony Gordon.
+# WooCommerce App: Label StoreMax
-[Official WooSignal App Template](https://woosignal.com)
+### Label StoreMax - v4.0.0
-## Getting Started
-1. Connect your WooCommerce store
-Click connect above to link your WooCommerce store to our site, all you'll need to do is add your url to provide WooSignal access.
+[Official WooSignal WooCommerce App](https://woosignal.com)
-2. Generate an AppKey for the app
-Next go to [manage apps page](https://woosignal.com/dashboard/apps) and click "Generate new key" for your app and copy it to somewhere safe, it's important that you don't share is with anyone.
+
-3. Add the AppKey to the project
-Look for the labelconfig.dart file and change the AppKey to the one your generated.
+
-4. Build and run the app
-If you have done all of the above you should have a basic setup to get started, you'll see products from your WooCommerce store appearing in the app.
+
-5. Uploading to the App Store/Google Play Store?
-Uploading your app release to IOS [IOS guide](https://flutter.dev/docs/deployment/ios)
+
-Uploading your app release to Android [Android guide](https://flutter.dev/docs/deployment/android)
+### About Label StoreMax
-## Need help uploading the app?
-Check out our YouTube series to help you with uploading the app and other tips
+Label StoreMax is an App Template for WooCommerce stores. Your customers will be able to browse products, make orders and login via WordPress. You can also customise the look and feel of the app in the WooSignal dashboard.
-[Support](https://woosignal.com/support)
\ No newline at end of file
+You can also upload the app to the IOS app store and Google play store using Flutter.
+
+### Requirements
+
+- WooCommerce Store 3.5+
+- Android Studio/VSCode (for running the app)
+- Flutter installed
+
+### Getting Started
+
+1. Download/Clone this repository
+2. Sign up for free on [WooSignal](https://woosignal.com) and link your WooCommerce store
+3. Add your app key into the **.env** file and hit play (with Android Studio) to build the app 🥳
+
+Full documentation this available [here](https://woosignal.com/docs/app/ios/label-storemax)
+
+## Some features integrated
+
+- App Store Ready
+- Simple configuration
+- Browse products, make orders, customer login (via WordPress)
+- Change app name, logo, customize default language, currency + more
+- Light and dark mode
+- Stripe, Cash On Delivery, RazorPay
+- Localized for en, es, pt, it, hi, fr
+- Orders show as normal in WooCommerce
+
+## Security Vulnerabilities
+If you discover a security vulnerability within WooSignal, please send an e-mail support@woosignal.com
+
+## Uploading to the app stores
+
+- [IOS - Deployment](https://flutter.dev/docs/deployment/ios)
+- [Android - Deployment](https://flutter.dev/docs/deployment/android)
+
+## Licence
+The Label StoreMax framework is open-sourced software licensed under the MIT license.
diff --git a/LabelStoreMax/android/app/build.gradle b/LabelStoreMax/android/app/build.gradle
index ba6f08e..3ff0139 100644
--- a/LabelStoreMax/android/app/build.gradle
+++ b/LabelStoreMax/android/app/build.gradle
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 29
+ compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@@ -50,13 +50,6 @@ android {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
-
- // Uncomment "signingConfig signingConfigs.release"
- // Remove "signingConfig signingConfigs.debug"
- // When you're ready to build for release
- // Also check out https://flutter.dev/docs/deployment/android
- // Set the key.properties when building apk or appbundle
-
signingConfig signingConfigs.debug
}
}
@@ -68,5 +61,5 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'com.android.support:multidex:1.0.3'
-}
+ implementation "androidx.multidex:multidex:2.0.1"
+}
\ No newline at end of file
diff --git a/LabelStoreMax/android/app/src/main/AndroidManifest.xml b/LabelStoreMax/android/app/src/main/AndroidManifest.xml
index 149e539..b7d70b8 100644
--- a/LabelStoreMax/android/app/src/main/AndroidManifest.xml
+++ b/LabelStoreMax/android/app/src/main/AndroidManifest.xml
@@ -58,4 +58,4 @@
android:name="flutterEmbedding"
android:value="2" />
-
+
\ No newline at end of file
diff --git a/LabelStoreMax/android/gradle.properties b/LabelStoreMax/android/gradle.properties
index a673820..38c8d45 100644
--- a/LabelStoreMax/android/gradle.properties
+++ b/LabelStoreMax/android/gradle.properties
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
+android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
-android.enableR8=true
diff --git a/LabelStoreMax/apispec.json b/LabelStoreMax/apispec.json
new file mode 100644
index 0000000..c44dc44
--- /dev/null
+++ b/LabelStoreMax/apispec.json
@@ -0,0 +1,3 @@
+[
+
+]
\ No newline at end of file
diff --git a/LabelStoreMax/assets/fonts/Overpass/OFL.txt b/LabelStoreMax/assets/fonts/Overpass/OFL.txt
deleted file mode 100755
index fdaf13c..0000000
--- a/LabelStoreMax/assets/fonts/Overpass/OFL.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright (c) 2016 by Red Hat, Inc. All rights reserved.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-Black.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-Black.ttf
deleted file mode 100755
index aa9e740..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-Black.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-BlackItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-BlackItalic.ttf
deleted file mode 100755
index c0a82ca..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-BlackItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-Bold.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-Bold.ttf
deleted file mode 100755
index c5ed6f8..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-Bold.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-BoldItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-BoldItalic.ttf
deleted file mode 100755
index c648ae9..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-BoldItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraBold.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraBold.ttf
deleted file mode 100755
index 40daed2..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraBold.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraBoldItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraBoldItalic.ttf
deleted file mode 100755
index 0ba125b..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraBoldItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraLight.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraLight.ttf
deleted file mode 100755
index c57a7f2..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraLight.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraLightItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraLightItalic.ttf
deleted file mode 100755
index 504cc76..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-ExtraLightItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-Light.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-Light.ttf
deleted file mode 100755
index be884dd..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-Light.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-LightItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-LightItalic.ttf
deleted file mode 100755
index 2b1352d..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-LightItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-Regular.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-Regular.ttf
deleted file mode 100755
index 0deeda5..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-Regular.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-RegularItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-RegularItalic.ttf
deleted file mode 100755
index 78032b1..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-RegularItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-SemiBold.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-SemiBold.ttf
deleted file mode 100755
index f690d8e..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-SemiBold.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-SemiBoldItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-SemiBoldItalic.ttf
deleted file mode 100755
index 4a1c4a4..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-SemiBoldItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-Thin.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-Thin.ttf
deleted file mode 100755
index f01017a..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-Thin.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Overpass/Overpass-ThinItalic.ttf b/LabelStoreMax/assets/fonts/Overpass/Overpass-ThinItalic.ttf
deleted file mode 100755
index 2a5d951..0000000
Binary files a/LabelStoreMax/assets/fonts/Overpass/Overpass-ThinItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/OFL.txt b/LabelStoreMax/assets/fonts/Source_Sans_Pro/OFL.txt
deleted file mode 100755
index 72d81ab..0000000
--- a/LabelStoreMax/assets/fonts/Source_Sans_Pro/OFL.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name ‘Source’.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Black.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Black.ttf
deleted file mode 100755
index 4569f24..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Black.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-BlackItalic.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-BlackItalic.ttf
deleted file mode 100755
index 3477e16..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-BlackItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Bold.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Bold.ttf
deleted file mode 100755
index 1f430e2..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Bold.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-BoldItalic.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-BoldItalic.ttf
deleted file mode 100755
index 98089fd..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-BoldItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-ExtraLight.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-ExtraLight.ttf
deleted file mode 100755
index caf2673..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-ExtraLight.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-ExtraLightItalic.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-ExtraLightItalic.ttf
deleted file mode 100755
index b0362f3..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-ExtraLightItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Light.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Light.ttf
deleted file mode 100755
index 348871a..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Light.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-LightItalic.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-LightItalic.ttf
deleted file mode 100755
index 989dc8e..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-LightItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Regular.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Regular.ttf
deleted file mode 100755
index b422bf4..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-Regular.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-RegularItalic.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-RegularItalic.ttf
deleted file mode 100755
index e7b9182..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-RegularItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-SemiBold.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-SemiBold.ttf
deleted file mode 100755
index 2908e0d..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-SemiBold.ttf and /dev/null differ
diff --git a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-SemiBoldItalic.ttf b/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-SemiBoldItalic.ttf
deleted file mode 100755
index 990cf91..0000000
Binary files a/LabelStoreMax/assets/fonts/Source_Sans_Pro/SourceSansPro-SemiBoldItalic.ttf and /dev/null differ
diff --git a/LabelStoreMax/ios/.gitignore b/LabelStoreMax/ios/.gitignore
new file mode 100644
index 0000000..e96ef60
--- /dev/null
+++ b/LabelStoreMax/ios/.gitignore
@@ -0,0 +1,32 @@
+*.mode1v3
+*.mode2v3
+*.moved-aside
+*.pbxuser
+*.perspectivev3
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!default.mode1v3
+!default.mode2v3
+!default.pbxuser
+!default.perspectivev3
diff --git a/LabelStoreMax/ios/Flutter/.last_build_id b/LabelStoreMax/ios/Flutter/.last_build_id
index 6c5bcf2..7c5a8fa 100644
--- a/LabelStoreMax/ios/Flutter/.last_build_id
+++ b/LabelStoreMax/ios/Flutter/.last_build_id
@@ -1 +1 @@
-5b271ab1c6a17b054237577340baf791
\ No newline at end of file
+ed7b4bd8f32e5ea11f5ee09951e3fca9
\ No newline at end of file
diff --git a/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist b/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist
index 5415f75..6b4c0f7 100644
--- a/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist
+++ b/LabelStoreMax/ios/Flutter/AppFrameworkInfo.plist
@@ -2,25 +2,25 @@
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleExecutable
- App
- CFBundleIdentifier
- io.flutter.flutter.app
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- App
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.0
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
- MinimumOSVersion
- 13.00
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ App
+ CFBundleIdentifier
+ io.flutter.flutter.app
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ App
+ CFBundlePackageType
+ FMWK
+ CFBundleShortVersionString
+ 1.0
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ 1.0
+ MinimumOSVersion
+ 8.0
diff --git a/LabelStoreMax/ios/Runner.xcodeproj/project.pbxproj b/LabelStoreMax/ios/Runner.xcodeproj/project.pbxproj
index 5ec8a81..66a031e 100644
--- a/LabelStoreMax/ios/Runner.xcodeproj/project.pbxproj
+++ b/LabelStoreMax/ios/Runner.xcodeproj/project.pbxproj
@@ -3,18 +3,17 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 51;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
- D86A9FCC0FDE40E749D2F6CC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41358261A3745FB464B72CE9 /* Pods_Runner.framework */; };
+ BC760DE05EE229D80D672CAC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 320EF84A9034996DB0DD16A0 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -31,15 +30,15 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 0CCBA7AF2BAD9552DF0067C7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 1BA921103C32B79944361E71 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
+ 320EF84A9034996DB0DD16A0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 41358261A3745FB464B72CE9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
- 87F77F819B61E54C61672D11 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
+ 857C6B0641385D9A8CF0C7D1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -47,7 +46,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- E107F71D46A779B424A08899 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
+ DF4BE73D09DD6B58A2617025 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -55,21 +54,13 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- D86A9FCC0FDE40E749D2F6CC /* Pods_Runner.framework in Frameworks */,
+ BC760DE05EE229D80D672CAC /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 3E3E1C811B47477CF4A9A315 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 41358261A3745FB464B72CE9 /* Pods_Runner.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
@@ -87,8 +78,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
- A759088B62C60268D25F841F /* Pods */,
- 3E3E1C811B47477CF4A9A315 /* Frameworks */,
+ B6D068D2059A697428792520 /* Pods */,
+ C6C43B1429552E4F1EDF143D /* Frameworks */,
);
sourceTree = "";
};
@@ -107,7 +98,6 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
- 97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
@@ -116,23 +106,24 @@
path = Runner;
sourceTree = "";
};
- 97C146F11CF9000F007C117D /* Supporting Files */ = {
+ B6D068D2059A697428792520 /* Pods */ = {
isa = PBXGroup;
children = (
- );
- name = "Supporting Files";
- sourceTree = "";
- };
- A759088B62C60268D25F841F /* Pods */ = {
- isa = PBXGroup;
- children = (
- E107F71D46A779B424A08899 /* Pods-Runner.debug.xcconfig */,
- 87F77F819B61E54C61672D11 /* Pods-Runner.release.xcconfig */,
- 1BA921103C32B79944361E71 /* Pods-Runner.profile.xcconfig */,
+ 0CCBA7AF2BAD9552DF0067C7 /* Pods-Runner.debug.xcconfig */,
+ 857C6B0641385D9A8CF0C7D1 /* Pods-Runner.release.xcconfig */,
+ DF4BE73D09DD6B58A2617025 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "";
};
+ C6C43B1429552E4F1EDF143D /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 320EF84A9034996DB0DD16A0 /* Pods_Runner.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -140,14 +131,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- 7A4371A0EF7EDBC9E03FB2D7 /* [CP] Check Pods Manifest.lock */,
+ C132651D93B0648B694CECED /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- C10A9485E174060F4694B3D0 /* [CP] Embed Pods Frameworks */,
+ BEC85B489BA218F6E1950BBC /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -165,16 +156,16 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
- ORGANIZATIONNAME = "The Chromium Authors";
+ ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
- LastSwiftMigration = 0910;
+ LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 3.2";
+ compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@@ -198,7 +189,6 @@
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
@@ -219,9 +209,40 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin\n";
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
- 7A4371A0EF7EDBC9E03FB2D7 /* [CP] Check Pods Manifest.lock */ = {
+ 9740EEB61CF901F6004384FC /* Run Script */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+ };
+ BEC85B489BA218F6E1950BBC /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
+ C132651D93B0648B694CECED /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -243,64 +264,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 9740EEB61CF901F6004384FC /* Run Script */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Run Script";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
- };
- C10A9485E174060F4694B3D0 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
- "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
- "${BUILT_PRODUCTS_DIR}/Stripe/Stripe.framework",
- "${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
- "${BUILT_PRODUCTS_DIR}/flutter_money_formatter/flutter_money_formatter.framework",
- "${BUILT_PRODUCTS_DIR}/flutter_web_browser/flutter_web_browser.framework",
- "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework",
- "${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
- "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
- "${PODS_ROOT}/razorpay-pod/Pod/Razorpay.framework",
- "${BUILT_PRODUCTS_DIR}/razorpay_flutter/razorpay_flutter.framework",
- "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
- "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
- "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
- "${BUILT_PRODUCTS_DIR}/woosignal_stripe/woosignal_stripe.framework",
- );
- name = "[CP] Embed Pods Frameworks";
- outputPaths = (
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Stripe.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_money_formatter.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_web_browser.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Razorpay.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/razorpay_flutter.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/woosignal_stripe.framework",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -379,6 +342,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -398,16 +362,18 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = "com.woosignal.label-StoreMax";
- PRODUCT_NAME = Runner;
+ PRODUCT_BUNDLE_IDENTIFIER = com.flutter.app;
+ PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
@@ -512,7 +478,9 @@
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
- SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+ SUPPORTED_PLATFORMS = iphoneos;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -532,17 +500,19 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = "com.woosignal.label-StoreMax";
- PRODUCT_NAME = Runner;
+ PRODUCT_BUNDLE_IDENTIFIER = com.flutter.app;
+ PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
@@ -562,16 +532,18 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = "com.woosignal.label-StoreMax";
- PRODUCT_NAME = Runner;
+ PRODUCT_BUNDLE_IDENTIFIER = com.flutter.app;
+ PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
VERSIONING_SYSTEM = "apple-generic";
};
diff --git a/LabelStoreMax/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/LabelStoreMax/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/LabelStoreMax/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/LabelStoreMax/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/LabelStoreMax/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 0000000..f9b0d7c
--- /dev/null
+++ b/LabelStoreMax/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/LabelStoreMax/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/LabelStoreMax/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index fb2dffc..a28140c 100644
--- a/LabelStoreMax/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/LabelStoreMax/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -27,6 +27,8 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
+
+
-
-
+
+
+
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/LabelStoreMax/ios/Runner/AppDelegate.swift b/LabelStoreMax/ios/Runner/AppDelegate.swift
index 643f0ca..70693e4 100644
--- a/LabelStoreMax/ios/Runner/AppDelegate.swift
+++ b/LabelStoreMax/ios/Runner/AppDelegate.swift
@@ -3,7 +3,6 @@ import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
-
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
@@ -11,5 +10,4 @@ import Flutter
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
-
}
diff --git a/LabelStoreMax/lang/de.json b/LabelStoreMax/lang/de.json
index 48e97ed..c0d17b5 100644
--- a/LabelStoreMax/lang/de.json
+++ b/LabelStoreMax/lang/de.json
@@ -174,5 +174,7 @@
"for": "zum",
"Buy Product": "Produkt kaufen",
"Retry": "Wiederholen",
- "Retry later": "Versuchen Sie es später erneut"
+ "Retry later": "Versuchen Sie es später erneut",
+ "Light Mode": "Lichtmodus",
+ "Dark Mode": "Dunkler Modus"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lang/en.json b/LabelStoreMax/lang/en.json
index cb8177a..15c2321 100644
--- a/LabelStoreMax/lang/en.json
+++ b/LabelStoreMax/lang/en.json
@@ -174,5 +174,7 @@
"for": "for",
"Buy Product": "Buy Product",
"Retry": "Retry",
- "Retry later": "Retry later"
+ "Retry later": "Retry later",
+ "Light Mode": "Light Mode",
+ "Dark Mode": "Dark Mode"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lang/es.json b/LabelStoreMax/lang/es.json
index a98ce7d..173fee9 100644
--- a/LabelStoreMax/lang/es.json
+++ b/LabelStoreMax/lang/es.json
@@ -174,5 +174,7 @@
"for": "para",
"Buy Product": "Comprar producto",
"Retry": "Rever",
- "Retry later": "Reintentar más tarde"
+ "Retry later": "Reintentar más tarde",
+ "Light Mode": "Modo de luz",
+ "Dark Mode": "Modo oscuro"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lang/fr.json b/LabelStoreMax/lang/fr.json
index 9128c1d..6c0b164 100644
--- a/LabelStoreMax/lang/fr.json
+++ b/LabelStoreMax/lang/fr.json
@@ -174,5 +174,7 @@
"for": "pour",
"Buy Product": "Acheter un produit",
"Retry": "Recommencez",
- "Retry later": "Réessayer plus tard"
+ "Retry later": "Réessayer plus tard",
+ "Light Mode": "Mode lumière",
+ "Dark Mode": "Mode sombre"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lang/hi.json b/LabelStoreMax/lang/hi.json
index 60744d5..650edd5 100644
--- a/LabelStoreMax/lang/hi.json
+++ b/LabelStoreMax/lang/hi.json
@@ -174,5 +174,7 @@
"for": "ke liye",
"Buy Product": "utpaad khareeden",
"Retry": "pun: prayaas karen",
- "Retry later": "baad mein pun: prayaas karen"
+ "Retry later": "baad mein pun: prayaas karen",
+ "Light Mode": "lait mod",
+ "Dark Mode": "daark mod"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lang/it.json b/LabelStoreMax/lang/it.json
index 2c228cd..b09ce4a 100644
--- a/LabelStoreMax/lang/it.json
+++ b/LabelStoreMax/lang/it.json
@@ -174,5 +174,7 @@
"for": "per",
"Buy Product": "Acquista prodotto",
"Retry": "Riprova",
- "Retry later": "Riprova più tardi"
+ "Retry later": "Riprova più tardi",
+ "Light Mode": "Modalità luce",
+ "Dark Mode": "Modalità scura"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lang/pt.json b/LabelStoreMax/lang/pt.json
index 3b89b13..097fdc5 100644
--- a/LabelStoreMax/lang/pt.json
+++ b/LabelStoreMax/lang/pt.json
@@ -174,5 +174,7 @@
"for": "para",
"Buy Product": "Comprar Produto",
"Retry": "Tentar novamente",
- "Retry later": "Tentar mais tarde"
+ "Retry later": "Tentar mais tarde",
+ "Light Mode": "Modo de luz",
+ "Dark Mode": "Modo escuro"
}
\ No newline at end of file
diff --git a/LabelStoreMax/lib/widgets/app_loader.dart b/LabelStoreMax/lib/app/controllers/account_order_detail_controller.dart
similarity index 63%
rename from LabelStoreMax/lib/widgets/app_loader.dart
rename to LabelStoreMax/lib/app/controllers/account_order_detail_controller.dart
index d9ccc2d..807c60b 100644
--- a/LabelStoreMax/lib/widgets/app_loader.dart
+++ b/LabelStoreMax/lib/app/controllers/account_order_detail_controller.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,10 +8,10 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'controller.dart';
import 'package:flutter/widgets.dart';
-import 'package:flutter_spinkit/flutter_spinkit.dart';
-import 'package:hexcolor/hexcolor.dart';
-Widget showAppLoader() {
- return SpinKitDoubleBounce(color: HexColor("#393318"));
+class AccountOrderDetailController extends Controller {
+ @override
+ construct(BuildContext context) {}
}
diff --git a/LabelStoreMax/lib/app/controllers/browse_category_controller.dart b/LabelStoreMax/lib/app/controllers/browse_category_controller.dart
new file mode 100644
index 0000000..4ef91d9
--- /dev/null
+++ b/LabelStoreMax/lib/app/controllers/browse_category_controller.dart
@@ -0,0 +1,17 @@
+// 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 'controller.dart';
+import 'package:flutter/widgets.dart';
+
+class BrowseCategoryController extends Controller {
+ @override
+ construct(BuildContext context) {}
+}
diff --git a/LabelStoreMax/lib/app/controllers/browse_search_controller.dart b/LabelStoreMax/lib/app/controllers/browse_search_controller.dart
new file mode 100644
index 0000000..445338a
--- /dev/null
+++ b/LabelStoreMax/lib/app/controllers/browse_search_controller.dart
@@ -0,0 +1,17 @@
+// 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 'controller.dart';
+import 'package:flutter/widgets.dart';
+
+class BrowseSearchController extends Controller {
+ @override
+ construct(BuildContext context) {}
+}
diff --git a/LabelStoreMax/lib/app/controllers/checkout_status_controller.dart b/LabelStoreMax/lib/app/controllers/checkout_status_controller.dart
new file mode 100644
index 0000000..16e5058
--- /dev/null
+++ b/LabelStoreMax/lib/app/controllers/checkout_status_controller.dart
@@ -0,0 +1,17 @@
+// 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 'controller.dart';
+import 'package:flutter/widgets.dart';
+
+class CheckoutStatusController extends Controller {
+ @override
+ construct(BuildContext context) {}
+}
diff --git a/LabelStoreMax/lib/app/controllers/controller.dart b/LabelStoreMax/lib/app/controllers/controller.dart
new file mode 100644
index 0000000..7e119a6
--- /dev/null
+++ b/LabelStoreMax/lib/app/controllers/controller.dart
@@ -0,0 +1,17 @@
+// 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:nylo_framework/controllers/controller.dart';
+
+/// Base Controller for the Nylo
+/// See more on controllers here - https://nylo.dev/docs/1.x/controllers
+class Controller extends BaseController {
+ Controller();
+}
diff --git a/LabelStoreMax/lib/app/controllers/product_detail_controller.dart b/LabelStoreMax/lib/app/controllers/product_detail_controller.dart
new file mode 100644
index 0000000..8e2c73c
--- /dev/null
+++ b/LabelStoreMax/lib/app/controllers/product_detail_controller.dart
@@ -0,0 +1,32 @@
+// 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_app/bootstrap/helpers.dart';
+import 'package:woosignal/models/response/products.dart';
+
+import 'controller.dart';
+import 'package:flutter/widgets.dart';
+
+class ProductDetailController extends Controller {
+ @override
+ construct(BuildContext context) {}
+
+ viewExternalProduct(Product product) {
+ if (product.externalUrl != null && product.externalUrl.isNotEmpty) {
+ openBrowserTab(url: product.externalUrl);
+ }
+ }
+
+ viewProductImages(int i, Product product) =>
+ Navigator.pushNamed(context, "/product-images", arguments: {
+ "index": i,
+ "images": product.images.map((f) => f.src).toList()
+ });
+}
diff --git a/LabelStoreMax/lib/app/controllers/product_image_viewer_controller.dart b/LabelStoreMax/lib/app/controllers/product_image_viewer_controller.dart
new file mode 100644
index 0000000..8837864
--- /dev/null
+++ b/LabelStoreMax/lib/app/controllers/product_image_viewer_controller.dart
@@ -0,0 +1,17 @@
+// 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 'controller.dart';
+import 'package:flutter/widgets.dart';
+
+class ProductImageViewerController extends Controller {
+ @override
+ construct(BuildContext context) {}
+}
diff --git a/LabelStoreMax/lib/models/billing_details.dart b/LabelStoreMax/lib/app/models/billing_details.dart
similarity index 86%
rename from LabelStoreMax/lib/models/billing_details.dart
rename to LabelStoreMax/lib/app/models/billing_details.dart
index f1d194f..9343593 100644
--- a/LabelStoreMax/lib/models/billing_details.dart
+++ b/LabelStoreMax/lib/app/models/billing_details.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-import 'package:label_storemax/models/customer_address.dart';
+import 'package:flutter_app/app/models/customer_address.dart';
class BillingDetails {
CustomerAddress billingAddress;
diff --git a/LabelStoreMax/lib/models/cart.dart b/LabelStoreMax/lib/app/models/cart.dart
similarity index 70%
rename from LabelStoreMax/lib/models/cart.dart
rename to LabelStoreMax/lib/app/models/cart.dart
index 64094b9..4a8bc86 100644
--- a/LabelStoreMax/lib/models/cart.dart
+++ b/LabelStoreMax/lib/app/models/cart.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -11,58 +11,60 @@
import 'dart:convert';
import 'package:flutter/cupertino.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/shared_pref.dart';
-import 'package:label_storemax/models/cart_line_item.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/models/shipping_type.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/shipping_type.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/response/shipping_method.dart';
import 'package:woosignal/models/response/tax_rate.dart';
-import '../helpers/tools.dart';
-
class Cart {
- String _keyCart = "CART_SESSION";
-
Cart._privateConstructor();
static final Cart getInstance = Cart._privateConstructor();
Future> getCart() async {
List cartLineItems = [];
- SharedPref sharedPref = SharedPref();
- String currentCartArrJSON = (await sharedPref.read(_keyCart) as String);
- if (currentCartArrJSON == null) {
- cartLineItems = [];
- } else {
+ String currentCartArrJSON = await NyStorage.read(SharedKey.cart);
+
+ if (currentCartArrJSON != null) {
cartLineItems = (jsonDecode(currentCartArrJSON) as List)
.map((i) => CartLineItem.fromJson(i))
.toList();
}
+
return cartLineItems;
}
- void addToCart({@required CartLineItem cartLineItem}) async {
+ Future addToCart({@required CartLineItem cartLineItem}) async {
List cartLineItems = await getCart();
- if (cartLineItem.variationId != null) {
- if (cartLineItems.firstWhere(
- (i) => (i.productId == cartLineItem.productId &&
- i.variationId == cartLineItem.variationId),
- orElse: () => null) !=
- null) {
- return;
- }
- } else {
- CartLineItem firstCartItem = cartLineItems.firstWhere(
- (i) => i.productId == cartLineItem.productId,
- orElse: () => null);
- if (firstCartItem != null) {
- return;
- }
+ if (cartLineItem.variationId != null &&
+ cartLineItems.firstWhere(
+ (i) => (i.productId == cartLineItem.productId &&
+ i.variationId == cartLineItem.variationId &&
+ i.variationOptions == cartLineItem.variationOptions),
+ orElse: () => null) !=
+ null) {
+ cartLineItems.removeWhere((item) =>
+ item.productId == cartLineItem.productId &&
+ item.variationId == cartLineItem.variationId &&
+ item.variationOptions == cartLineItem.variationOptions);
}
+
+ if (cartLineItem.variationId == null &&
+ cartLineItems.firstWhere((i) => i.productId == cartLineItem.productId,
+ orElse: () => null) !=
+ null) {
+ cartLineItems
+ .removeWhere((item) => item.productId == cartLineItem.productId);
+ }
+
cartLineItems.add(cartLineItem);
- saveCartToPref(cartLineItems: cartLineItems);
+ await saveCartToPref(cartLineItems: cartLineItems);
}
Future getTotal({bool withFormat = false}) async {
@@ -90,7 +92,7 @@ class Cart {
return subtotal.toStringAsFixed(2);
}
- void updateQuantity(
+ updateQuantity(
{@required CartLineItem cartLineItem,
@required int incrementQuantity}) async {
List cartLineItems = await getCart();
@@ -104,7 +106,7 @@ class Cart {
}
tmpCartItem.add(cartItem);
});
- saveCartToPref(cartLineItems: tmpCartItem);
+ await saveCartToPref(cartLineItems: tmpCartItem);
}
Future cartShortDesc() async {
@@ -116,25 +118,17 @@ class Cart {
.join(",");
}
- void removeCartItemForIndex({@required int index}) async {
+ removeCartItemForIndex({@required int index}) async {
List cartLineItems = await getCart();
cartLineItems.removeAt(index);
- saveCartToPref(cartLineItems: cartLineItems);
+ await saveCartToPref(cartLineItems: cartLineItems);
}
- void clear() {
- SharedPref sharedPref = SharedPref();
- List cartLineItems = [];
- String jsonArrCartItems =
- jsonEncode(cartLineItems.map((i) => i.toJson()).toList());
- sharedPref.save(_keyCart, jsonArrCartItems);
- }
+ clear() async => NyStorage.delete(SharedKey.cart);
- void saveCartToPref({@required List cartLineItems}) {
- SharedPref sharedPref = SharedPref();
- String jsonArrCartItems =
- jsonEncode(cartLineItems.map((i) => i.toJson()).toList());
- sharedPref.save(_keyCart, jsonArrCartItems);
+ saveCartToPref({@required List cartLineItems}) async {
+ String json = jsonEncode(cartLineItems.map((i) => i.toJson()).toList());
+ await NyStorage.store(SharedKey.cart, json);
}
Future taxAmount(TaxRate taxRate) async {
diff --git a/LabelStoreMax/lib/models/cart_line_item.dart b/LabelStoreMax/lib/app/models/cart_line_item.dart
similarity index 97%
rename from LabelStoreMax/lib/models/cart_line_item.dart
rename to LabelStoreMax/lib/app/models/cart_line_item.dart
index e99d8b7..8dae380 100644
--- a/LabelStoreMax/lib/models/cart_line_item.dart
+++ b/LabelStoreMax/lib/app/models/cart_line_item.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-import 'package:label_storemax/helpers/tools.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
class CartLineItem {
String name;
diff --git a/LabelStoreMax/lib/models/checkout_session.dart b/LabelStoreMax/lib/app/models/checkout_session.dart
similarity index 68%
rename from LabelStoreMax/lib/models/checkout_session.dart
rename to LabelStoreMax/lib/app/models/checkout_session.dart
index 5c7ef2f..fa405a6 100644
--- a/LabelStoreMax/lib/models/checkout_session.dart
+++ b/LabelStoreMax/lib/app/models/checkout_session.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -9,20 +9,17 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import 'dart:convert';
-
-import 'package:label_storemax/helpers/shared_pref.dart';
-import 'package:label_storemax/models/billing_details.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/customer_address.dart';
-import 'package:label_storemax/models/payment_type.dart';
-import 'package:label_storemax/models/shipping_type.dart';
+import 'package:flutter_app/app/models/billing_details.dart';
+import 'package:flutter_app/app/models/cart.dart';
+import 'package:flutter_app/app/models/customer_address.dart';
+import 'package:flutter_app/app/models/payment_type.dart';
+import 'package:flutter_app/app/models/shipping_type.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/response/tax_rate.dart';
-import '../helpers/tools.dart';
-
class CheckoutSession {
- String sfKeyBillingCheckout = "CS_BILLING_DETAILS";
- String sfKeyShippingCheckout = "CS_SHIPPING_DETAILS";
bool shipToDifferentAddress = false;
CheckoutSession._privateConstructor();
@@ -44,8 +41,7 @@ class CheckoutSession {
paymentType = null;
}
- void saveBillingAddress() {
- SharedPref sharedPref = SharedPref();
+ void saveBillingAddress() async {
CustomerAddress customerAddress =
CheckoutSession.getInstance.billingDetails.billingAddress;
@@ -54,13 +50,12 @@ class CheckoutSession {
}
String billingAddress = jsonEncode(customerAddress.toJson());
- sharedPref.save(sfKeyBillingCheckout, billingAddress);
+ await NyStorage.store(SharedKey.customerBillingDetails, billingAddress);
}
Future getBillingAddress() async {
- SharedPref sharedPref = SharedPref();
-
- String strCheckoutDetails = await sharedPref.read(sfKeyBillingCheckout);
+ String strCheckoutDetails =
+ await NyStorage.read(SharedKey.customerBillingDetails);
if (strCheckoutDetails != null && strCheckoutDetails != "") {
return CustomerAddress.fromJson(jsonDecode(strCheckoutDetails));
@@ -68,37 +63,30 @@ class CheckoutSession {
return null;
}
- void clearBillingAddress() {
- SharedPref sharedPref = SharedPref();
- sharedPref.remove(sfKeyBillingCheckout);
- }
+ void clearBillingAddress() async =>
+ await NyStorage.delete(SharedKey.customerBillingDetails);
- void saveShippingAddress() {
- SharedPref sharedPref = SharedPref();
+ saveShippingAddress() async {
CustomerAddress customerAddress =
CheckoutSession.getInstance.billingDetails.shippingAddress;
-
if (customerAddress == null) {
return;
}
-
String shippingAddress = jsonEncode(customerAddress.toJson());
- sharedPref.save(sfKeyShippingCheckout, shippingAddress);
+ await NyStorage.store(SharedKey.customerShippingDetails, shippingAddress);
}
Future getShippingAddress() async {
- SharedPref sharedPref = SharedPref();
- String strCheckoutDetails = await sharedPref.read(sfKeyShippingCheckout);
+ String strCheckoutDetails =
+ await NyStorage.read(SharedKey.customerShippingDetails);
if (strCheckoutDetails != null && strCheckoutDetails != "") {
return CustomerAddress.fromJson(jsonDecode(strCheckoutDetails));
}
return null;
}
- void clearShippingAddress() {
- SharedPref sharedPref = SharedPref();
- sharedPref.remove(sfKeyShippingCheckout);
- }
+ void clearShippingAddress() async =>
+ NyStorage.delete(SharedKey.customerShippingDetails);
Future total({bool withFormat = false, TaxRate taxRate}) async {
double totalCart = parseWcPrice(await Cart.getInstance.getTotal());
diff --git a/LabelStoreMax/lib/models/customer_address.dart b/LabelStoreMax/lib/app/models/customer_address.dart
similarity index 97%
rename from LabelStoreMax/lib/models/customer_address.dart
rename to LabelStoreMax/lib/app/models/customer_address.dart
index b5b11d0..19f5c9f 100644
--- a/LabelStoreMax/lib/models/customer_address.dart
+++ b/LabelStoreMax/lib/app/models/customer_address.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-import 'package:label_storemax/models/customer_country.dart';
+import 'package:flutter_app/app/models/customer_country.dart';
class CustomerAddress {
String firstName;
diff --git a/LabelStoreMax/lib/models/customer_country.dart b/LabelStoreMax/lib/app/models/customer_country.dart
similarity index 94%
rename from LabelStoreMax/lib/models/customer_country.dart
rename to LabelStoreMax/lib/app/models/customer_country.dart
index 8e8a786..2bf5c64 100644
--- a/LabelStoreMax/lib/models/customer_country.dart
+++ b/LabelStoreMax/lib/app/models/customer_country.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,7 +8,7 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-import 'package:label_storemax/models/default_shipping.dart';
+import 'package:flutter_app/app/models/default_shipping.dart';
class CustomerCountry {
String countryCode;
diff --git a/LabelStoreMax/lib/models/default_shipping.dart b/LabelStoreMax/lib/app/models/default_shipping.dart
similarity index 98%
rename from LabelStoreMax/lib/models/default_shipping.dart
rename to LabelStoreMax/lib/app/models/default_shipping.dart
index 2bb965e..6f3c9af 100644
--- a/LabelStoreMax/lib/models/default_shipping.dart
+++ b/LabelStoreMax/lib/app/models/default_shipping.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
diff --git a/LabelStoreMax/lib/models/payment_type.dart b/LabelStoreMax/lib/app/models/payment_type.dart
similarity index 96%
rename from LabelStoreMax/lib/models/payment_type.dart
rename to LabelStoreMax/lib/app/models/payment_type.dart
index 2ad9113..d78654e 100644
--- a/LabelStoreMax/lib/models/payment_type.dart
+++ b/LabelStoreMax/lib/app/models/payment_type.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
diff --git a/LabelStoreMax/lib/models/shipping_type.dart b/LabelStoreMax/lib/app/models/shipping_type.dart
similarity index 97%
rename from LabelStoreMax/lib/models/shipping_type.dart
rename to LabelStoreMax/lib/app/models/shipping_type.dart
index b23b7dd..6aa3b21 100644
--- a/LabelStoreMax/lib/models/shipping_type.dart
+++ b/LabelStoreMax/lib/app/models/shipping_type.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -9,10 +9,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import 'package:flutter/cupertino.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:woosignal/models/response/shipping_method.dart';
-import '../helpers/tools.dart';
-
class ShippingType {
String methodId;
String cost;
diff --git a/LabelStoreMax/lib/app/models/user.dart b/LabelStoreMax/lib/app/models/user.dart
new file mode 100644
index 0000000..7e57ed1
--- /dev/null
+++ b/LabelStoreMax/lib/app/models/user.dart
@@ -0,0 +1,28 @@
+// 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:nylo_framework/helpers/helper.dart';
+
+class User extends Storable {
+ String userId;
+ String token;
+
+ User();
+ User.fromUserAuthResponse({this.userId, this.token});
+
+ @override
+ toStorage() => {"token": this.token, "user_id": this.userId};
+
+ @override
+ fromStorage(dynamic data) {
+ this.token = data['token'];
+ this.userId = data['user_id'];
+ }
+}
diff --git a/LabelStoreMax/lib/app/networking/api_service.dart b/LabelStoreMax/lib/app/networking/api_service.dart
new file mode 100644
index 0000000..fceeabf
--- /dev/null
+++ b/LabelStoreMax/lib/app/networking/api_service.dart
@@ -0,0 +1,13 @@
+// Label StoreMax
+//
+// Created by Anthony Gordon.
+// 2021, WooSignal Ltd. All rights reserved.
+//
+
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+import 'package:nylo_framework/networking/base_networking.dart';
+
+class ApiService extends BaseApi {}
diff --git a/LabelStoreMax/lib/providers/cash_on_delivery.dart b/LabelStoreMax/lib/app/providers/cash_on_delivery.dart
similarity index 83%
rename from LabelStoreMax/lib/providers/cash_on_delivery.dart
rename to LabelStoreMax/lib/app/providers/cash_on_delivery.dart
index 26c0d95..2e68c98 100644
--- a/LabelStoreMax/lib/providers/cash_on_delivery.dart
+++ b/LabelStoreMax/lib/app/providers/cash_on_delivery.dart
@@ -1,6 +1,6 @@
//
// LabelCore
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -12,9 +12,10 @@
//
import 'package:flutter/widgets.dart';
-import 'package:label_storemax/helpers/data/order_wc.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/pages/checkout_confirmation.dart';
+import 'package:flutter_app/bootstrap/data/order_wc.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/pages/checkout_confirmation.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/payload/order_wc.dart';
import 'package:woosignal/models/response/order.dart';
import 'package:woosignal/models/response/tax_rate.dart';
@@ -37,7 +38,7 @@ cashOnDeliveryPay(context,
);
state.reloadState(showLoader: false);
}
- } catch (ex) {
+ } catch (_) {
showEdgeAlertWith(
context,
title: trans(context, "Error"),
diff --git a/LabelStoreMax/lib/providers/example_pay.dart b/LabelStoreMax/lib/app/providers/example_pay.dart
similarity index 86%
rename from LabelStoreMax/lib/providers/example_pay.dart
rename to LabelStoreMax/lib/app/providers/example_pay.dart
index 5914651..f798442 100644
--- a/LabelStoreMax/lib/providers/example_pay.dart
+++ b/LabelStoreMax/lib/app/providers/example_pay.dart
@@ -1,6 +1,6 @@
//
// LabelCore
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -12,10 +12,10 @@
//
import 'package:flutter/widgets.dart';
-import 'package:label_storemax/helpers/data/order_wc.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/pages/checkout_confirmation.dart';
+import 'package:flutter_app/bootstrap/data/order_wc.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/pages/checkout_confirmation.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/payload/order_wc.dart';
import 'package:woosignal/models/response/order.dart';
import 'package:woosignal/models/response/tax_rate.dart';
diff --git a/LabelStoreMax/lib/providers/razor_pay.dart b/LabelStoreMax/lib/app/providers/razor_pay.dart
similarity index 88%
rename from LabelStoreMax/lib/providers/razor_pay.dart
rename to LabelStoreMax/lib/app/providers/razor_pay.dart
index 5c4bf36..b81fc33 100644
--- a/LabelStoreMax/lib/providers/razor_pay.dart
+++ b/LabelStoreMax/lib/app/providers/razor_pay.dart
@@ -1,6 +1,6 @@
//
// LabelCore
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -12,11 +12,11 @@
//
import 'package:flutter/widgets.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/data/order_wc.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/labelconfig.dart';
-import 'package:label_storemax/pages/checkout_confirmation.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/data/order_wc.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/pages/checkout_confirmation.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:razorpay_flutter/razorpay_flutter.dart';
import 'package:woosignal/models/response/tax_rate.dart';
import 'package:woosignal/models/payload/order_wc.dart';
@@ -70,7 +70,7 @@ razorPay(context,
// CHECKOUT HELPER
await checkout(taxRate, (total, billingDetails, cart) async {
var options = {
- 'key': app_razor_id,
+ 'key': getEnv('RAZORPAY_ID'),
'amount': (parseWcPrice(total) * 100).toInt(),
'name': AppHelper.instance.appConfig.appName,
'description': await cart.cartShortDesc(),
diff --git a/LabelStoreMax/lib/providers/stripe_pay.dart b/LabelStoreMax/lib/app/providers/stripe_pay.dart
similarity index 81%
rename from LabelStoreMax/lib/providers/stripe_pay.dart
rename to LabelStoreMax/lib/app/providers/stripe_pay.dart
index 87b3bc8..afba431 100644
--- a/LabelStoreMax/lib/providers/stripe_pay.dart
+++ b/LabelStoreMax/lib/app/providers/stripe_pay.dart
@@ -1,6 +1,6 @@
//
// LabelCore
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -13,23 +13,31 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/data/order_wc.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/labelconfig.dart';
-import 'package:label_storemax/pages/checkout_confirmation.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/data/order_wc.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/pages/checkout_confirmation.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/payload/order_wc.dart';
import 'package:woosignal/models/response/order.dart';
import 'package:woosignal/models/response/tax_rate.dart';
+import 'package:woosignal/models/response/woosignal_app.dart';
import 'package:woosignal_stripe/woosignal_stripe.dart';
stripePay(context,
{@required CheckoutConfirmationPageState state, TaxRate taxRate}) async {
try {
+ WooSignalApp wooSignalApp = AppHelper.instance.appConfig;
+ bool liveMode = getEnv('STRIPE_LIVE_MODE') == null
+ ? wooSignalApp.stripeLiveMode
+ : getEnv('STRIPE_LIVE_MODE', defaultValue: false);
+
// CONFIGURE STRIPE
FlutterStripePayment.setStripeSettings(
- stripeAccount: app_stripe_account, liveMode: app_stripe_live_mode);
+ stripeAccount: getEnv('STRIPE_ACCOUNT'), liveMode: liveMode);
- var paymentResponse = await FlutterStripePayment.addPaymentMethod();
+ PaymentResponse paymentResponse =
+ await FlutterStripePayment.addPaymentMethod();
// CHECK STATUS FROM STRIPE
if (paymentResponse.status == PaymentResponseStatus.succeeded) {
@@ -90,8 +98,8 @@ stripePay(context,
state.reloadState(showLoader: false);
}
} else if (intentResponse.status == PaymentResponseStatus.failed) {
- if (app_debug) {
- print(intentResponse.errorMessage);
+ if (getEnv('APP_DEBUG', defaultValue: true)) {
+ NyLogger.error(intentResponse.errorMessage);
}
showEdgeAlertWith(
context,
diff --git a/LabelStoreMax/lib/app_payment_methods.dart b/LabelStoreMax/lib/app_payment_methods.dart
deleted file mode 100644
index 44b584d..0000000
--- a/LabelStoreMax/lib/app_payment_methods.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-// 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:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/payment_type.dart';
-import 'package:label_storemax/providers/cash_on_delivery.dart';
-import 'package:label_storemax/providers/razor_pay.dart';
-import 'package:label_storemax/providers/stripe_pay.dart';
-
-// Payment methods available for uses in the app
-
-List arrPaymentMethods = [
- addPayment(
- PaymentType(
- id: 1,
- name: "Stripe",
- desc: "Debit or Credit Card",
- assetImage: "dark_powered_by_stripe.png",
- pay: stripePay,
- ),
- ),
-
- addPayment(
- PaymentType(
- id: 2,
- name: "CashOnDelivery",
- desc: "Cash on delivery",
- assetImage: "cash_on_delivery.jpeg",
- pay: cashOnDeliveryPay,
- ),
- ),
-
- addPayment(
- PaymentType(
- id: 3,
- name: "RazorPay",
- desc: "Debit or Credit Card",
- assetImage: "razorpay.png",
- pay: razorPay,
- ),
- ),
-
- // e.g. add more here
-
-// addPayment(
-// PaymentType(
-// id: 4,
-// name: "MyNewPaymentMethod",
-// desc: "Debit or Credit Card",
-// assetImage: "add icon image to assets/images/myimage.png",
-// pay: myCustomPaymentFunction
-// ),
-// ),
-].where((e) => e != null).toList();
diff --git a/LabelStoreMax/lib/bootstrap/app.dart b/LabelStoreMax/lib/bootstrap/app.dart
new file mode 100644
index 0000000..b434f60
--- /dev/null
+++ b/LabelStoreMax/lib/bootstrap/app.dart
@@ -0,0 +1,118 @@
+// Label StoreMax
+//
+// Created by Anthony Gordon.
+// 2021, WooSignal Ltd. All rights reserved.
+//
+
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+import 'package:adaptive_theme/adaptive_theme.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_localizations/flutter_localizations.dart';
+import 'package:nylo_framework/localization/app_localization.dart';
+
+// ignore: must_be_immutable
+class AppBuild extends StatelessWidget {
+ final String initialRoute;
+ Brightness defaultBrightness;
+ ThemeData themeData;
+ ThemeData darkTheme;
+ Locale locale;
+ String title;
+ bool debugShowCheckedModeBanner;
+ bool debugShowMaterialGrid;
+ bool showPerformanceOverlay;
+ bool checkerboardRasterCacheImages;
+ bool checkerboardOffscreenLayers;
+ bool showSemanticsDebugger;
+ Map shortcuts;
+ Map> actions;
+ List supportedLocales;
+ ThemeMode themeMode;
+ Color color;
+ GenerateAppTitle onGenerateTitle;
+ TransitionBuilder builder;
+ List navigatorObservers;
+ RouteFactory onUnknownRoute;
+ InitialRouteListFactory onGenerateInitialRoutes;
+ GlobalKey navigatorKey;
+
+ final Route Function(RouteSettings settings) onGenerateRoute;
+
+ AppBuild({
+ Key key,
+ this.initialRoute,
+ this.title,
+ this.defaultBrightness,
+ this.locale,
+ this.themeData,
+ this.onGenerateRoute,
+ this.navigatorKey,
+ this.onGenerateInitialRoutes,
+ this.onUnknownRoute,
+ this.navigatorObservers = const [],
+ this.builder,
+ this.onGenerateTitle,
+ this.color,
+ this.darkTheme,
+ this.themeMode = ThemeMode.system,
+ this.supportedLocales = const [Locale('en', 'US')],
+ this.debugShowMaterialGrid = false,
+ this.showPerformanceOverlay = false,
+ this.checkerboardRasterCacheImages = false,
+ this.checkerboardOffscreenLayers = false,
+ this.showSemanticsDebugger = false,
+ this.debugShowCheckedModeBanner = true,
+ this.shortcuts,
+ this.actions,
+ }) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return AdaptiveTheme(
+ light: themeData,
+ dark: darkTheme,
+ initial: AdaptiveThemeMode.light,
+ builder: (theme, darkTheme) => ValueListenableBuilder(
+ valueListenable: ValueNotifier(locale),
+ builder: (context, Locale locale, _) => MaterialApp(
+ navigatorKey: navigatorKey,
+ themeMode: themeMode,
+ onGenerateTitle: onGenerateTitle,
+ onGenerateInitialRoutes: onGenerateInitialRoutes,
+ onUnknownRoute: onUnknownRoute,
+ builder: builder,
+ navigatorObservers: navigatorObservers,
+ color: color,
+ supportedLocales: supportedLocales,
+ debugShowMaterialGrid: debugShowMaterialGrid,
+ showPerformanceOverlay: showPerformanceOverlay,
+ checkerboardRasterCacheImages: checkerboardRasterCacheImages,
+ checkerboardOffscreenLayers: checkerboardOffscreenLayers,
+ showSemanticsDebugger: showSemanticsDebugger,
+ debugShowCheckedModeBanner: debugShowCheckedModeBanner,
+ shortcuts: shortcuts,
+ actions: actions,
+ title: title ?? "",
+ darkTheme: darkTheme,
+ initialRoute: initialRoute,
+ onGenerateRoute: this.onGenerateRoute,
+ locale: locale,
+ theme: theme,
+ localizationsDelegates: [
+ AppLocalizations.delegate,
+ GlobalWidgetsLocalizations.delegate,
+ GlobalMaterialLocalizations.delegate
+ ],
+ localeResolutionCallback:
+ (Locale locale, Iterable supportedLocales) {
+ return locale;
+ },
+ ),
+ ),
+ );
+ }
+}
diff --git a/LabelStoreMax/lib/bootstrap/app_helper.dart b/LabelStoreMax/lib/bootstrap/app_helper.dart
new file mode 100644
index 0000000..1486c10
--- /dev/null
+++ b/LabelStoreMax/lib/bootstrap/app_helper.dart
@@ -0,0 +1,19 @@
+// 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:woosignal/models/response/woosignal_app.dart';
+
+class AppHelper {
+ AppHelper._privateConstructor();
+
+ static final AppHelper instance = AppHelper._privateConstructor();
+
+ WooSignalApp appConfig;
+}
diff --git a/LabelStoreMax/lib/helpers/data/order_wc.dart b/LabelStoreMax/lib/bootstrap/data/order_wc.dart
similarity index 90%
rename from LabelStoreMax/lib/helpers/data/order_wc.dart
rename to LabelStoreMax/lib/bootstrap/data/order_wc.dart
index c4e328d..eefca73 100644
--- a/LabelStoreMax/lib/helpers/data/order_wc.dart
+++ b/LabelStoreMax/lib/bootstrap/data/order_wc.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -10,13 +10,13 @@
import 'dart:io';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_user_id.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/billing_details.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/cart_line_item.dart';
-import 'package:label_storemax/models/checkout_session.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_line_item.dart';
+import 'package:flutter_app/app/models/checkout_session.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
import 'package:woosignal/models/payload/order_wc.dart';
import 'package:woosignal/models/response/tax_rate.dart';
import 'package:woosignal/models/response/woosignal_app.dart';
diff --git a/LabelStoreMax/lib/helpers/enums/sort_enums.dart b/LabelStoreMax/lib/bootstrap/enums/sort_enums.dart
similarity index 95%
rename from LabelStoreMax/lib/helpers/enums/sort_enums.dart
rename to LabelStoreMax/lib/bootstrap/enums/sort_enums.dart
index 26a9a00..49f63ef 100644
--- a/LabelStoreMax/lib/helpers/enums/sort_enums.dart
+++ b/LabelStoreMax/lib/bootstrap/enums/sort_enums.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
diff --git a/LabelStoreMax/lib/helpers/tools.dart b/LabelStoreMax/lib/bootstrap/helpers.dart
similarity index 88%
rename from LabelStoreMax/lib/helpers/tools.dart
rename to LabelStoreMax/lib/bootstrap/helpers.dart
index 152a624..3723ab2 100644
--- a/LabelStoreMax/lib/helpers/tools.dart
+++ b/LabelStoreMax/lib/bootstrap/helpers.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -9,28 +9,28 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import 'dart:convert';
-import 'dart:developer';
-
import 'package:flutter/cupertino.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_line_item.dart';
+import 'package:flutter_app/app/models/checkout_session.dart';
+import 'package:flutter_app/app/models/default_shipping.dart';
+import 'package:flutter_app/app/models/payment_type.dart';
+import 'package:flutter_app/app/models/user.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
+import 'package:flutter_app/config/app_payment_gateways.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_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:intl/intl.dart';
-import 'package:label_storemax/app_payment_methods.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/app_localizations.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/labelconfig.dart';
import 'package:edge_alert/edge_alert.dart';
-import 'package:label_storemax/models/billing_details.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/cart_line_item.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/models/default_shipping.dart';
-import 'package:label_storemax/models/payment_type.dart';
import 'package:html/parser.dart';
import 'package:flutter_web_browser/flutter_web_browser.dart';
import 'package:flutter_money_formatter/flutter_money_formatter.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
import 'package:math_expressions/math_expressions.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:platform_alert_dialog/platform_alert_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:status_alert/status_alert.dart';
@@ -38,18 +38,35 @@ import 'package:woosignal/models/response/products.dart';
import 'package:woosignal/models/response/tax_rate.dart';
import 'package:woosignal/woosignal.dart';
+Future getUser() async =>
+ (await NyStorage.read(SharedKey.authUser, model: User()));
+
appWooSignal(Function(WooSignal) api) async {
- WooSignal wooSignal = await WooSignal.getInstance(
- config: {"appKey": app_key, "debugMode": app_debug});
+ WooSignal wooSignal = await WooSignal.getInstance(config: {
+ "appKey": getEnv('APP_KEY'),
+ "debugMode": getEnv('APP_DEBUG', defaultValue: true)
+ });
return await api(wooSignal);
}
List getPaymentTypes() =>
- arrPaymentMethods.where((v) => v != null).toList();
+ paymentTypeList.where((v) => v != null).toList();
-PaymentType addPayment(PaymentType paymentType) {
- return app_payment_methods.contains(paymentType.name) ? paymentType : null;
-}
+PaymentType addPayment(
+ {@required int id,
+ @required String name,
+ @required String desc,
+ @required String assetImage,
+ @required Function pay}) =>
+ app_payment_gateways.contains(name)
+ ? PaymentType(
+ id: id,
+ name: name,
+ desc: desc,
+ assetImage: assetImage,
+ pay: pay,
+ )
+ : null;
showStatusAlert(context,
{@required String title, String subtitle, IconData icon, int duration}) {
@@ -63,10 +80,10 @@ showStatusAlert(context,
}
class EdgeAlertStyle {
- static final int SUCCESS = 1;
- static final int WARNING = 2;
- static final int INFO = 3;
- static final int DANGER = 4;
+ static const int SUCCESS = 1;
+ static const int WARNING = 2;
+ static const int INFO = 3;
+ static const int DANGER = 4;
}
void showEdgeAlertWith(context,
@@ -164,13 +181,7 @@ openBrowserTab({@required String url}) async {
customTabsOptions: CustomTabsOptions(toolbarColor: Colors.white70));
}
-EdgeInsets safeAreaDefault() {
- return EdgeInsets.only(left: 16, right: 16, bottom: 8);
-}
-
-String trans(BuildContext context, String key) {
- return AppLocalizations.of(context).trans(key);
-}
+EdgeInsets safeAreaDefault() => EdgeInsets.only(left: 16, right: 16, bottom: 8);
bool isNumeric(String str) {
if (str == null) {
@@ -465,11 +476,10 @@ String formatForDateTime(FormatType formatType) {
}
}
-String capitalize(String s) => s[0].toUpperCase() + s.substring(1);
-
double parseWcPrice(String price) => (double.tryParse(price) ?? 0);
-void appLogOutput(dynamic message) => (app_debug == true ? log(message) : null);
+void appLogOutput(dynamic message) =>
+ (getEnv('APP_DEBUG', defaultValue: true) ? NyLogger.debug(message) : null);
Widget refreshableScroll(context,
{@required refreshController,
@@ -522,23 +532,10 @@ Widget refreshableScroll(context,
mainAxisSpacing: 4.0,
crossAxisSpacing: 4.0,
)
- : NoProductResults()),
+ : NoResultsForProductsWidget()),
);
}
-double calAspectRatio(BuildContext context) {
- if (MediaQuery.of(context).size.height > 800) {
- return MediaQuery.of(context).size.width /
- (MediaQuery.of(context).size.height / 1.65);
- }
- if (MediaQuery.of(context).size.height > 700) {
- return MediaQuery.of(context).size.width /
- (MediaQuery.of(context).size.height / 1.35);
- }
- return MediaQuery.of(context).size.width /
- (MediaQuery.of(context).size.height / 1.3);
-}
-
class UserAuth {
UserAuth._privateConstructor();
static final UserAuth instance = UserAuth._privateConstructor();
@@ -548,7 +545,7 @@ class UserAuth {
Future> getDefaultShipping(BuildContext context) async {
String data = await DefaultAssetBundle.of(context)
- .loadString("assets/default_shipping.json");
+ .loadString("public/assets/json/default_shipping.json");
dynamic dataJson = json.decode(data);
List shipping = [];
diff --git a/LabelStoreMax/lib/bootstrap/shared_pref/shared_key.dart b/LabelStoreMax/lib/bootstrap/shared_pref/shared_key.dart
new file mode 100644
index 0000000..f4d923e
--- /dev/null
+++ b/LabelStoreMax/lib/bootstrap/shared_pref/shared_key.dart
@@ -0,0 +1,16 @@
+// 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.
+
+class SharedKey {
+ static const String authUser = "DEFAULT_SP_USER";
+ static const String cart = "CART_SESSION";
+ static const String customerBillingDetails = "CS_BILLING_DETAILS";
+ static const String customerShippingDetails = "CS_SHIPPING_DETAILS";
+}
diff --git a/LabelStoreMax/lib/bootstrap/shared_pref/sp_auth.dart b/LabelStoreMax/lib/bootstrap/shared_pref/sp_auth.dart
new file mode 100644
index 0000000..ac48146
--- /dev/null
+++ b/LabelStoreMax/lib/bootstrap/shared_pref/sp_auth.dart
@@ -0,0 +1,27 @@
+// 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/cupertino.dart';
+import 'package:flutter_app/app/models/cart.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/shared_key.dart';
+import 'package:nylo_framework/helpers/helper.dart';
+
+Future authCheck() async => ((await getUser()) != null);
+
+Future readAuthToken() async => (await getUser()).token;
+
+Future readUserId() async => (await getUser()).userId;
+
+authLogout(BuildContext context) async {
+ await NyStorage.delete(SharedKey.authUser);
+ Cart.getInstance.clear();
+ navigatorPush(context, routeName: "/home", forgetAll: true);
+}
diff --git a/LabelStoreMax/lib/config/app_locale.dart b/LabelStoreMax/lib/config/app_locale.dart
new file mode 100644
index 0000000..df8fed6
--- /dev/null
+++ b/LabelStoreMax/lib/config/app_locale.dart
@@ -0,0 +1,23 @@
+import 'package:flutter/cupertino.dart';
+
+/*
+|--------------------------------------------------------------------------
+| APP LOCALE
+|
+| Configure the language by setting the locale.
+|
+| e.g. Change app_locale = Locale('es'); for Spanish.
+| You can only use one of the supported locales below in app_locales_supported.
+|--------------------------------------------------------------------------
+*/
+
+const Locale app_locale = Locale('en');
+
+const List app_locales_supported = [
+ Locale('en'),
+ Locale('es'),
+ Locale('fr'),
+ Locale('hi'),
+ Locale('it'),
+ Locale('pt'),
+];
diff --git a/LabelStoreMax/lib/config/app_payment_gateways.dart b/LabelStoreMax/lib/config/app_payment_gateways.dart
new file mode 100644
index 0000000..dcfb5d6
--- /dev/null
+++ b/LabelStoreMax/lib/config/app_payment_gateways.dart
@@ -0,0 +1,54 @@
+import 'package:flutter_app/app/models/payment_type.dart';
+import 'package:flutter_app/app/providers/cash_on_delivery.dart';
+import 'package:flutter_app/app/providers/razor_pay.dart';
+import 'package:flutter_app/app/providers/stripe_pay.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+
+/*
+|--------------------------------------------------------------------------
+| PAYMENT GATEWAYS
+|
+| Configure which payment gateways you want to use.
+| Docs here: https://woosignal.com/docs/app/ios/label-storemax
+|--------------------------------------------------------------------------
+*/
+
+const app_payment_gateways = ["Stripe"];
+// Available: "Stripe", "CashOnDelivery", "RazorPay"
+// e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery.
+
+List paymentTypeList = [
+ addPayment(
+ id: 1,
+ name: "Stripe",
+ desc: "Debit or Credit Card",
+ assetImage: "dark_powered_by_stripe.png",
+ pay: stripePay,
+ ),
+
+ addPayment(
+ id: 2,
+ name: "CashOnDelivery",
+ desc: "Cash on delivery",
+ assetImage: "cash_on_delivery.jpeg",
+ pay: cashOnDeliveryPay,
+ ),
+
+ addPayment(
+ id: 3,
+ name: "RazorPay",
+ desc: "Debit or Credit Card",
+ assetImage: "razorpay.png",
+ pay: razorPay,
+ ),
+
+ // e.g. add more here
+
+ // addPayment(
+ // id: 4,
+ // name: "MyNewPaymentMethod",
+ // desc: "Debit or Credit Card",
+ // assetImage: "add icon image to public/assets/images/myimage.png",
+ // pay: "myCustomPaymentFunction",
+ // ),
+];
diff --git a/LabelStoreMax/lib/config/app_theme.dart b/LabelStoreMax/lib/config/app_theme.dart
new file mode 100644
index 0000000..7341c78
--- /dev/null
+++ b/LabelStoreMax/lib/config/app_theme.dart
@@ -0,0 +1,62 @@
+import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
+
+/*
+|--------------------------------------------------------------------------
+| APP THEME
+|
+| Change the font and colors for your themes.
+|--------------------------------------------------------------------------
+*/
+
+// Theme main font
+final TextStyle appThemeFont = GoogleFonts.overpass();
+
+// Theme colors
+class AppColors {
+ // MAIN
+ Color _mainLightColor = Color(0xFF232c33);
+ Color _mainDarkColor = Color(0xFFFAFAFA);
+
+ // SECONDARY
+ Color _secondLightColor = Color(0xFF232c33);
+ Color _secondDarkColor = Color(0xFFF1F1F1);
+
+ // ACCENT
+ Color _accentLightColor = Color(0xFF465f81);
+ Color _accentDarkColor = Color(0xFF4a4a4a);
+
+ // SCAFFOLD
+ Color _scaffoldDarkColor = Color(0xFF2C2C2C);
+ Color _scaffoldLightColor = Color(0xFFFAFAFA);
+}
+
+class AppTheme extends AppColors {
+ Color mainColor(
+ {double opacity = 1, Brightness brightness = Brightness.light}) {
+ return (brightness == Brightness.light
+ ? _mainLightColor.withOpacity(opacity)
+ : _mainDarkColor.withOpacity(opacity));
+ }
+
+ Color secondColor(
+ {double opacity = 1, Brightness brightness = Brightness.light}) {
+ return (brightness == Brightness.light
+ ? _secondLightColor.withOpacity(opacity)
+ : _secondDarkColor.withOpacity(opacity));
+ }
+
+ Color accentColor(
+ {double opacity = 1, Brightness brightness = Brightness.light}) {
+ return (brightness == Brightness.light
+ ? _accentLightColor.withOpacity(opacity)
+ : _accentDarkColor.withOpacity(opacity));
+ }
+
+ Color scaffoldColor(
+ {double opacity = 1, Brightness brightness = Brightness.light}) {
+ return (brightness == Brightness.light
+ ? _scaffoldLightColor.withOpacity(opacity)
+ : _scaffoldDarkColor.withOpacity(opacity));
+ }
+}
diff --git a/LabelStoreMax/lib/generated_plugin_registrant.dart b/LabelStoreMax/lib/generated_plugin_registrant.dart
deleted file mode 100644
index fb854d7..0000000
--- a/LabelStoreMax/lib/generated_plugin_registrant.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-// ignore_for_file: lines_longer_than_80_chars
-
-import 'package:shared_preferences_web/shared_preferences_web.dart';
-import 'package:url_launcher_web/url_launcher_web.dart';
-
-import 'package:flutter_web_plugins/flutter_web_plugins.dart';
-
-// ignore: public_member_api_docs
-void registerPlugins(Registrar registrar) {
- SharedPreferencesPlugin.registerWith(registrar);
- UrlLauncherPlugin.registerWith(registrar);
- registrar.registerMessageHandler();
-}
diff --git a/LabelStoreMax/lib/helpers/app_helper.dart b/LabelStoreMax/lib/helpers/app_helper.dart
deleted file mode 100644
index 9547844..0000000
--- a/LabelStoreMax/lib/helpers/app_helper.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-import 'package:woosignal/models/response/woosignal_app.dart';
-
-class AppHelper {
- AppHelper._privateConstructor();
-
- static final AppHelper instance = AppHelper._privateConstructor();
-
- WooSignalApp appConfig;
-}
diff --git a/LabelStoreMax/lib/helpers/app_localizations.dart b/LabelStoreMax/lib/helpers/app_localizations.dart
deleted file mode 100644
index 05a865c..0000000
--- a/LabelStoreMax/lib/helpers/app_localizations.dart
+++ /dev/null
@@ -1,64 +0,0 @@
-// 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 'dart:async';
-import 'dart:convert';
-
-import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
-
-import '../labelconfig.dart';
-
-class AppLocalizations {
- final Locale locale;
-
- AppLocalizations(this.locale);
-
- static AppLocalizations of(BuildContext context) {
- return Localizations.of(context, AppLocalizations);
- }
-
- static const LocalizationsDelegate delegate =
- _AppLocalizationsDelegate();
-
- Map _localizedStrings;
-
- Future load() async {
- String jsonString =
- await rootBundle.loadString('lang/${locale.languageCode}.json');
- Map jsonMap = json.decode(jsonString);
-
- _localizedStrings = jsonMap.map((k, v) {
- return MapEntry(k, v.toString());
- });
- }
-
- String trans(String key) => _localizedStrings[key];
-}
-
-class _AppLocalizationsDelegate
- extends LocalizationsDelegate {
- const _AppLocalizationsDelegate();
-
- @override
- bool isSupported(Locale locale) => app_locales_supported
- .map((e) => e.languageCode)
- .toList()
- .contains(locale.languageCode);
-
- @override
- bool shouldReload(_AppLocalizationsDelegate old) => false;
-
- Future load(Locale locale) async {
- AppLocalizations localizations = new AppLocalizations(locale);
- await localizations.load();
- return localizations;
- }
-}
diff --git a/LabelStoreMax/lib/helpers/app_themes.dart b/LabelStoreMax/lib/helpers/app_themes.dart
deleted file mode 100644
index 8e5477f..0000000
--- a/LabelStoreMax/lib/helpers/app_themes.dart
+++ /dev/null
@@ -1,168 +0,0 @@
-// 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:hexcolor/hexcolor.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
-
-TextTheme textThemeAccent() {
- return TextTheme(
- headline4: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w800,
- fontSize: 26),
- headline3: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- headline2: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- headline1: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- headline5: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline6: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- ),
- subtitle1: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w800),
- bodyText1: new TextStyle(
- color: HexColor("#606060"),
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700),
- bodyText2: new TextStyle(
- color: HexColor("#a8a8a8"),
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700,
- fontSize: 18),
- caption: new TextStyle(
- color: HexColor("#2a5080"),
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700,
- fontSize: 14),
- button: new TextStyle(
- color: Colors.white,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700),
- );
-}
-
-TextTheme textThemePrimary() {
- return TextTheme(
- headline4: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w800,
- fontSize: 26),
- headline3: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- headline2: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- headline1: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- headline5: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline6: new TextStyle(
- color: Colors.black87,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w600),
- subtitle1: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w800),
- bodyText1: new TextStyle(
- color: HexColor("#606060"),
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700),
- bodyText2: new TextStyle(
- color: HexColor("#a8a8a8"),
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700,
- fontSize: 18),
- caption: new TextStyle(
- color: HexColor("#2a5080"),
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700,
- fontSize: 14),
- button: new TextStyle(
- color: Colors.white,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w700),
- );
-}
-
-TextTheme textThemeMain() {
- return TextTheme(
- headline4: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- ),
- headline3: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline2: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline1: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline5: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline6: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- subtitle1: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- bodyText1: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- bodyText2: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- caption: new TextStyle(
- color: Colors.redAccent, fontSize: 16, fontFamily: appFontFamily),
- button: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- );
-}
-
-TextTheme textThemeAppBar() {
- return TextTheme(
- headline4: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline3: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline2: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline1: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline5: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- headline6: new TextStyle(
- color: Colors.black,
- fontFamily: appFontFamily,
- fontWeight: FontWeight.w900),
- subtitle1: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- bodyText1: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- bodyText2: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- caption: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- button: new TextStyle(color: Colors.black, fontFamily: appFontFamily),
- );
-}
-
-ColorScheme colorSchemeButton() {
- return ColorScheme.light(
- primary: const Color(0xff6200ee),
- primaryVariant: const Color(0xff3700b3),
- secondary: const Color(0xff03dac6),
- secondaryVariant: const Color(0xff018786),
- surface: Colors.white,
- background: Colors.white,
- error: const Color(0xffb00020),
- onPrimary: Colors.white,
- onSecondary: Colors.black,
- onSurface: Colors.black,
- onBackground: Colors.black,
- onError: Colors.white,
- brightness: Brightness.light,
- );
-}
diff --git a/LabelStoreMax/lib/helpers/shared_pref.dart b/LabelStoreMax/lib/helpers/shared_pref.dart
deleted file mode 100644
index 0cbd652..0000000
--- a/LabelStoreMax/lib/helpers/shared_pref.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// 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:shared_preferences/shared_preferences.dart';
-
-class SharedPref {
- read(String key) async {
- final prefs = await SharedPreferences.getInstance();
- return prefs.getString(key);
- }
-
- save(String key, value) async {
- final prefs = await SharedPreferences.getInstance();
- prefs.setString(key, value);
- }
-
- remove(String key) async {
- final prefs = await SharedPreferences.getInstance();
- prefs.remove(key);
- }
-}
diff --git a/LabelStoreMax/lib/helpers/shared_pref/sp_auth.dart b/LabelStoreMax/lib/helpers/shared_pref/sp_auth.dart
deleted file mode 100644
index f655c75..0000000
--- a/LabelStoreMax/lib/helpers/shared_pref/sp_auth.dart
+++ /dev/null
@@ -1,42 +0,0 @@
-// 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/cupertino.dart';
-import 'package:label_storemax/helpers/shared_pref.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_user_id.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/cart.dart';
-
-const keyAuthCheck = "DEFAULT_SP_AUTHCHECK";
-
-Future authCheck() async {
- SharedPref sharedPref = SharedPref();
- String val = await sharedPref.read(keyAuthCheck);
- return val != null ? true : false;
-}
-
-authUser(String v) async {
- SharedPref sharedPref = SharedPref();
- await sharedPref.save(keyAuthCheck, v);
-}
-
-Future readAuthToken() async {
- SharedPref sharedPref = SharedPref();
- dynamic val = await sharedPref.read(keyAuthCheck);
- return val.toString();
-}
-
-authLogout(BuildContext context) async {
- SharedPref sharedPref = SharedPref();
- await sharedPref.save(keyAuthCheck, null);
- destroyUserId(context);
- Cart.getInstance.clear();
- navigatorPush(context, routeName: "/home", forgetAll: true);
-}
diff --git a/LabelStoreMax/lib/helpers/shared_pref/sp_user_id.dart b/LabelStoreMax/lib/helpers/shared_pref/sp_user_id.dart
deleted file mode 100644
index 17ad4f3..0000000
--- a/LabelStoreMax/lib/helpers/shared_pref/sp_user_id.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// 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/cupertino.dart';
-import 'package:label_storemax/helpers/shared_pref.dart';
-
-const keyUserId = "DEFAULT_SP_USERID";
-
-storeUserId(String v) async {
- SharedPref sharedPref = SharedPref();
- await sharedPref.save(keyUserId, v);
-}
-
-Future readUserId() async {
- SharedPref sharedPref = SharedPref();
- return await sharedPref.read(keyUserId);
-}
-
-destroyUserId(BuildContext context) async {
- SharedPref sharedPref = SharedPref();
- await sharedPref.save(keyUserId, null);
-}
diff --git a/LabelStoreMax/lib/labelconfig.dart b/LabelStoreMax/lib/labelconfig.dart
deleted file mode 100644
index ffabb23..0000000
--- a/LabelStoreMax/lib/labelconfig.dart
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// LabelCore
-// Label StoreMAX
-//
-// Created by Anthony Gordon.
-// 2021, WooSignal Ltd. All rights reserved.
-//
-
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
-import 'dart:ui';
-
-/*
- Developer Notes
-
- SUPPORT EMAIL - support@woosignal.com
- VERSION - 3.0.0
- https://woosignal.com
- */
-
-/**/
-
-const app_name = "MyApp";
-
-const app_key = "Your app key from WooSignal";
-
-// Your App key from WooSignal
-// link: https://woosignal.com/dashboard/apps
-
-/**/
-
-const Locale app_locale = Locale('en');
-
-const List app_locales_supported = [
- Locale('en'),
- Locale('es'),
- Locale('fr'),
- Locale('hi'),
- Locale('it'),
- Locale('pt'),
-];
-// If you want to localize the app, add the locale above
-// then create a new lang json file using keys from en.json
-// e.g. lang/es.json
-
-const app_product_placeholder_image =
- "https://woosignal.com/images/woocommerce-placeholder.png";
-
-/**/
-
-// Available: "Stripe", "CashOnDelivery", "RazorPay"
-// Add the method to the array below e.g. ["Stripe", "CashOnDelivery"]
-
-const app_payment_methods = ["Stripe"];
-
-/**/
-
-// Your StripeAccount key from WooSignal
-// link: https://woosignal.com/dashboard
-
-const app_stripe_account = "Your Stripe Key from WooSignal";
-
-const app_stripe_live_mode = false; // set to true for live Stripe payments
-// For Live Payments follow the below steps
-// #1 SET the above to true for live payments
-// #2 Next visit https://woosignal.com/dashboard
-// #3 Then change "Environment for Stripe" to Live mode
-
-/**/
-// https://razorpay.com/
-
-const app_razor_id = "Your Razor ID from RazorPay";
-
-/**/
-
-const app_debug = true;
diff --git a/LabelStoreMax/lib/main.dart b/LabelStoreMax/lib/main.dart
index 92afa47..661c3d3 100644
--- a/LabelStoreMax/lib/main.dart
+++ b/LabelStoreMax/lib/main.dart
@@ -1,59 +1,30 @@
-// 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_localizations/flutter_localizations.dart';
-import 'package:hexcolor/hexcolor.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/pages/account_billing_details.dart';
-import 'package:label_storemax/pages/account_detail.dart';
-import 'package:label_storemax/pages/account_landing.dart';
-import 'package:label_storemax/pages/account_order_detail.dart';
-import 'package:label_storemax/pages/account_profile_update.dart';
-import 'package:label_storemax/pages/account_register.dart';
-import 'package:label_storemax/pages/account_shipping_details.dart';
-import 'package:label_storemax/pages/customer_countries.dart';
-import 'package:label_storemax/pages/error_page.dart';
-import 'package:label_storemax/pages/no_connection_page.dart';
-import 'package:label_storemax/pages/product_image_viewer_page.dart';
-import 'package:woosignal/models/response/order.dart';
-import 'package:woosignal/models/response/product_category.dart';
-import 'package:woosignal/models/response/products.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_app/bootstrap/app.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/config/app_locale.dart';
+import 'package:flutter_app/resources/themes/dark_theme.dart';
+import 'package:flutter_app/resources/themes/default_theme.dart';
+import 'package:flutter_app/config/app_theme.dart';
+import 'package:flutter_app/routes/router.dart';
+import 'package:nylo_framework/nylo.dart';
+import 'package:nylo_framework/nylo_framework.dart';
+import 'package:nylo_framework/theme/helper/theme_helper.dart';
import 'package:woosignal/models/response/woosignal_app.dart';
import 'package:wp_json_api/wp_json_api.dart';
-import 'labelconfig.dart';
-import 'package:label_storemax/pages/checkout_details.dart';
-import 'package:label_storemax/pages/home.dart';
-import 'package:label_storemax/pages/about.dart';
-import 'package:label_storemax/pages/checkout_confirmation.dart';
-import 'package:label_storemax/pages/cart.dart';
-import 'package:label_storemax/pages/checkout_status.dart';
-import 'package:label_storemax/pages/checkout_payment_type.dart';
-import 'package:label_storemax/pages/checkout_shipping_type.dart';
-import 'package:label_storemax/pages/product_detail.dart';
-import 'package:label_storemax/pages/browse_search.dart';
-import 'package:label_storemax/pages/home_menu.dart';
-import 'package:label_storemax/pages/home_search.dart';
-import 'package:label_storemax/pages/browse_category.dart';
-import 'package:flutter/services.dart';
-import 'package:page_transition/page_transition.dart';
-import 'package:label_storemax/helpers/app_themes.dart';
-import 'package:label_storemax/helpers/app_localizations.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
+ AppTheme appTheme = AppTheme();
+
+ Nylo nylo =
+ await initNylo(theme: defaultTheme(appTheme), router: buildRouter());
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
+
String initialRoute = '/no-connection';
WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp());
@@ -64,205 +35,22 @@ void main() async {
if (wooSignalApp.wpLoginEnabled == 1) {
WPJsonAPI.instance.initWith(
baseUrl: wooSignalApp.wpLoginBaseUrl,
- shouldDebug: wooSignalApp.appDebug == 1 ? true : false,
+ shouldDebug: (wooSignalApp.appDebug == 1),
wpJsonPath: wooSignalApp.wpLoginWpApiPath,
);
}
}
runApp(
- new MaterialApp(
- title: wooSignalApp?.appName ?? "Label StoreMax",
- color: Colors.white,
- debugShowCheckedModeBanner: false,
- initialRoute: initialRoute,
- routes: {
- '/home': (BuildContext context) => new HomePage(),
- '/cart': (BuildContext context) => new CartPage(),
- '/error': (BuildContext context) => new ErrorPage(),
- '/checkout': (BuildContext context) => new CheckoutConfirmationPage(),
- '/account-register': (BuildContext context) =>
- new AccountRegistrationPage(),
- '/account-detail': (BuildContext context) => new AccountDetailPage(),
- '/account-update': (BuildContext context) =>
- new AccountProfileUpdatePage(),
- '/account-billing-details': (BuildContext context) =>
- new AccountBillingDetailsPage(),
- '/account-shipping-details': (BuildContext context) =>
- new AccountShippingDetailsPage(),
- '/no-connection': (BuildContext context) => new NoConnectionPage(),
- },
- onGenerateRoute: (settings) {
- switch (settings.name) {
- case '/account-landing':
- return PageTransition(
- child: AccountLandingPage(),
- type: PageTransitionType.bottomToTop,
- );
-
- case '/browse-category':
- if (settings.arguments != null) {
- final ProductCategory category =
- settings.arguments as ProductCategory;
- return PageTransition(
- child: BrowseCategoryPage(productCategory: category),
- type: PageTransitionType.fade,
- );
- }
- return PageTransition(
- child: ErrorPage(),
- type: PageTransitionType.fade,
- );
-
- case '/product-search':
- if (settings.arguments != null) {
- final String search = settings.arguments as String;
- return PageTransition(
- child: BrowseSearchPage(search: search),
- type: PageTransitionType.fade,
- );
- }
- return PageTransition(
- child: ErrorPage(),
- type: PageTransitionType.fade,
- );
-
- case '/product-detail':
- if (settings.arguments != null) {
- final Product product = settings.arguments as Product;
- return PageTransition(
- child: ProductDetailPage(product: product),
- type: PageTransitionType.rightToLeftWithFade,
- );
- }
- return PageTransition(
- child: ErrorPage(),
- type: PageTransitionType.fade,
- );
-
- case '/product-images':
- if (settings.arguments != null) {
- final Map args = settings.arguments;
- return PageTransition(
- child: ProductImageViewerPage(
- initialIndex: args["index"],
- arrImageSrc: args["images"],
- ),
- type: PageTransitionType.fade);
- }
- return PageTransition(
- child: ErrorPage(), type: PageTransitionType.rightToLeft);
-
- case '/account-order-detail':
- if (settings.arguments != null) {
- final int orderId = settings.arguments as int;
- return PageTransition(
- child: AccountOrderDetailPage(orderId: orderId),
- type: PageTransitionType.rightToLeftWithFade,
- );
- }
- return PageTransition(
- child: ErrorPage(),
- type: PageTransitionType.fade,
- );
-
- case '/checkout-status':
- if (settings.arguments != null) {
- final Order order = settings.arguments as Order;
- return PageTransition(
- child: CheckoutStatusPage(order: order),
- type: PageTransitionType.rightToLeftWithFade,
- );
- }
- return PageTransition(
- child: ErrorPage(),
- type: PageTransitionType.fade,
- );
-
- case '/home-menu':
- return PageTransition(
- child: HomeMenuPage(),
- type: PageTransitionType.leftToRightWithFade,
- );
-
- case '/checkout-details':
- return PageTransition(
- child: CheckoutDetailsPage(),
- type: PageTransitionType.bottomToTop,
- );
-
- case '/about':
- return PageTransition(
- child: AboutPage(),
- type: PageTransitionType.leftToRightWithFade,
- );
-
- case '/checkout-payment-type':
- return PageTransition(
- child: CheckoutPaymentTypePage(),
- type: PageTransitionType.bottomToTop,
- );
-
- case '/checkout-shipping-type':
- return PageTransition(
- child: CheckoutShippingTypePage(),
- type: PageTransitionType.bottomToTop,
- );
-
- case '/home-search':
- return PageTransition(
- child: HomeSearchPage(),
- type: PageTransitionType.bottomToTop,
- );
-
- case '/customer-countries':
- return PageTransition(
- child: CustomerCountriesPage(),
- type: PageTransitionType.bottomToTop,
- );
- default:
- return null;
- }
- },
- supportedLocales: app_locales_supported,
- localizationsDelegates: [
- AppLocalizations.delegate,
- GlobalWidgetsLocalizations.delegate,
- GlobalMaterialLocalizations.delegate
- ],
+ AppBuild(
+ navigatorKey: nylo.router.navigatorKey,
+ onGenerateRoute: nylo.router.generator(),
+ themeData: CurrentTheme.instance.theme,
+ darkTheme: darkTheme(appTheme),
locale: app_locale,
- localeResolutionCallback:
- (Locale locale, Iterable supportedLocales) {
- return locale;
- },
- theme: ThemeData(
- primaryColor: HexColor("#2f4ffe"),
- backgroundColor: Colors.white,
- buttonTheme: ButtonThemeData(
- hoverColor: Colors.transparent,
- buttonColor: HexColor("#529cda"),
- colorScheme: colorSchemeButton(),
- minWidth: double.infinity,
- height: 70,
- shape: RoundedRectangleBorder(
- borderRadius: new BorderRadius.circular(5.0),
- ),
- ),
- appBarTheme: AppBarTheme(
- color: Colors.white,
- textTheme: textThemeAppBar(),
- elevation: 0.0,
- brightness: Brightness.light,
- iconTheme: IconThemeData(color: Colors.black),
- actionsIconTheme: IconThemeData(
- color: Colors.black,
- ),
- ),
- accentColor: Colors.black,
- accentTextTheme: textThemeAccent(),
- textTheme: textThemeMain(),
- primaryTextTheme: textThemePrimary(),
- ),
+ initialRoute: initialRoute,
+ supportedLocales: app_locales_supported,
+ debugShowCheckedModeBanner: false,
),
);
}
diff --git a/LabelStoreMax/lib/pages/about.dart b/LabelStoreMax/lib/pages/about.dart
deleted file mode 100644
index ab0a07c..0000000
--- a/LabelStoreMax/lib/pages/about.dart
+++ /dev/null
@@ -1,114 +0,0 @@
-// 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:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/menu_item.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
-import 'package:package_info/package_info.dart';
-import 'package:woosignal/models/response/woosignal_app.dart';
-
-class AboutPage extends StatefulWidget {
- AboutPage();
-
- @override
- _AboutPageState createState() => _AboutPageState();
-}
-
-class _AboutPageState extends State {
- _AboutPageState();
-
- WooSignalApp _wooSignalApp;
-
- @override
- void initState() {
- super.initState();
- _wooSignalApp = AppHelper.instance.appConfig;
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.transparent,
- leading: IconButton(
- icon: Icon(Icons.close),
- onPressed: () => Navigator.pop(context),
- ),
- title: Text(
- trans(context, "About"),
- style: Theme.of(context).primaryTextTheme.headline6,
- ),
- centerTitle: true,
- ),
- body: SafeArea(
- minimum: safeAreaDefault(),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Expanded(
- child: Center(child: StoreLogo()),
- flex: 2,
- ),
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: [
- MenuItem(
- title: trans(context, "Privacy policy"),
- leading: Icon(Icons.people),
- action: _actionPrivacy,
- ),
- MenuItem(
- title: trans(context, "Terms and conditions"),
- leading: Icon(Icons.description),
- action: _actionTerms,
- ),
- FutureBuilder(
- future: PackageInfo.fromPlatform(),
- builder: (BuildContext context,
- AsyncSnapshot snapshot) {
- switch (snapshot.connectionState) {
- case ConnectionState.none:
- return Text("");
- case ConnectionState.active:
- case ConnectionState.waiting:
- return Text("");
- case ConnectionState.done:
- if (snapshot.hasError) return Text("");
- return Padding(
- child: Text(
- "${trans(context, "Version")}: ${snapshot.data.version}",
- style: Theme.of(context)
- .primaryTextTheme
- .bodyText1),
- padding: EdgeInsets.only(top: 15, bottom: 15),
- );
- }
- return null; // unreachable
- },
- ),
- ],
- ),
- flex: 2,
- ),
- ],
- ),
- ),
- );
- }
-
- void _actionTerms() => openBrowserTab(url: _wooSignalApp.appTermslink);
-
- void _actionPrivacy() => openBrowserTab(url: _wooSignalApp.appPrivacylink);
-}
diff --git a/LabelStoreMax/lib/pages/checkout_status.dart b/LabelStoreMax/lib/pages/checkout_status.dart
deleted file mode 100644
index e3ab42c..0000000
--- a/LabelStoreMax/lib/pages/checkout_status.dart
+++ /dev/null
@@ -1,187 +0,0 @@
-// 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:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:woosignal/models/response/products.dart' as WS;
-import 'package:woosignal/models/response/order.dart' as WS;
-
-import '../widgets/woosignal_ui.dart';
-
-class CheckoutStatusPage extends StatefulWidget {
- final WS.Order order;
- CheckoutStatusPage({Key key, @required this.order}) : super(key: key);
-
- @override
- _CheckoutStatusState createState() => _CheckoutStatusState(this.order);
-}
-
-class _CheckoutStatusState extends State {
- _CheckoutStatusState(this._order);
-
- WS.Order _order;
-
- @override
- void initState() {
- super.initState();
-
- Cart.getInstance.clear();
- CheckoutSession.getInstance.clear();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.white,
- elevation: 0.0,
- title: StoreLogo(height: 60),
- automaticallyImplyLeading: false,
- centerTitle: true,
- ),
- body: SafeArea(
- child: Center(
- child: Column(
- mainAxisSize: MainAxisSize.max,
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- child: Column(
- children: [
- Padding(
- child: Text(
- trans(context, "Order Status"),
- style: Theme.of(context).primaryTextTheme.subtitle1,
- ),
- padding: EdgeInsets.only(bottom: 15),
- ),
- Text(
- trans(context, "Thank You!"),
- style: Theme.of(context).primaryTextTheme.headline6,
- textAlign: TextAlign.left,
- ),
- Text(
- trans(context, "Your transaction details"),
- style: Theme.of(context).primaryTextTheme.bodyText2,
- textAlign: TextAlign.left,
- ),
- Text(
- trans(context, "Order Ref") +
- ". #" +
- _order.id.toString(),
- style: Theme.of(context).primaryTextTheme.bodyText1,
- textAlign: TextAlign.left,
- ),
- ],
- ),
- width: double.infinity,
- decoration: BoxDecoration(
- color: Colors.white,
- border: Border(
- bottom: BorderSide(color: Colors.black12, width: 1.0),
- ),
- ),
- padding: EdgeInsets.only(bottom: 20),
- ),
- Container(
- child: Image(
- image: new AssetImage("assets/images/camion.gif"),
- height: 170,
- ),
- decoration: BoxDecoration(
- color: Colors.white,
- ),
- width: double.infinity,
- ),
- ],
- ),
- Align(
- child: Padding(
- child: Text(
- trans(context, "Items"),
- style: Theme.of(context).primaryTextTheme.subtitle1,
- textAlign: TextAlign.left,
- ),
- padding: EdgeInsets.all(8),
- ),
- alignment: Alignment.center,
- ),
- Expanded(
- child: new ListView.builder(
- itemCount: _order.lineItems.length,
- itemBuilder: (BuildContext context, int index) {
- WS.LineItems lineItem = _order.lineItems[index];
- return Container(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Flexible(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment:
- MainAxisAlignment.spaceAround,
- children: [
- Text(
- lineItem.name,
- style: Theme.of(context)
- .primaryTextTheme
- .bodyText1,
- softWrap: false,
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
- ),
- Text(
- "x" + lineItem.quantity.toString(),
- style: Theme.of(context)
- .primaryTextTheme
- .bodyText2,
- ),
- ],
- ),
- ),
- Text(
- formatStringCurrency(
- total: lineItem.total.toString(),
- ),
- style:
- Theme.of(context).primaryTextTheme.bodyText1,
- )
- ],
- ),
- decoration: BoxDecoration(
- color: Colors.white,
- ),
- padding: EdgeInsets.all(16),
- margin: EdgeInsets.all(8),
- );
- }),
- ),
- Align(
- child: MaterialButton(
- child: Text(trans(context, "Back to Home")),
- onPressed: () => Navigator.pushNamed(context, "/home"),
- ),
- alignment: Alignment.bottomCenter,
- ),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/LabelStoreMax/lib/pages/error_page.dart b/LabelStoreMax/lib/pages/error_page.dart
deleted file mode 100644
index 02994a8..0000000
--- a/LabelStoreMax/lib/pages/error_page.dart
+++ /dev/null
@@ -1,62 +0,0 @@
-// 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:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-
-class ErrorPage extends StatefulWidget {
- ErrorPage();
-
- @override
- _ErrorPageState createState() => _ErrorPageState();
-}
-
-class _ErrorPageState extends State {
- _ErrorPageState();
-
- @override
- void initState() {
- super.initState();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: SafeArea(
- minimum: safeAreaDefault(),
- child: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Icon(
- Icons.error_outline,
- size: 100,
- color: Colors.black54,
- ),
- Padding(
- padding: const EdgeInsets.all(16.0),
- child: Text(
- trans(context, "Sorry, something went wrong"),
- style: Theme.of(context).primaryTextTheme.bodyText2,
- textAlign: TextAlign.center,
- ),
- ),
- LinkButton(
- title: trans(context, "Back"),
- action: () => Navigator.pop(context)),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/LabelStoreMax/lib/pages/home_menu.dart b/LabelStoreMax/lib/pages/home_menu.dart
deleted file mode 100644
index 1f5f134..0000000
--- a/LabelStoreMax/lib/pages/home_menu.dart
+++ /dev/null
@@ -1,105 +0,0 @@
-// 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:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/widgets/menu_item.dart';
-import 'package:label_storemax/helpers/tools.dart';
-
-import '../widgets/woosignal_ui.dart';
-
-class HomeMenuPage extends StatefulWidget {
- HomeMenuPage();
-
- @override
- _HomeMenuPageState createState() => _HomeMenuPageState();
-}
-
-class _HomeMenuPageState extends State {
- _HomeMenuPageState();
-
- @override
- void initState() {
- super.initState();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.transparent,
- elevation: 0.0,
- title: Text(
- trans(context, "Menu"),
- style: Theme.of(context).primaryTextTheme.headline6,
- ),
- leading: IconButton(
- icon: Icon(Icons.close),
- onPressed: () => Navigator.of(context).pop(),
- ),
- centerTitle: true,
- ),
- body: SafeArea(
- minimum: safeAreaDefault(),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- StoreLogo(height: 100),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: [
- (AppHelper.instance.appConfig.wpLoginEnabled == 1
- ? MenuItem(
- title: trans(context, "Profile"),
- leading: Icon(Icons.account_circle),
- action: _actionProfile,
- )
- : Container()),
- MenuItem(
- title: trans(context, "Cart"),
- leading: Icon(Icons.shopping_cart),
- action: _actionCart,
- ),
- MenuItem(
- title: trans(context, "About Us"),
- leading: Icon(Icons.account_balance),
- action: _actionAboutUs,
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- );
- }
-
- void _actionCart() {
- Navigator.pushNamed(context, "/cart");
- }
-
- void _actionAboutUs() {
- Navigator.pushNamed(context, "/about");
- }
-
- void _actionProfile() async {
- if (AppHelper.instance.appConfig.wpLoginEnabled == 1 &&
- !(await authCheck())) {
- UserAuth.instance.redirect = "/account-detail";
- Navigator.pushNamed(context, "/account-landing");
- return;
- }
- Navigator.pushNamed(context, "/account-detail");
- }
-}
diff --git a/LabelStoreMax/lib/pages/product_image_viewer_page.dart b/LabelStoreMax/lib/pages/product_image_viewer_page.dart
deleted file mode 100644
index ad90461..0000000
--- a/LabelStoreMax/lib/pages/product_image_viewer_page.dart
+++ /dev/null
@@ -1,82 +0,0 @@
-// PRODUCT DETAIL NEW
-// 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/cupertino.dart';
-import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:flutter_swiper/flutter_swiper.dart';
-import 'package:cached_network_image/cached_network_image.dart';
-import 'package:label_storemax/labelconfig.dart';
-
-class ProductImageViewerPage extends StatefulWidget {
- final int initialIndex;
- final List arrImageSrc;
-
- const ProductImageViewerPage({Key key, this.initialIndex, this.arrImageSrc})
- : super(key: key);
-
- @override
- _ProductImageViewerPageState createState() =>
- _ProductImageViewerPageState(this.initialIndex, this.arrImageSrc);
-}
-
-class _ProductImageViewerPageState extends State {
- _ProductImageViewerPageState(this._initialIndex, this._arrImageSrc);
-
- int _initialIndex;
- List _arrImageSrc;
-
- @override
- void initState() {
- super.initState();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: SafeArea(
- minimum: safeAreaDefault(),
- child: Column(
- children: [
- Expanded(
- child: Swiper(
- index: _initialIndex,
- itemBuilder: (BuildContext context, int index) {
- return CachedNetworkImage(
- imageUrl: _arrImageSrc.length == 0
- ? app_product_placeholder_image
- : _arrImageSrc[index],
- placeholder: (context, url) =>
- new CircularProgressIndicator(
- strokeWidth: 2,
- backgroundColor: Colors.black12,
- ),
- errorWidget: (context, url, error) => new Icon(Icons.error),
- fit: BoxFit.contain,
- );
- },
- itemCount: _arrImageSrc.length == 0 ? 1 : _arrImageSrc.length,
- viewportFraction: 0.9,
- scale: 0.95,
- ),
- ),
- Container(
- child: IconButton(
- icon: Icon(Icons.close),
- onPressed: () => Navigator.pop(context),
- ),
- )
- ],
- ),
- ),
- );
- }
-}
diff --git a/LabelStoreMax/lib/pages/account_billing_details.dart b/LabelStoreMax/lib/resources/pages/account_billing_details.dart
similarity index 82%
rename from LabelStoreMax/lib/pages/account_billing_details.dart
rename to LabelStoreMax/lib/resources/pages/account_billing_details.dart
index 70c65d2..8fe3d6a 100644
--- a/LabelStoreMax/lib/pages/account_billing_details.dart
+++ b/LabelStoreMax/lib/resources/pages/account_billing_details.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,14 +8,16 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:hexcolor/hexcolor.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
+import 'package:flutter_app/config/app_theme.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/buttons.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.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/wp_json_api.dart';
@@ -31,14 +33,16 @@ class AccountBillingDetailsPage extends StatefulWidget {
class _AccountBillingDetailsPageState extends State {
_AccountBillingDetailsPageState();
+ AppTheme _appTheme = AppTheme();
+
// BILLING TEXT CONTROLLERS
- TextEditingController _txtShippingFirstName = TextEditingController();
- TextEditingController _txtShippingLastName = TextEditingController();
- TextEditingController _txtShippingAddressLine = TextEditingController();
- TextEditingController _txtShippingCity = TextEditingController();
- TextEditingController _txtShippingState = TextEditingController();
- TextEditingController _txtShippingPostalCode = TextEditingController();
- TextEditingController _txtShippingCountry = TextEditingController();
+ TextEditingController _txtShippingFirstName = TextEditingController(),
+ _txtShippingLastName = TextEditingController(),
+ _txtShippingAddressLine = TextEditingController(),
+ _txtShippingCity = TextEditingController(),
+ _txtShippingState = TextEditingController(),
+ _txtShippingPostalCode = TextEditingController(),
+ _txtShippingCountry = TextEditingController();
bool _isLoading = true, _isUpdating = false;
@@ -71,13 +75,14 @@ class _AccountBillingDetailsPageState extends State {
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text(
trans(context, "Billing Details"),
- style: Theme.of(context).primaryTextTheme.subtitle1,
+ style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
@@ -86,7 +91,7 @@ class _AccountBillingDetailsPageState extends State {
child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(new FocusNode()),
child: _isLoading
- ? showAppLoader()
+ ? AppLoaderWidget()
: LayoutBuilder(
builder: (context, constraints) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -94,6 +99,7 @@ class _AccountBillingDetailsPageState extends State {
children: [
SizedBox(
child: Container(
+ margin: EdgeInsets.only(top: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -146,10 +152,10 @@ class _AccountBillingDetailsPageState extends State {
),
Flexible(
child: TextEditingRow(
- heading: trans(context, "Country"),
- keyboardType:
- TextInputType.emailAddress,
- controller: _txtShippingCountry),
+ heading: trans(context, "Country"),
+ keyboardType: TextInputType.emailAddress,
+ controller: _txtShippingCountry,
+ ),
),
],
crossAxisAlignment: CrossAxisAlignment.center,
@@ -159,19 +165,13 @@ class _AccountBillingDetailsPageState extends State {
],
),
decoration: BoxDecoration(
- color: Colors.white,
+ color: adaptiveTheme.isLight
+ ? Colors.white
+ : _appTheme.accentColor(
+ brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10),
- boxShadow: [
- BoxShadow(
- color: HexColor("#e8e8e8"),
- blurRadius: 15.0,
- spreadRadius: 0,
- offset: Offset(
- 0,
- 0,
- ),
- )
- ],
+ boxShadow:
+ adaptiveTheme.isLight ? wsBoxShadow() : null,
),
padding: EdgeInsets.all(8),
),
diff --git a/LabelStoreMax/lib/pages/account_detail.dart b/LabelStoreMax/lib/resources/pages/account_detail.dart
similarity index 94%
rename from LabelStoreMax/lib/pages/account_detail.dart
rename to LabelStoreMax/lib/resources/pages/account_detail.dart
index e0f8818..21eb789 100644
--- a/LabelStoreMax/lib/pages/account_detail.dart
+++ b/LabelStoreMax/lib/resources/pages/account_detail.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,15 +8,16 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:hexcolor/hexcolor.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_user_id.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:woosignal/models/response/order.dart';
import 'package:wp_json_api/models/responses/wc_customer_info_response.dart';
@@ -31,7 +32,6 @@ class _AccountDetailPageState extends State
with SingleTickerProviderStateMixin {
RefreshController _refreshController =
RefreshController(initialRefresh: false);
-
bool _shouldStopRequests = false,
waitForNextRequest = false,
_isLoading = true,
@@ -55,7 +55,7 @@ class _AccountDetailPageState extends State
new Tab(text: ""),
];
_tabController = TabController(vsync: this, length: _tabs.length);
- _activeBody = showAppLoader();
+ _activeBody = AppLoaderWidget();
this.init();
}
@@ -98,6 +98,7 @@ class _AccountDetailPageState extends State
new Tab(text: trans(context, "Orders")),
new Tab(text: trans(context, "Settings")),
];
+ AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
@@ -110,7 +111,7 @@ class _AccountDetailPageState extends State
),
title: Text(
trans(context, "Account"),
- style: Theme.of(context).primaryTextTheme.headline6,
+ style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
@@ -118,7 +119,7 @@ class _AccountDetailPageState extends State
body: SafeArea(
minimum: safeAreaDefault(),
child: _isLoading
- ? showAppLoader()
+ ? AppLoaderWidget()
: Column(
children: [
Container(
@@ -203,8 +204,9 @@ class _AccountDetailPageState extends State
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
- boxShadow: wsBoxShadow(),
- color: Colors.white,
+ boxShadow: adaptiveTheme.isLight ? wsBoxShadow() : null,
+ color:
+ adaptiveTheme.isLight ? Colors.white : Colors.white70,
),
),
Expanded(child: _activeBody),
@@ -307,7 +309,7 @@ class _AccountDetailPageState extends State
Widget _widgetOrders() {
return _isLoadingOrders
- ? showAppLoader()
+ ? AppLoaderWidget()
: SmartRefresher(
enablePullDown: true,
enablePullUp: true,
@@ -360,7 +362,7 @@ class _AccountDetailPageState extends State
overflow: TextOverflow.ellipsis,
),
Text(
- capitalize(_orders[i].status),
+ _orders[i].status.capitalize(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -381,11 +383,10 @@ class _AccountDetailPageState extends State
formatStringCurrency(
total: _orders[i].total),
style: Theme.of(context)
- .primaryTextTheme
+ .textTheme
.bodyText2
.copyWith(
- fontWeight: FontWeight.w600,
- color: Colors.black),
+ fontWeight: FontWeight.w600),
textAlign: TextAlign.left,
),
Text(
@@ -393,11 +394,10 @@ class _AccountDetailPageState extends State
" " +
trans(context, "items"),
style: Theme.of(context)
- .primaryTextTheme
+ .textTheme
.bodyText1
.copyWith(
- fontWeight: FontWeight.w600,
- color: Colors.black),
+ fontWeight: FontWeight.w600),
textAlign: TextAlign.left,
),
],
@@ -416,11 +416,10 @@ class _AccountDetailPageState extends State
),
textAlign: TextAlign.right,
style: Theme.of(context)
- .primaryTextTheme
+ .textTheme
.bodyText1
.copyWith(
fontWeight: FontWeight.w400,
- color: Colors.black,
),
),
],
diff --git a/LabelStoreMax/lib/pages/account_landing.dart b/LabelStoreMax/lib/resources/pages/account_landing.dart
similarity index 80%
rename from LabelStoreMax/lib/pages/account_landing.dart
rename to LabelStoreMax/lib/resources/pages/account_landing.dart
index 47b3205..f456cf8 100644
--- a/LabelStoreMax/lib/pages/account_landing.dart
+++ b/LabelStoreMax/lib/resources/pages/account_landing.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,15 +8,17 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_user_id.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
-import 'package:url_launcher/url_launcher.dart';
+import 'package:flutter_app/app/models/user.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.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/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.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_nonce_exception.dart';
@@ -35,6 +37,7 @@ class _AccountLandingPageState extends State {
bool _hasTappedLogin = false;
TextEditingController _tfEmailController = TextEditingController(),
_tfPasswordController = TextEditingController();
+ AppTheme _appTheme = AppTheme();
@override
void initState() {
@@ -43,8 +46,8 @@ class _AccountLandingPageState extends State {
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold(
- backgroundColor: Colors.white,
resizeToAvoidBottomInset: false,
body: SafeArea(
child: Column(
@@ -66,10 +69,7 @@ class _AccountLandingPageState extends State {
child: Text(
trans(context, "Login"),
textAlign: TextAlign.left,
- style: Theme.of(context)
- .primaryTextTheme
- .headline4
- .copyWith(
+ style: Theme.of(context).textTheme.headline4.copyWith(
fontSize: 24,
fontWeight: FontWeight.w700,
),
@@ -79,8 +79,10 @@ class _AccountLandingPageState extends State {
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
- boxShadow: wsBoxShadow(),
- color: Colors.white,
+ boxShadow: adaptiveTheme.isLight ? wsBoxShadow() : null,
+ color: adaptiveTheme.isLight
+ ? Colors.white
+ : _appTheme.accentColor(brightness: Brightness.dark),
),
padding: EdgeInsets.symmetric(vertical: 18, horizontal: 8),
margin: EdgeInsets.symmetric(horizontal: 16),
@@ -114,32 +116,38 @@ class _AccountLandingPageState extends State {
children: [
Icon(
Icons.account_circle,
- color: Colors.black38,
+ color:
+ adaptiveTheme.isLight ? Colors.black38 : Colors.white70,
),
Padding(
child: Text(
trans(context, "Create an account"),
- style: Theme.of(context).primaryTextTheme.bodyText1,
+ style: Theme.of(context).textTheme.bodyText1,
),
padding: EdgeInsets.only(left: 8),
)
],
),
- onPressed: () {
- Navigator.pushNamed(context, "/account-register");
- },
+ onPressed: () =>
+ Navigator.pushNamed(context, "/account-register"),
),
LinkButton(
title: trans(context, "Forgot Password"),
action: () {
String forgotPasswordUrl =
AppHelper.instance.appConfig.wpLoginForgotPasswordUrl;
- launch(forgotPasswordUrl);
+ if (forgotPasswordUrl != null) {
+ openBrowserTab(url: forgotPasswordUrl);
+ } else {
+ NyLogger.info(
+ "No URL found for \"forgot password\".\nAdd your forgot password URL here https://woosignal.com/dashboard/apps");
+ }
}),
Divider(),
LinkButton(
- title: trans(context, "Back"),
- action: () => Navigator.pop(context)),
+ title: trans(context, "Back"),
+ action: () => Navigator.pop(context),
+ ),
],
),
),
@@ -214,8 +222,9 @@ class _AccountLandingPageState extends State {
if (wpUserLoginResponse != null && wpUserLoginResponse.status == 200) {
String token = wpUserLoginResponse.data.userToken;
- authUser(token);
- storeUserId(wpUserLoginResponse.data.userId.toString());
+ String userId = wpUserLoginResponse.data.userId.toString();
+ User user = User.fromUserAuthResponse(token: token, userId: userId);
+ user.save(SharedKey.authUser);
showEdgeAlertWith(context,
title: trans(context, "Hello"),
diff --git a/LabelStoreMax/lib/pages/account_order_detail.dart b/LabelStoreMax/lib/resources/pages/account_order_detail.dart
similarity index 78%
rename from LabelStoreMax/lib/pages/account_order_detail.dart
rename to LabelStoreMax/lib/resources/pages/account_order_detail.dart
index 5c29ff7..c53653e 100644
--- a/LabelStoreMax/lib/pages/account_order_detail.dart
+++ b/LabelStoreMax/lib/resources/pages/account_order_detail.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,37 +8,43 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_app/app/controllers/account_order_detail_controller.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:hexcolor/hexcolor.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
+import 'package:nylo_framework/widgets/ny_state.dart';
+import 'package:nylo_framework/widgets/stateful_page_widget.dart';
import 'package:woosignal/models/response/order.dart';
-class AccountOrderDetailPage extends StatefulWidget {
- final int orderId;
-
- AccountOrderDetailPage({Key key, @required this.orderId}) : super(key: key);
+class AccountOrderDetailPage extends StatefulPageWidget {
+ final AccountOrderDetailController controller =
+ AccountOrderDetailController();
+ AccountOrderDetailPage({Key key}) : super(key: key);
@override
_AccountOrderDetailPageState createState() => _AccountOrderDetailPageState();
}
-class _AccountOrderDetailPageState extends State {
- _AccountOrderDetailPageState();
-
+class _AccountOrderDetailPageState extends NyState {
+ int _orderId;
Order _order;
bool _isLoading = true;
@override
- void initState() {
- super.initState();
- _fetchOrder();
+ widgetDidLoad() async {
+ super.widgetDidLoad();
+ _orderId = widget.controller.data();
+ await _fetchOrder();
}
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
@@ -50,8 +56,8 @@ class _AccountOrderDetailPageState extends State {
margin: EdgeInsets.only(left: 0),
),
title: Text(
- "${capitalize(trans(context, "Order"))} #${widget.orderId.toString()}",
- style: Theme.of(context).primaryTextTheme.headline6,
+ "${trans(context, "Order").capitalize()} #${_orderId.toString()}",
+ style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
@@ -59,12 +65,12 @@ class _AccountOrderDetailPageState extends State {
body: SafeArea(
minimum: safeAreaDefault(),
child: _isLoading
- ? showAppLoader()
+ ? AppLoaderWidget()
: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Text("${capitalize(trans(context, "Date Ordered"))}: " +
+ Text("${trans(context, "Date Ordered").capitalize()}: " +
dateFormatted(
date: _order.dateCreated,
formatType: formatForDateTime(FormatType.Date))),
@@ -77,7 +83,7 @@ class _AccountOrderDetailPageState extends State {
children: [
Flexible(
child: Text(
- "${capitalize(trans(context, "Ships to"))}:"),
+ "${trans(context, "Ships to").capitalize()}:"),
),
Flexible(
child: Text(
@@ -103,8 +109,11 @@ class _AccountOrderDetailPageState extends State {
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
- boxShadow: wsBoxShadow(),
- color: Colors.white,
+ boxShadow:
+ adaptiveThemeMode.isLight ? wsBoxShadow() : null,
+ color: adaptiveThemeMode.isLight
+ ? Colors.white
+ : Color(0xFF2C2C2C),
),
),
Expanded(
@@ -134,10 +143,9 @@ class _AccountOrderDetailPageState extends State {
),
),
Text(
- capitalize(
- formatStringCurrency(
- total: _order.lineItems[i].price),
- ),
+ formatStringCurrency(
+ total: _order.lineItems[i].price)
+ .capitalize(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -161,23 +169,18 @@ class _AccountOrderDetailPageState extends State {
total: _order.lineItems[i].total,
),
style: Theme.of(context)
- .primaryTextTheme
+ .textTheme
.bodyText2
.copyWith(
fontWeight: FontWeight.w600,
- color: Colors.black,
),
textAlign: TextAlign.left,
),
Text(
"x${_order.lineItems[i].quantity.toString()}",
style: Theme.of(context)
- .primaryTextTheme
- .bodyText1
- .copyWith(
- fontWeight: FontWeight.w600,
- color: Colors.black,
- ),
+ .textTheme
+ .bodyText1,
textAlign: TextAlign.left,
),
],
@@ -204,7 +207,7 @@ class _AccountOrderDetailPageState extends State {
_fetchOrder() async {
_order = await appWooSignal((api) {
- return api.retrieveOrder(widget.orderId);
+ return api.retrieveOrder(_orderId);
});
if (_order != null) {
setState(() {
diff --git a/LabelStoreMax/lib/pages/account_profile_update.dart b/LabelStoreMax/lib/resources/pages/account_profile_update.dart
similarity index 92%
rename from LabelStoreMax/lib/pages/account_profile_update.dart
rename to LabelStoreMax/lib/resources/pages/account_profile_update.dart
index f921ec3..35a1849 100644
--- a/LabelStoreMax/lib/pages/account_profile_update.dart
+++ b/LabelStoreMax/lib/resources/pages/account_profile_update.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -10,11 +10,12 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/buttons.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.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/wp_json_api.dart';
@@ -62,7 +63,6 @@ class _AccountProfileUpdatePageState extends State {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
- backgroundColor: Colors.white,
title: Text(
trans(context, "Update Details"),
style: TextStyle(
@@ -73,7 +73,7 @@ class _AccountProfileUpdatePageState extends State {
elevation: 1,
),
body: isLoading
- ? showAppLoader()
+ ? AppLoaderWidget()
: SafeArea(
child: Column(
children: [
@@ -116,7 +116,6 @@ class _AccountProfileUpdatePageState extends State {
),
margin: EdgeInsets.all(8),
padding: EdgeInsets.all(8),
- color: Colors.white,
),
),
],
diff --git a/LabelStoreMax/lib/pages/account_register.dart b/LabelStoreMax/lib/resources/pages/account_register.dart
similarity index 88%
rename from LabelStoreMax/lib/pages/account_register.dart
rename to LabelStoreMax/lib/resources/pages/account_register.dart
index 27cc99a..e6f0285 100644
--- a/LabelStoreMax/lib/pages/account_register.dart
+++ b/LabelStoreMax/lib/resources/pages/account_register.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,13 +8,15 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_user_id.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/app/models/user.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.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/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/helpers/shared_pref.dart';
import 'package:woosignal/models/response/woosignal_app.dart';
import 'package:wp_json_api/exceptions/empty_username_exception.dart';
@@ -38,10 +40,11 @@ class _AccountRegistrationPageState extends State {
_AccountRegistrationPageState();
bool _hasTappedRegister = false;
- TextEditingController _tfEmailAddressController = TextEditingController();
- TextEditingController _tfPasswordController = TextEditingController();
- TextEditingController _tfFirstNameController = TextEditingController();
- TextEditingController _tfLastNameController = TextEditingController();
+ TextEditingController _tfEmailAddressController = TextEditingController(),
+ _tfPasswordController = TextEditingController(),
+ _tfFirstNameController = TextEditingController(),
+ _tfLastNameController = TextEditingController();
+
WooSignalApp _wooSignalApp = AppHelper.instance.appConfig;
@override
@@ -51,6 +54,7 @@ class _AccountRegistrationPageState extends State {
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
@@ -60,7 +64,7 @@ class _AccountRegistrationPageState extends State {
),
title: Text(
"Register",
- style: Theme.of(context).primaryTextTheme.headline6,
+ style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
@@ -126,7 +130,10 @@ class _AccountRegistrationPageState extends State {
text: trans(context, "privacy policy"),
style: TextStyle(fontWeight: FontWeight.bold)),
],
- style: TextStyle(color: Colors.black45),
+ style: TextStyle(
+ color: adaptiveTheme.isLight
+ ? Colors.black45
+ : Colors.white70),
),
textAlign: TextAlign.center,
),
@@ -228,8 +235,9 @@ class _AccountRegistrationPageState extends State {
if (wpUserRegisterResponse != null &&
wpUserRegisterResponse.status == 200) {
String token = wpUserRegisterResponse.data.userToken;
- authUser(token);
- storeUserId(wpUserRegisterResponse.data.userId.toString());
+ String userId = wpUserRegisterResponse.data.userId.toString();
+ User user = User.fromUserAuthResponse(token: token, userId: userId);
+ user.save(SharedKey.authUser);
await WPJsonAPI.instance.api((request) => request
.wpUpdateUserInfo(token, firstName: firstName, lastName: lastName));
diff --git a/LabelStoreMax/lib/pages/account_shipping_details.dart b/LabelStoreMax/lib/resources/pages/account_shipping_details.dart
similarity index 85%
rename from LabelStoreMax/lib/pages/account_shipping_details.dart
rename to LabelStoreMax/lib/resources/pages/account_shipping_details.dart
index 1faade8..1e5e4c6 100644
--- a/LabelStoreMax/lib/pages/account_shipping_details.dart
+++ b/LabelStoreMax/lib/resources/pages/account_shipping_details.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,14 +8,16 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:hexcolor/hexcolor.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
+import 'package:flutter_app/config/app_theme.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/buttons.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.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/wp_json_api.dart';
@@ -32,14 +34,16 @@ class _AccountShippingDetailsPageState
extends State {
_AccountShippingDetailsPageState();
+ AppTheme _appTheme = AppTheme();
+
// BILLING TEXT CONTROLLERS
- TextEditingController _txtShippingFirstName = TextEditingController();
- TextEditingController _txtShippingLastName = TextEditingController();
- TextEditingController _txtShippingAddressLine = TextEditingController();
- TextEditingController _txtShippingCity = TextEditingController();
- TextEditingController _txtShippingPostalCode = TextEditingController();
- TextEditingController _txtShippingState = TextEditingController();
- TextEditingController _txtShippingCountry = TextEditingController();
+ TextEditingController _txtShippingFirstName = TextEditingController(),
+ _txtShippingLastName = TextEditingController(),
+ _txtShippingAddressLine = TextEditingController(),
+ _txtShippingCity = TextEditingController(),
+ _txtShippingPostalCode = TextEditingController(),
+ _txtShippingState = TextEditingController(),
+ _txtShippingCountry = TextEditingController();
bool _isLoading = true, _isUpdating = false;
@@ -87,13 +91,14 @@ class _AccountShippingDetailsPageState
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveTheme = AdaptiveTheme.of(context).mode;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text(
trans(context, "Shipping Details"),
- style: Theme.of(context).primaryTextTheme.subtitle1,
+ style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
@@ -104,7 +109,7 @@ class _AccountShippingDetailsPageState
FocusScope.of(context).requestFocus(new FocusNode());
},
child: _isLoading
- ? showAppLoader()
+ ? AppLoaderWidget()
: LayoutBuilder(
builder: (context, constraints) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -112,6 +117,7 @@ class _AccountShippingDetailsPageState
children: [
SizedBox(
child: Container(
+ margin: EdgeInsets.only(top: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -176,20 +182,13 @@ class _AccountShippingDetailsPageState
],
),
decoration: BoxDecoration(
- color: Colors.white,
+ color: adaptiveTheme.isLight
+ ? Colors.white
+ : _appTheme.accentColor(
+ brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10),
- boxShadow: [
- BoxShadow(
- color: HexColor("#e8e8e8"),
- blurRadius: 15.0,
- // has the effect of softening the shadow
- spreadRadius: 0,
- offset: Offset(
- 0,
- 0,
- ),
- )
- ],
+ boxShadow:
+ adaptiveTheme.isLight ? wsBoxShadow() : null,
),
padding: EdgeInsets.all(8),
),
diff --git a/LabelStoreMax/lib/pages/browse_category.dart b/LabelStoreMax/lib/resources/pages/browse_category.dart
similarity index 71%
rename from LabelStoreMax/lib/pages/browse_category.dart
rename to LabelStoreMax/lib/resources/pages/browse_category.dart
index ec6c009..1738a88 100644
--- a/LabelStoreMax/lib/pages/browse_category.dart
+++ b/LabelStoreMax/lib/resources/pages/browse_category.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -10,29 +10,32 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/enums/sort_enums.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.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/helpers.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/buttons.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
+import 'package:nylo_framework/widgets/ny_state.dart';
+import 'package:nylo_framework/widgets/stateful_page_widget.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:woosignal/models/response/product_category.dart';
import 'package:woosignal/models/response/products.dart' as WS;
-import 'package:label_storemax/widgets/woosignal_ui.dart';
-class BrowseCategoryPage extends StatefulWidget {
- final ProductCategory productCategory;
- const BrowseCategoryPage({Key key, @required this.productCategory})
- : super(key: key);
+class BrowseCategoryPage extends StatefulPageWidget {
+ final BrowseCategoryController controller = BrowseCategoryController();
+ BrowseCategoryPage({Key key}) : super(key: key);
@override
_BrowseCategoryPageState createState() => _BrowseCategoryPageState();
}
-class _BrowseCategoryPageState extends State {
+class _BrowseCategoryPageState extends NyState {
+ ProductCategory productCategory;
_BrowseCategoryPageState();
List _products = [];
-
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@@ -42,9 +45,10 @@ class _BrowseCategoryPageState extends State {
_isLoading = true;
@override
- void initState() {
- super.initState();
- _fetchMoreProducts();
+ widgetDidLoad() async {
+ super.widgetDidLoad();
+ this.productCategory = widget.controller.data();
+ await _fetchMoreProducts();
}
_fetchMoreProducts() async {
@@ -52,7 +56,7 @@ class _BrowseCategoryPageState extends State {
List products = await appWooSignal(
(api) => api.getProducts(
perPage: 50,
- category: widget.productCategory.id.toString(),
+ category: productCategory.id.toString(),
page: _page,
status: "publish",
stockStatus: "instock"),
@@ -85,9 +89,9 @@ class _BrowseCategoryPageState extends State {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(trans(context, "Browse"),
- style: Theme.of(context).primaryTextTheme.subtitle1),
- Text(parseHtmlString(widget.productCategory.name),
- style: Theme.of(context).primaryTextTheme.headline6)
+ style: Theme.of(context).textTheme.subtitle1),
+ Text(parseHtmlString(productCategory.name),
+ style: Theme.of(context).textTheme.headline6)
],
),
centerTitle: true,
@@ -102,7 +106,7 @@ class _BrowseCategoryPageState extends State {
minimum: safeAreaDefault(),
child: _isLoading
? Center(
- child: showAppLoader(),
+ child: AppLoaderWidget(),
)
: refreshableScroll(context,
refreshController: _refreshController,
@@ -173,26 +177,30 @@ class _BrowseCategoryPageState extends State {
bodyWidget: ListView(
children: [
LinkButton(
- title: trans(context, "Sort: Low to high"),
- action: () => _sortProducts(by: SortByType.LowToHigh)),
+ title: trans(context, "Sort: Low to high"),
+ action: () => _sortProducts(by: SortByType.LowToHigh),
+ ),
Divider(
height: 0,
),
LinkButton(
- title: trans(context, "Sort: High to low"),
- action: () => _sortProducts(by: SortByType.HighToLow)),
+ title: trans(context, "Sort: High to low"),
+ action: () => _sortProducts(by: SortByType.HighToLow),
+ ),
Divider(
height: 0,
),
LinkButton(
- title: trans(context, "Sort: Name A-Z"),
- action: () => _sortProducts(by: SortByType.NameAZ)),
+ title: trans(context, "Sort: Name A-Z"),
+ action: () => _sortProducts(by: SortByType.NameAZ),
+ ),
Divider(
height: 0,
),
LinkButton(
- title: trans(context, "Sort: Name Z-A"),
- action: () => _sortProducts(by: SortByType.NameZA)),
+ title: trans(context, "Sort: Name Z-A"),
+ action: () => _sortProducts(by: SortByType.NameZA),
+ ),
Divider(
height: 0,
),
diff --git a/LabelStoreMax/lib/pages/browse_search.dart b/LabelStoreMax/lib/resources/pages/browse_search.dart
similarity index 73%
rename from LabelStoreMax/lib/pages/browse_search.dart
rename to LabelStoreMax/lib/resources/pages/browse_search.dart
index ec554d2..e727473 100644
--- a/LabelStoreMax/lib/pages/browse_search.dart
+++ b/LabelStoreMax/lib/resources/pages/browse_search.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -9,22 +9,24 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
+import 'package:flutter_app/app/controllers/browse_search_controller.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:nylo_framework/helpers/helper.dart';
+import 'package:nylo_framework/widgets/ny_state.dart';
+import 'package:nylo_framework/widgets/stateful_page_widget.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:woosignal/models/response/products.dart' as WS;
-class BrowseSearchPage extends StatefulWidget {
- final String search;
- BrowseSearchPage({Key key, @required this.search}) : super(key: key);
+class BrowseSearchPage extends StatefulPageWidget {
+ final BrowseSearchController controller = BrowseSearchController();
+ BrowseSearchPage({Key key}) : super(key: key);
@override
- _BrowseSearchState createState() => _BrowseSearchState(search);
+ _BrowseSearchState createState() => _BrowseSearchState();
}
-class _BrowseSearchState extends State {
- _BrowseSearchState(this._search);
-
+class _BrowseSearchState extends NyState {
RefreshController _refreshController =
RefreshController(initialRefresh: false);
@@ -36,9 +38,10 @@ class _BrowseSearchState extends State {
_isLoading = true;
@override
- void initState() {
- super.initState();
- _fetchProductsForSearch();
+ widgetDidLoad() async {
+ super.widgetDidLoad();
+ _search = widget.controller.data();
+ await _fetchProductsForSearch();
}
_fetchProductsForSearch() async {
@@ -80,9 +83,9 @@ class _BrowseSearchState extends State {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(trans(context, "Search results for"),
- style: Theme.of(context).primaryTextTheme.subtitle1),
+ style: Theme.of(context).textTheme.subtitle1),
Text("\"" + _search + "\"",
- style: Theme.of(context).primaryTextTheme.headline6)
+ style: Theme.of(context).textTheme.headline6)
],
),
centerTitle: true,
@@ -91,7 +94,7 @@ class _BrowseSearchState extends State {
minimum: safeAreaDefault(),
child: _isLoading
? Center(
- child: showAppLoader(),
+ child: AppLoaderWidget(),
)
: refreshableScroll(context,
refreshController: _refreshController,
diff --git a/LabelStoreMax/lib/pages/cart.dart b/LabelStoreMax/lib/resources/pages/cart.dart
similarity index 88%
rename from LabelStoreMax/lib/pages/cart.dart
rename to LabelStoreMax/lib/resources/pages/cart.dart
index e8a128f..f91d862 100644
--- a/LabelStoreMax/lib/pages/cart.dart
+++ b/LabelStoreMax/lib/resources/pages/cart.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -10,16 +10,18 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/shared_pref/sp_auth.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/cart_line_item.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/models/customer_address.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.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/checkout_session.dart';
+import 'package:flutter_app/app/models/customer_address.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/bootstrap/shared_pref/sp_auth.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/text_row_widget.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
class CartPage extends StatefulWidget {
CartPage();
@@ -166,7 +168,7 @@ class _CartPageState extends State {
setState(() {});
}
- void _clearCart() {
+ _clearCart() {
Cart.getInstance.clear();
_cartLines = [];
showEdgeAlertWith(context,
@@ -197,7 +199,7 @@ class _CartPageState extends State {
child: Padding(
child: Text(
trans(context, "Clear Cart"),
- style: Theme.of(context).primaryTextTheme.bodyText1,
+ style: Theme.of(context).textTheme.bodyText1,
),
padding: EdgeInsets.only(right: 8),
),
@@ -229,8 +231,7 @@ class _CartPageState extends State {
Padding(
child: Text(
trans(context, "Empty Basket"),
- style:
- Theme.of(context).primaryTextTheme.bodyText2,
+ style: Theme.of(context).textTheme.bodyText2,
),
padding: EdgeInsets.only(top: 10),
)
@@ -242,7 +243,7 @@ class _CartPageState extends State {
)
: (_isLoading
? Expanded(
- child: showAppLoader(),
+ child: AppLoaderWidget(),
)
: Expanded(
child: ListView.builder(
@@ -278,10 +279,9 @@ class _CartPageState extends State {
return Text("");
else
return new Padding(
- child: wsRow2Text(
- context,
- text1: trans(context, "Total"),
- text2: (_isLoading ? "" : snapshot.data),
+ child: TextRowWidget(
+ title: trans(context, "Total"),
+ text: (_isLoading ? "" : snapshot.data),
),
padding: EdgeInsets.only(bottom: 15, top: 15),
);
diff --git a/LabelStoreMax/lib/pages/checkout_confirmation.dart b/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart
similarity index 83%
rename from LabelStoreMax/lib/pages/checkout_confirmation.dart
rename to LabelStoreMax/lib/resources/pages/checkout_confirmation.dart
index c134f9c..ec17f95 100644
--- a/LabelStoreMax/lib/pages/checkout_confirmation.dart
+++ b/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,17 +8,18 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/app_payment_methods.dart';
-import 'package:label_storemax/helpers/app_helper.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/models/customer_address.dart';
-import 'package:label_storemax/models/customer_country.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/app/models/cart.dart';
+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_country.dart';
+import 'package:flutter_app/bootstrap/app_helper.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/buttons.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/response/tax_rate.dart';
import 'package:woosignal/models/response/woosignal_app.dart';
@@ -35,24 +36,22 @@ class CheckoutConfirmationPageState extends State {
bool _showFullLoader = true, _isProcessingPayment = false;
- List _taxRates;
+ List _taxRates = [];
TaxRate _taxRate;
- WooSignalApp _wooSignalApp;
+ final WooSignalApp _wooSignalApp = AppHelper.instance.appConfig;
@override
void initState() {
super.initState();
- _wooSignalApp = AppHelper.instance.appConfig;
- _taxRates = [];
- if (CheckoutSession.getInstance.paymentType == null) {
- CheckoutSession.getInstance.paymentType = arrPaymentMethods.first;
+ if (CheckoutSession.getInstance.paymentType == null &&
+ getPaymentTypes().length > 0) {
+ CheckoutSession.getInstance.paymentType = getPaymentTypes().first;
}
-
_getTaxes();
}
- void reloadState({bool showLoader}) {
+ reloadState({bool showLoader}) {
setState(() {
_showFullLoader = showLoader ?? false;
});
@@ -179,10 +178,17 @@ class CheckoutConfirmationPageState extends State {
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
- title: StoreLogo(height: 50),
+ title: Text(
+ trans(context, "Checkout"),
+ style: Theme.of(context)
+ .textTheme
+ .subtitle1
+ .copyWith(fontWeight: FontWeight.bold),
+ ),
centerTitle: true,
),
resizeToAvoidBottomInset: false,
@@ -193,25 +199,35 @@ class CheckoutConfirmationPageState extends State {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Center(
- child: Text(
- trans(context, "Checkout"),
- style: Theme.of(context).primaryTextTheme.subtitle1,
- ),
- ),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
- color: Colors.white,
+ color: adaptiveThemeMode.isLight
+ ? Colors.white
+ : Colors.white54,
borderRadius: BorderRadius.circular(10),
- boxShadow: wsBoxShadow(),
+ boxShadow:
+ adaptiveThemeMode.isLight ? wsBoxShadow() : null,
),
margin: EdgeInsets.only(top: 5, bottom: 5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceAround,
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
+ Container(
+ decoration: BoxDecoration(
+ boxShadow: adaptiveThemeMode.isLight
+ ? wsBoxShadow(blurRadius: 10)
+ : null,
+ color: Colors.transparent,
+ ),
+ padding: EdgeInsets.all(2),
+ margin: EdgeInsets.only(top: 16),
+ child: ClipRRect(
+ child: StoreLogo(height: 65),
+ borderRadius: BorderRadius.circular(8),
+ )),
((CheckoutSession.getInstance.billingDetails != null &&
CheckoutSession.getInstance.billingDetails
.billingAddress !=
@@ -242,11 +258,13 @@ class CheckoutConfirmationPageState extends State {
(CheckoutSession.getInstance.paymentType != null
? wsCheckoutRow(context,
heading: trans(context, "Payment method"),
- leadImage: Image(
- image: AssetImage("assets/images/" +
- CheckoutSession.getInstance
- .paymentType.assetImage),
+ leadImage: Image.asset(
+ getImageAsset(CheckoutSession
+ .getInstance.paymentType.assetImage),
width: 70,
+ color: adaptiveThemeMode.isLight
+ ? null
+ : Colors.white,
),
leadTitle: CheckoutSession
.getInstance.paymentType.desc,
@@ -327,12 +345,12 @@ class CheckoutConfirmationPageState extends State {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- showAppLoader(),
+ AppLoaderWidget(),
Padding(
padding: const EdgeInsets.only(top: 15),
child: Text(
"${trans(context, "One moment")}...",
- style: Theme.of(context).primaryTextTheme.subtitle1,
+ style: Theme.of(context).textTheme.subtitle1,
),
)
],
@@ -391,14 +409,14 @@ class CheckoutConfirmationPageState extends State {
}
if (_wooSignalApp.disableShipping != 1 &&
- CheckoutSession.getInstance.shippingType.minimumValue != null) {
+ CheckoutSession.getInstance.shippingType?.minimumValue != null) {
String total = await Cart.getInstance.getTotal();
if (total == null) {
return;
}
double doubleTotal = double.parse(total);
double doubleMinimumValue =
- double.parse(CheckoutSession.getInstance.shippingType.minimumValue);
+ double.parse(CheckoutSession.getInstance.shippingType?.minimumValue);
if (doubleTotal < doubleMinimumValue) {
showEdgeAlertWith(context,
diff --git a/LabelStoreMax/lib/pages/checkout_details.dart b/LabelStoreMax/lib/resources/pages/checkout_details.dart
similarity index 88%
rename from LabelStoreMax/lib/pages/checkout_details.dart
rename to LabelStoreMax/lib/resources/pages/checkout_details.dart
index 96571c2..accd4a6 100644
--- a/LabelStoreMax/lib/pages/checkout_details.dart
+++ b/LabelStoreMax/lib/resources/pages/checkout_details.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,16 +8,19 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/billing_details.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/models/customer_address.dart';
-import 'package:label_storemax/models/customer_country.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/customer_address_input.dart';
-import 'package:label_storemax/widgets/switch_address_tab.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/app/models/billing_details.dart';
+import 'package:flutter_app/app/models/checkout_session.dart';
+import 'package:flutter_app/app/models/customer_address.dart';
+import 'package:flutter_app/app/models/customer_country.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/customer_address_input.dart';
+import 'package:flutter_app/resources/widgets/switch_address_tab.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
class CheckoutDetailsPage extends StatefulWidget {
CheckoutDetailsPage();
@@ -31,6 +34,7 @@ class _CheckoutDetailsPageState extends State {
bool _hasDifferentShippingAddress = false, valRememberDetails = true;
int activeTabIndex = 0;
+ AppTheme _appTheme = AppTheme();
// TEXT CONTROLLERS
TextEditingController
@@ -154,13 +158,14 @@ class _CheckoutDetailsPageState extends State {
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.transparent,
title: Text(
trans(context, "Billing & Shipping Details"),
- style: Theme.of(context).primaryTextTheme.headline6,
+ style: Theme.of(context).textTheme.headline6,
),
centerTitle: true,
),
@@ -179,7 +184,7 @@ class _CheckoutDetailsPageState extends State {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
- margin: EdgeInsets.symmetric(vertical: 6),
+ margin: EdgeInsets.symmetric(vertical: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -213,7 +218,7 @@ class _CheckoutDetailsPageState extends State {
})),
].where((e) => e != null).toList(),
),
- padding: EdgeInsets.symmetric(vertical: 8),
+ padding: EdgeInsets.symmetric(vertical: 4),
)
: null),
].where((e) => e != null).toList(),
@@ -223,13 +228,18 @@ class _CheckoutDetailsPageState extends State {
Flexible(
fit: FlexFit.tight,
child: Container(
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- boxShadow: wsBoxShadow(),
- ),
- padding: EdgeInsets.all(8),
- child: (activeTab ?? tabBillingDetails())),
+ decoration: BoxDecoration(
+ color: adaptiveThemeMode.isLight
+ ? Colors.white
+ : _appTheme.accentColor(
+ brightness: Brightness.dark),
+ borderRadius: BorderRadius.circular(10),
+ boxShadow:
+ adaptiveThemeMode.isLight ? wsBoxShadow() : null,
+ ),
+ padding: EdgeInsets.only(left: 8, right: 8, top: 8),
+ child: (activeTab ?? tabBillingDetails()),
+ ),
),
],
),
@@ -244,7 +254,7 @@ class _CheckoutDetailsPageState extends State {
children: [
Text(
trans(context, "Ship to a different address?"),
- style: Theme.of(context).primaryTextTheme.bodyText2,
+ style: Theme.of(context).textTheme.bodyText2,
),
Checkbox(
value: _hasDifferentShippingAddress,
@@ -258,7 +268,7 @@ class _CheckoutDetailsPageState extends State {
children: [
Text(
trans(context, "Remember my details"),
- style: Theme.of(context).primaryTextTheme.bodyText2,
+ style: Theme.of(context).textTheme.bodyText2,
),
Checkbox(
value: valRememberDetails,
@@ -271,8 +281,9 @@ class _CheckoutDetailsPageState extends State {
],
),
PrimaryButton(
- title: trans(context, "USE DETAILS"),
- action: () => _useDetailsTapped()),
+ title: trans(context, "USE DETAILS"),
+ action: () => _useDetailsTapped(),
+ ),
],
),
),
diff --git a/LabelStoreMax/lib/pages/checkout_payment_type.dart b/LabelStoreMax/lib/resources/pages/checkout_payment_type.dart
similarity index 65%
rename from LabelStoreMax/lib/pages/checkout_payment_type.dart
rename to LabelStoreMax/lib/resources/pages/checkout_payment_type.dart
index 671ed71..23d5a1a 100644
--- a/LabelStoreMax/lib/pages/checkout_payment_type.dart
+++ b/LabelStoreMax/lib/resources/pages/checkout_payment_type.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,11 +8,15 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.dart';
+import 'package:flutter_app/app/models/checkout_session.dart';
+import 'package:flutter_app/app/models/payment_type.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/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
class CheckoutPaymentTypePage extends StatefulWidget {
CheckoutPaymentTypePage();
@@ -25,6 +29,8 @@ class CheckoutPaymentTypePage extends StatefulWidget {
class _CheckoutPaymentTypePageState extends State {
_CheckoutPaymentTypePageState();
+ AppTheme _appTheme = AppTheme();
+
@override
void initState() {
super.initState();
@@ -38,12 +44,15 @@ class _CheckoutPaymentTypePageState extends State {
@override
Widget build(BuildContext context) {
+ AdaptiveThemeMode adaptiveThemeMode = AdaptiveTheme.of(context).mode;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.transparent,
- title: Text(trans(context, "Payment Method"),
- style: Theme.of(context).primaryTextTheme.headline6),
+ title: Text(
+ trans(context, "Payment Method"),
+ style: Theme.of(context).textTheme.headline6,
+ ),
automaticallyImplyLeading: false,
centerTitle: true,
),
@@ -58,10 +67,8 @@ class _CheckoutPaymentTypePageState extends State {
children: [
Padding(
child: Center(
- child: Image(
- image: AssetImage("assets/images/credit_cards.png"),
- fit: BoxFit.fitHeight,
- height: 100),
+ child: Image.asset(getImageAsset("credit_cards.png"),
+ fit: BoxFit.fitHeight, height: 100),
),
padding: EdgeInsets.only(top: 20),
),
@@ -75,28 +82,35 @@ class _CheckoutPaymentTypePageState extends State {
child: ListView.separated(
itemCount: getPaymentTypes().length,
itemBuilder: (BuildContext context, int index) {
+ PaymentType paymentType =
+ getPaymentTypes()[index];
return ListTile(
contentPadding: EdgeInsets.only(
- top: 10, bottom: 10, left: 8, right: 8),
- leading: Image(
- image: AssetImage("assets/images/" +
- getPaymentTypes()[index].assetImage),
+ top: 10,
+ bottom: 10,
+ left: 8,
+ right: 8,
+ ),
+ leading: Image.asset(
+ getImageAsset(paymentType.assetImage),
width: 60,
+ color: adaptiveThemeMode.isLight
+ ? null
+ : Colors.white,
fit: BoxFit.contain,
alignment: Alignment.center),
- title: Text(getPaymentTypes()[index].desc,
- style: Theme.of(context)
- .primaryTextTheme
- .subtitle1),
+ title: Text(paymentType.desc,
+ style:
+ Theme.of(context).textTheme.subtitle1),
selected: true,
trailing:
(CheckoutSession.getInstance.paymentType ==
- getPaymentTypes()[index]
+ paymentType
? Icon(Icons.check)
: null),
onTap: () {
CheckoutSession.getInstance.paymentType =
- getPaymentTypes()[index];
+ paymentType;
Navigator.pop(context);
},
);
@@ -113,9 +127,12 @@ class _CheckoutPaymentTypePageState extends State {
],
),
decoration: BoxDecoration(
- color: Colors.white,
+ color: adaptiveThemeMode.isLight
+ ? Colors.white
+ : _appTheme.accentColor(brightness: Brightness.dark),
borderRadius: BorderRadius.circular(10),
- boxShadow: wsBoxShadow(),
+ boxShadow:
+ adaptiveThemeMode.isLight ? wsBoxShadow() : null,
),
padding: EdgeInsets.all(8),
),
diff --git a/LabelStoreMax/lib/pages/checkout_shipping_type.dart b/LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart
similarity index 77%
rename from LabelStoreMax/lib/pages/checkout_shipping_type.dart
rename to LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart
index dbfd5ab..d66ba83 100644
--- a/LabelStoreMax/lib/pages/checkout_shipping_type.dart
+++ b/LabelStoreMax/lib/resources/pages/checkout_shipping_type.dart
@@ -1,4 +1,4 @@
-// Label StoreMAX
+// Label StoreMax
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
@@ -8,17 +8,20 @@
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
-import 'package:label_storemax/helpers/tools.dart';
-import 'package:label_storemax/models/cart.dart';
-import 'package:label_storemax/models/cart_line_item.dart';
-import 'package:label_storemax/models/checkout_session.dart';
-import 'package:label_storemax/models/customer_address.dart';
-import 'package:label_storemax/models/customer_country.dart';
-import 'package:label_storemax/models/shipping_type.dart';
-import 'package:label_storemax/widgets/app_loader.dart';
-import 'package:label_storemax/widgets/buttons.dart';
-import 'package:label_storemax/widgets/woosignal_ui.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/checkout_session.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/shipping_type.dart';
+import 'package:flutter_app/bootstrap/helpers.dart';
+import 'package:flutter_app/config/app_theme.dart';
+import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
+import 'package:flutter_app/resources/widgets/buttons.dart';
+import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
+import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/response/shipping_method.dart';
class CheckoutShippingTypePage extends StatefulWidget {
@@ -32,6 +35,7 @@ class CheckoutShippingTypePage extends StatefulWidget {
class _CheckoutShippingTypePageState extends State {
_CheckoutShippingTypePageState();
+ AppTheme _appTheme = AppTheme();
bool _isShippingSupported, _isLoading;
List