├── .gitignore
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── codeforany
│ │ │ │ └── online_groceries
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── font
│ ├── Airbnb-Cereald-Medium.otf
│ ├── Gilroy-Bold.ttf
│ ├── Gilroy-Medium.ttf
│ ├── Gilroy-Regular.ttf
│ ├── Gilroy-SemiBold.ttf
│ ├── HKGrotesk-Bold.otf
│ ├── HKGrotesk-Regular.otf
│ └── Sveningsson.ttf
└── img
│ ├── a_about.png
│ ├── a_delivery_address.png
│ ├── a_help.png
│ ├── a_my_detail.png
│ ├── a_noitification.png
│ ├── a_order.png
│ ├── a_promocode.png
│ ├── account_tab.png
│ ├── add.png
│ ├── add_green.png
│ ├── app_logo.png
│ ├── apple.png
│ ├── apple_red.png
│ ├── back.png
│ ├── bakery_snacks.png
│ ├── banana.png
│ ├── banner_top.png
│ ├── beef_bone.png
│ ├── bell_pepper_red.png
│ ├── beverages.png
│ ├── bottom_bg.png
│ ├── broiler_chicken.png
│ ├── cart_tab.png
│ ├── checkbox.png
│ ├── checkbox_check.png
│ ├── close.png
│ ├── cocacola_can.png
│ ├── color_logo.png
│ ├── cooking_oil.png
│ ├── dairy_eggs.png
│ ├── detail_open.png
│ ├── diet_coke.png
│ ├── egg_chicken_red.png
│ ├── egg_chicken_white.png
│ ├── egg_noodies_new.png
│ ├── egg_noodles.png
│ ├── egg_pasta.png
│ ├── explore_tab.png
│ ├── fav.png
│ ├── fav_tab.png
│ ├── favorite.png
│ ├── fb_logo.png
│ ├── filter_ic.png
│ ├── frash_fruits.png
│ ├── ginger.png
│ ├── google_logo.png
│ ├── juice_apple_grape.png
│ ├── location.png
│ ├── logout.png
│ ├── master.png
│ ├── mayinnars_eggless.png
│ ├── meat_fish.png
│ ├── next.png
│ ├── order_accpeted.png
│ ├── order_fail.png
│ ├── orenge_juice.png
│ ├── paymenth_methods.png
│ ├── pepsi_can.png
│ ├── pulses.png
│ ├── rice.png
│ ├── search.png
│ ├── select_location.png
│ ├── share.png
│ ├── sign_in_top.png
│ ├── splash_logo.png
│ ├── sprite_can.png
│ ├── store_tab.png
│ ├── subtack.png
│ ├── t_close.png
│ ├── u1.png
│ ├── u2.png
│ └── welcom_bg.png
├── db_design.txt
├── groceries.sql
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
└── RunnerTests
│ └── RunnerTests.swift
├── lib
├── common
│ ├── color_extension.dart
│ ├── extension.dart
│ ├── globs.dart
│ ├── my_http_overrides.dart
│ └── service_call.dart
├── common_widget
│ ├── account_row.dart
│ ├── address_row.dart
│ ├── cart_item_row.dart
│ ├── category_cell.dart
│ ├── checkout_row.dart
│ ├── dropdown.dart
│ ├── explore_cell.dart
│ ├── favourite_row.dart
│ ├── filter_row.dart
│ ├── line_textfield.dart
│ ├── my_order_row.dart
│ ├── notification_row.dart
│ ├── order_item_row.dart
│ ├── payment_method_row.dart
│ ├── popup_layout.dart
│ ├── product_cell.dart
│ ├── promo_code_row.dart
│ ├── round_button.dart
│ └── section_view.dart
├── main.dart
├── model
│ ├── address_model.dart
│ ├── cart_item_model.dart
│ ├── explore_category_model.dart
│ ├── image_model.dart
│ ├── my_order_model.dart
│ ├── notification_model.dart
│ ├── nutrition_model.dart
│ ├── offer_product_model.dart
│ ├── payment_model.dart
│ ├── product_detail_model.dart
│ ├── promo_code_model.dart
│ ├── type_model.dart
│ └── user_payload_model.dart
├── view
│ ├── account
│ │ ├── account_view.dart
│ │ ├── add_address_view.dart
│ │ ├── add_payment_method_view.dart
│ │ ├── address_list_view.dart
│ │ ├── change_password_view.dart
│ │ ├── my_detail_view.dart
│ │ ├── my_order_detail_view.dart
│ │ ├── my_order_view.dart
│ │ ├── notification_view.dart
│ │ ├── payment_method_view.dart
│ │ ├── promo_code_view.dart
│ │ └── write_review_view.dart
│ ├── explore
│ │ ├── explore_detail_view.dart
│ │ ├── explore_view.dart
│ │ ├── filter_view.dart
│ │ └── search_view.dart
│ ├── favourite
│ │ └── favourite_view.dart
│ ├── home
│ │ ├── home_view.dart
│ │ └── product_details_view.dart
│ ├── login
│ │ ├── forgot_password_set_view.dart
│ │ ├── forgot_password_view.dart
│ │ ├── login_view.dart
│ │ ├── select_location_view.dart
│ │ ├── sign_in_view.dart
│ │ ├── sign_up_view.dart
│ │ ├── verification_view.dart
│ │ └── welcome_view.dart
│ ├── main_tabview
│ │ └── main_tabview.dart
│ ├── my_cart
│ │ ├── checkout_view.dart
│ │ ├── error_view.dart
│ │ ├── my_cart_view.dart
│ │ └── order_accpet_view.dart
│ └── splash_view.dart
└── view_model
│ ├── addres_view_mode.dart
│ ├── cart_view_model.dart
│ ├── explore_item_view_model.dart
│ ├── explore_view_model.dart
│ ├── favourite_view_model.dart
│ ├── forgot_password_view_model.dart
│ ├── home_view_model.dart
│ ├── login_view_model.dart
│ ├── my_detail_view_model.dart
│ ├── my_order_detail_view_model.dart
│ ├── my_orders_view_model.dart
│ ├── notification_view_model.dart
│ ├── payment_view_model.dart
│ ├── product_detail_view_model.dart
│ ├── promo_code_view_model.dart
│ ├── sign_up_view_model.dart
│ └── splash_view_model.dart
├── pubspec.lock
└── pubspec.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | namespace "com.codeforany.online_groceries"
30 | compileSdkVersion flutter.compileSdkVersion
31 | ndkVersion flutter.ndkVersion
32 |
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 |
38 | kotlinOptions {
39 | jvmTarget = '1.8'
40 | }
41 |
42 | sourceSets {
43 | main.java.srcDirs += 'src/main/kotlin'
44 | }
45 |
46 | defaultConfig {
47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48 | applicationId "com.codeforany.online_groceries"
49 | // You can update the following values to match your application needs.
50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
51 | minSdkVersion flutter.minSdkVersion
52 | targetSdkVersion flutter.targetSdkVersion
53 | versionCode flutterVersionCode.toInteger()
54 | versionName flutterVersionName
55 | }
56 |
57 | buildTypes {
58 | release {
59 | // TODO: Add your own signing config for the release build.
60 | // Signing with the debug keys for now, so `flutter run --release` works.
61 | signingConfig signingConfigs.debug
62 | }
63 | }
64 | }
65 |
66 | flutter {
67 | source '../..'
68 | }
69 |
70 | dependencies {
71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72 | }
73 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/codeforany/online_groceries/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.codeforany.online_groceries
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.3.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/font/Airbnb-Cereald-Medium.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/Airbnb-Cereald-Medium.otf
--------------------------------------------------------------------------------
/assets/font/Gilroy-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/Gilroy-Bold.ttf
--------------------------------------------------------------------------------
/assets/font/Gilroy-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/Gilroy-Medium.ttf
--------------------------------------------------------------------------------
/assets/font/Gilroy-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/Gilroy-Regular.ttf
--------------------------------------------------------------------------------
/assets/font/Gilroy-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/Gilroy-SemiBold.ttf
--------------------------------------------------------------------------------
/assets/font/HKGrotesk-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/HKGrotesk-Bold.otf
--------------------------------------------------------------------------------
/assets/font/HKGrotesk-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/HKGrotesk-Regular.otf
--------------------------------------------------------------------------------
/assets/font/Sveningsson.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/font/Sveningsson.ttf
--------------------------------------------------------------------------------
/assets/img/a_about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_about.png
--------------------------------------------------------------------------------
/assets/img/a_delivery_address.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_delivery_address.png
--------------------------------------------------------------------------------
/assets/img/a_help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_help.png
--------------------------------------------------------------------------------
/assets/img/a_my_detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_my_detail.png
--------------------------------------------------------------------------------
/assets/img/a_noitification.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_noitification.png
--------------------------------------------------------------------------------
/assets/img/a_order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_order.png
--------------------------------------------------------------------------------
/assets/img/a_promocode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/a_promocode.png
--------------------------------------------------------------------------------
/assets/img/account_tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/account_tab.png
--------------------------------------------------------------------------------
/assets/img/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/add.png
--------------------------------------------------------------------------------
/assets/img/add_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/add_green.png
--------------------------------------------------------------------------------
/assets/img/app_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/app_logo.png
--------------------------------------------------------------------------------
/assets/img/apple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/apple.png
--------------------------------------------------------------------------------
/assets/img/apple_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/apple_red.png
--------------------------------------------------------------------------------
/assets/img/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/back.png
--------------------------------------------------------------------------------
/assets/img/bakery_snacks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/bakery_snacks.png
--------------------------------------------------------------------------------
/assets/img/banana.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/banana.png
--------------------------------------------------------------------------------
/assets/img/banner_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/banner_top.png
--------------------------------------------------------------------------------
/assets/img/beef_bone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/beef_bone.png
--------------------------------------------------------------------------------
/assets/img/bell_pepper_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/bell_pepper_red.png
--------------------------------------------------------------------------------
/assets/img/beverages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/beverages.png
--------------------------------------------------------------------------------
/assets/img/bottom_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/bottom_bg.png
--------------------------------------------------------------------------------
/assets/img/broiler_chicken.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/broiler_chicken.png
--------------------------------------------------------------------------------
/assets/img/cart_tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/cart_tab.png
--------------------------------------------------------------------------------
/assets/img/checkbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/checkbox.png
--------------------------------------------------------------------------------
/assets/img/checkbox_check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/checkbox_check.png
--------------------------------------------------------------------------------
/assets/img/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/close.png
--------------------------------------------------------------------------------
/assets/img/cocacola_can.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/cocacola_can.png
--------------------------------------------------------------------------------
/assets/img/color_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/color_logo.png
--------------------------------------------------------------------------------
/assets/img/cooking_oil.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/cooking_oil.png
--------------------------------------------------------------------------------
/assets/img/dairy_eggs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/dairy_eggs.png
--------------------------------------------------------------------------------
/assets/img/detail_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/detail_open.png
--------------------------------------------------------------------------------
/assets/img/diet_coke.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/diet_coke.png
--------------------------------------------------------------------------------
/assets/img/egg_chicken_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/egg_chicken_red.png
--------------------------------------------------------------------------------
/assets/img/egg_chicken_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/egg_chicken_white.png
--------------------------------------------------------------------------------
/assets/img/egg_noodies_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/egg_noodies_new.png
--------------------------------------------------------------------------------
/assets/img/egg_noodles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/egg_noodles.png
--------------------------------------------------------------------------------
/assets/img/egg_pasta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/egg_pasta.png
--------------------------------------------------------------------------------
/assets/img/explore_tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/explore_tab.png
--------------------------------------------------------------------------------
/assets/img/fav.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/fav.png
--------------------------------------------------------------------------------
/assets/img/fav_tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/fav_tab.png
--------------------------------------------------------------------------------
/assets/img/favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/favorite.png
--------------------------------------------------------------------------------
/assets/img/fb_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/fb_logo.png
--------------------------------------------------------------------------------
/assets/img/filter_ic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/filter_ic.png
--------------------------------------------------------------------------------
/assets/img/frash_fruits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/frash_fruits.png
--------------------------------------------------------------------------------
/assets/img/ginger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/ginger.png
--------------------------------------------------------------------------------
/assets/img/google_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/google_logo.png
--------------------------------------------------------------------------------
/assets/img/juice_apple_grape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/juice_apple_grape.png
--------------------------------------------------------------------------------
/assets/img/location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/location.png
--------------------------------------------------------------------------------
/assets/img/logout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/logout.png
--------------------------------------------------------------------------------
/assets/img/master.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/master.png
--------------------------------------------------------------------------------
/assets/img/mayinnars_eggless.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/mayinnars_eggless.png
--------------------------------------------------------------------------------
/assets/img/meat_fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/meat_fish.png
--------------------------------------------------------------------------------
/assets/img/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/next.png
--------------------------------------------------------------------------------
/assets/img/order_accpeted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/order_accpeted.png
--------------------------------------------------------------------------------
/assets/img/order_fail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/order_fail.png
--------------------------------------------------------------------------------
/assets/img/orenge_juice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/orenge_juice.png
--------------------------------------------------------------------------------
/assets/img/paymenth_methods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/paymenth_methods.png
--------------------------------------------------------------------------------
/assets/img/pepsi_can.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/pepsi_can.png
--------------------------------------------------------------------------------
/assets/img/pulses.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/pulses.png
--------------------------------------------------------------------------------
/assets/img/rice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/rice.png
--------------------------------------------------------------------------------
/assets/img/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/search.png
--------------------------------------------------------------------------------
/assets/img/select_location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/select_location.png
--------------------------------------------------------------------------------
/assets/img/share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/share.png
--------------------------------------------------------------------------------
/assets/img/sign_in_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/sign_in_top.png
--------------------------------------------------------------------------------
/assets/img/splash_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/splash_logo.png
--------------------------------------------------------------------------------
/assets/img/sprite_can.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/sprite_can.png
--------------------------------------------------------------------------------
/assets/img/store_tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/store_tab.png
--------------------------------------------------------------------------------
/assets/img/subtack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/subtack.png
--------------------------------------------------------------------------------
/assets/img/t_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/t_close.png
--------------------------------------------------------------------------------
/assets/img/u1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/u1.png
--------------------------------------------------------------------------------
/assets/img/u2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/u2.png
--------------------------------------------------------------------------------
/assets/img/welcom_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/assets/img/welcom_bg.png
--------------------------------------------------------------------------------
/db_design.txt:
--------------------------------------------------------------------------------
1 | 1)User Detail:
2 | user_id
3 | username
4 | name
5 | email
6 | mobile
7 | mobile_code
8 | password
9 | auth_token
10 | device_token
11 | reset_code
12 | status : 1)active, 2) deleted
13 | created_date
14 | modify_date
15 |
16 | 2)Category Detail:
17 | cat_id
18 | cat_name
19 | image
20 | color
21 | status : 1)active, 2) deleted
22 | created_date
23 | modify_date
24 |
25 | 3)Product Brand Detail:
26 | brand_id
27 | brand_name
28 | status : 1)active, 2) deleted
29 | created_date
30 | modify_date
31 |
32 | 4)Type Detail:
33 | type_id
34 | type_name
35 | image
36 | color
37 | status : 1)active, 2) deleted
38 | created_date
39 | modify_date
40 |
41 | 5)Product Detail:
42 | prod_id
43 | cat_id
44 | brand_id
45 | type_id
46 | name
47 | detail
48 | unit_name
49 | unit_value
50 | price
51 | status : 1)active, 2) deleted
52 | created_date
53 | modify_date
54 |
55 | 6)Nutrition Detail:
56 | nutrition_id
57 | prod_id
58 | nutrition_name
59 | nutrition_value
60 | status : 1)active, 2) deleted
61 | created_date
62 | modify_date
63 |
64 | 7)Image Detail:
65 | img_id
66 | prod_id
67 | image
68 | status
69 | created_date
70 | modify_date
71 |
72 | 8)Review Detail:
73 | review_id
74 | prod_id
75 | user_id
76 | rate
77 | message
78 | status
79 | created_date
80 | modify_date
81 |
82 | 9)Favorite Details
83 | fav_id
84 | prod_id
85 | user_id
86 | status
87 | created_date
88 | modify_date
89 |
90 | 10)Cart Detail:
91 | cart_id
92 | user_id
93 | prod_id
94 | qty
95 | status
96 | created_date
97 | modify_date
98 |
99 | 11)Order Detail:
100 | order_id
101 | cart_id
102 | user_id
103 | address_id
104 | total_price
105 | user_pay_price
106 | discount_price
107 | deliver_price
108 | promo_code_id
109 | deliver_type (1: Deliver, 2: Collection)
110 | payment_type (1: COD, 2: Online Card)
111 | payment_status (1: waiting, 2: done, 3: fail, 4: refund)
112 | order_status (1: new, 2: order accept, 3: order delivered, 4: cancel, 5: order declined )
113 | status
114 | created_date
115 | modify_date
116 |
117 | 12)Order Payment Detail:
118 | transaction_id
119 | order_id
120 | transaction_payload
121 | status
122 | created_date
123 | modify_date
124 |
125 | 13)Address Detail:
126 | address_id
127 | name
128 | phone
129 | address
130 | city
131 | state
132 | postal_code
133 | is_default
134 | status
135 | created_date
136 | modify_date
137 |
138 | 14) Offer Detail:
139 | offer_id
140 | prod_id
141 | price
142 | start_date
143 | end_date
144 | status
145 | created_date
146 | modify_date
147 |
148 | 15) PromoCode Detail:
149 | promo_code_id
150 | code
151 | offer_price
152 | start_date
153 | end_date
154 | status
155 | created_date
156 | modify_date
157 |
158 | 16) Notification Details:
159 | notification_id
160 | title
161 | message
162 | notification_type
163 | status
164 | created_date
165 | modify_date
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '12.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | target 'RunnerTests' do
36 | inherit! :search_paths
37 | end
38 | end
39 |
40 | post_install do |installer|
41 | installer.pods_project.targets.each do |target|
42 | flutter_additional_ios_build_settings(target)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_timezone (0.0.1):
4 | - Flutter
5 | - path_provider_foundation (0.0.1):
6 | - Flutter
7 | - FlutterMacOS
8 | - shared_preferences_foundation (0.0.1):
9 | - Flutter
10 | - FlutterMacOS
11 | - sqflite (0.0.3):
12 | - Flutter
13 | - FlutterMacOS
14 |
15 | DEPENDENCIES:
16 | - Flutter (from `Flutter`)
17 | - flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`)
18 | - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
19 | - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
20 | - sqflite (from `.symlinks/plugins/sqflite/darwin`)
21 |
22 | EXTERNAL SOURCES:
23 | Flutter:
24 | :path: Flutter
25 | flutter_timezone:
26 | :path: ".symlinks/plugins/flutter_timezone/ios"
27 | path_provider_foundation:
28 | :path: ".symlinks/plugins/path_provider_foundation/darwin"
29 | shared_preferences_foundation:
30 | :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
31 | sqflite:
32 | :path: ".symlinks/plugins/sqflite/darwin"
33 |
34 | SPEC CHECKSUMS:
35 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
36 | flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb
37 | path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
38 | shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
39 | sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
40 |
41 | PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
42 |
43 | COCOAPODS: 1.15.2
44 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_flutter/e8ba0955c97cde64cb42860b61317222de2874ac/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Online Groceries
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | online_groceries
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CADisableMinimumFrameDurationOnPhone
47 |
48 | UIApplicationSupportsIndirectInputEvents
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/lib/common/color_extension.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class TColor {
4 | static Color get primary => const Color(0xff53B175);
5 | static Color get primaryText => const Color(0xff030303);
6 | static Color get secondaryText => const Color(0xff828282);
7 | static Color get textTittle => const Color(0xff7C7C7C);
8 | static Color get placeholder => const Color(0xffB1B1B1);
9 | static Color get darkGray => const Color(0xff4C4F4D);
10 | }
11 |
12 | extension HexColor on Color {
13 | /// String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#".
14 | static Color fromHex(String hexString) {
15 | final buffer = StringBuffer();
16 | if (hexString.length == 6 || hexString.length == 7) buffer.write('ff');
17 | buffer.write(hexString.replaceFirst('#', ''));
18 | return Color(int.parse(buffer.toString(), radix: 16));
19 | }
20 |
21 | /// Prefixes a hash sign if [leadingHashSign] is set to `true` (default is `true`).
22 | String toHex({bool leadingHashSign = true}) => '${leadingHashSign ? '#' : ''}'
23 | '${alpha.toRadixString(16).padLeft(2, '0')}'
24 | '${red.toRadixString(16).padLeft(2, '0')}'
25 | '${green.toRadixString(16).padLeft(2, '0')}'
26 | '${blue.toRadixString(16).padLeft(2, '0')}';
27 | }
28 |
--------------------------------------------------------------------------------
/lib/common/extension.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | extension StateExtension on State {
5 | void mdShowAlert(String title, String message, VoidCallback onPressed,
6 | {String buttonTitle = "Ok",
7 | TextAlign messageTextAlign = TextAlign.center}) {
8 | showDialog(
9 | context: context,
10 | builder: (context) => CupertinoAlertDialog(
11 | title: Text(title),
12 | content: Text(
13 | message,
14 | textAlign: messageTextAlign,
15 | ),
16 | actions: [
17 | CupertinoDialogAction(
18 | isDefaultAction: true,
19 | child: Text(buttonTitle),
20 | onPressed: () {
21 | Navigator.pop(context);
22 | onPressed();
23 | },
24 | )
25 | ],
26 | ),
27 | );
28 | }
29 |
30 | void endEditing() {
31 | FocusScope.of(context).requestFocus(FocusNode());
32 | }
33 | }
34 |
35 | extension StringExtension on String {
36 | bool get isEmail {
37 | return RegExp(
38 | r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
39 | .hasMatch(this);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/common/my_http_overrides.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | class MyHttpOverrides extends HttpOverrides {
4 | @override
5 | HttpClient createHttpClient(SecurityContext? context) {
6 | return super.createHttpClient(context)
7 | ..badCertificateCallback =
8 | (X509Certificate cert, String host, int port) => true;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/lib/common/service_call.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:flutter/foundation.dart';
4 | import 'package:get/get.dart';
5 | import 'package:http/http.dart' as http;
6 | import 'package:online_groceries/view_model/splash_view_model.dart';
7 |
8 | typedef ResSuccess = Future Function(Map);
9 | typedef ResFailure = Future Function(dynamic);
10 |
11 | class ServiceCall {
12 |
13 |
14 | static void post(Map parameter, String path,
15 | {bool isToken = false, ResSuccess? withSuccess, ResFailure? failure}) {
16 | Future(() {
17 | try {
18 | var headers = {'Content-Type': 'application/x-www-form-urlencoded'};
19 |
20 | if(isToken) {
21 | var token = Get.find().userPayload.value.authToken;
22 | headers["access_token"] = token ?? "";
23 | }
24 |
25 | http
26 | .post(Uri.parse(path), body: parameter, headers: headers)
27 | .then((value) {
28 | if (kDebugMode) {
29 | print(value.body);
30 | }
31 | try {
32 | var jsonObj =
33 | json.decode(value.body) as Map? ?? {};
34 |
35 | if (withSuccess != null) withSuccess(jsonObj);
36 | } catch (err) {
37 | if (failure != null) failure(err.toString());
38 | }
39 | }).catchError((e) {
40 | if (failure != null) failure(e.toString());
41 | });
42 | } catch (err) {
43 | if (failure != null) failure(err.toString());
44 | }
45 | });
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/common_widget/account_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class AccountRow extends StatelessWidget {
6 | final String title;
7 | final String icon;
8 | final VoidCallback onPressed;
9 |
10 | const AccountRow(
11 | {super.key,
12 | required this.title,
13 | required this.icon,
14 | required this.onPressed});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Column(
19 | mainAxisSize: MainAxisSize.min,
20 | children: [
21 | InkWell(
22 | onTap: onPressed,
23 | child: Padding(
24 | padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
25 | child: Row(
26 | children: [
27 | Image.asset(
28 | icon,
29 | width: 20,
30 | height: 20,
31 | ),
32 | const SizedBox(
33 | width: 15,
34 | ),
35 | Expanded(
36 | child: Text(
37 | title,
38 | textAlign: TextAlign.left,
39 | style: TextStyle(
40 | color: TColor.primaryText,
41 | fontSize: 18,
42 | fontWeight: FontWeight.w600),
43 | ),
44 | ),
45 | const SizedBox(
46 | width: 15,
47 | ),
48 | Image.asset(
49 | "assets/img/next.png",
50 | height: 15,
51 | color: TColor.primaryText,
52 | ),
53 | ],
54 | ),
55 | ),
56 | ),
57 | const Divider(
58 | color: Colors.black26,
59 | height: 1,
60 | ),
61 | ],
62 | );
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/lib/common_widget/category_cell.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:online_groceries/common/color_extension.dart';
4 |
5 | import '../model/type_model.dart';
6 |
7 | class CategoryCell extends StatelessWidget {
8 | final TypeModel pObj;
9 | final VoidCallback onPressed;
10 |
11 | const CategoryCell(
12 | {super.key,
13 | required this.pObj,
14 | required this.onPressed});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return InkWell(
19 | onTap: onPressed,
20 | child: Container(
21 | width: 250,
22 | margin: const EdgeInsets.symmetric(horizontal: 8),
23 | padding: const EdgeInsets.all(15),
24 | decoration: BoxDecoration(
25 | color:( pObj.color ?? TColor.primary).withOpacity(0.3) ,
26 |
27 | borderRadius: BorderRadius.circular(15),
28 | ),
29 | child: Column(
30 | mainAxisAlignment: MainAxisAlignment.center,
31 | crossAxisAlignment: CrossAxisAlignment.start,
32 | children: [
33 | Row(
34 | mainAxisAlignment: MainAxisAlignment.center,
35 | children: [
36 |
37 |
38 | CachedNetworkImage(
39 | imageUrl: pObj.image ?? "",
40 | placeholder: (context, url) =>
41 | const Center(
42 | child: CircularProgressIndicator(),
43 | ),
44 | errorWidget: (context, url, error) => const Icon(Icons.error),
45 | width: 70,
46 | height: 70,
47 | fit: BoxFit.contain,
48 | ),
49 |
50 |
51 |
52 | const SizedBox(
53 | height: 15,
54 | ),
55 |
56 | Expanded(
57 | child: Text(
58 | pObj.typeName ?? "",
59 | style: TextStyle(
60 | color: TColor.primaryText,
61 | fontSize: 16,
62 | fontWeight: FontWeight.w700),
63 | ),
64 | ),
65 | ],
66 | ),
67 |
68 | ],
69 | ),
70 | ),
71 | );
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/common_widget/checkout_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class CheckoutRow extends StatelessWidget {
6 | final String title;
7 | final String value;
8 | final VoidCallback onPressed;
9 |
10 | const CheckoutRow({super.key, required this.title, required this.value, required this.onPressed});
11 |
12 | @override
13 | Widget build(BuildContext context) {
14 | return Column(
15 | mainAxisSize: MainAxisSize.min,
16 | children: [
17 | InkWell(
18 | onTap: onPressed,
19 | child: Padding(
20 | padding: const EdgeInsets.symmetric(vertical: 15),
21 | child: Row(
22 | children: [
23 | Text(
24 | title,
25 | style: TextStyle(
26 | color: TColor.secondaryText,
27 | fontSize: 18,
28 | fontWeight: FontWeight.w600),
29 | ),
30 | Expanded(
31 | child: Text(
32 | value,
33 | textAlign: TextAlign.end,
34 | style: TextStyle(
35 | color: TColor.primaryText,
36 | fontSize: 16,
37 | fontWeight: FontWeight.w600),
38 | ),
39 | ),
40 |
41 | const SizedBox(width: 15,),
42 | Image.asset(
43 | "assets/img/next.png",
44 | height: 15,
45 | color: TColor.primaryText,
46 | ),
47 | ],
48 | ),
49 | ),
50 | ),
51 | const Divider(
52 | color: Colors.black26,
53 | height: 1,
54 | ),
55 | ],
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/common_widget/dropdown.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class Dropdown extends StatelessWidget {
6 | final String title;
7 | final String placeholder;
8 | final List valueList;
9 | final Object? selectValue;
10 | final Function(Object?) didChange;
11 | const Dropdown(
12 | {super.key,
13 | required this.title,
14 | required this.placeholder,
15 | required this.valueList,
16 | this.selectValue,
17 | required this.didChange});
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | mainAxisSize: MainAxisSize.min,
24 | children: [
25 | Text(
26 | title,
27 | style: TextStyle(
28 | color: TColor.textTittle,
29 | fontSize: 16,
30 | fontWeight: FontWeight.w600),
31 | ),
32 | SizedBox(
33 | height: 55,
34 | child: DropdownButtonHideUnderline(
35 | child: DropdownButton(
36 | onChanged: didChange,
37 | icon: Icon(
38 | Icons.expand_more,
39 | color: TColor.textTittle,
40 | ),
41 | value: selectValue,
42 | hint: Text(
43 | placeholder,
44 | style: TextStyle(
45 | color: TColor.placeholder,
46 | fontSize: 16,
47 | fontWeight: FontWeight.w600),
48 | ),
49 | isExpanded: true,
50 | items: valueList.map((obj) {
51 | return DropdownMenuItem(
52 | value: obj,
53 | child: Text(
54 | obj.toString(),
55 | style: TextStyle(
56 | color: TColor.primaryText,
57 | fontSize: 16,
58 | fontWeight: FontWeight.w600),
59 | ));
60 | }).toList()),
61 | ),
62 | ),
63 | Container(
64 | width: double.maxFinite,
65 | height: 1,
66 | color: const Color(0xffE2E2E2),
67 | )
68 | ],
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/common_widget/explore_cell.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:online_groceries/common/color_extension.dart';
4 |
5 | import '../model/explore_category_model.dart';
6 |
7 | class ExploreCell extends StatelessWidget {
8 | final ExploreCategoryModel pObj;
9 | final VoidCallback onPressed;
10 |
11 | const ExploreCell({super.key, required this.pObj, required this.onPressed});
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 |
16 | return InkWell(
17 | onTap: onPressed,
18 | borderRadius: BorderRadius.circular(15),
19 | child: Container(
20 |
21 |
22 | padding: const EdgeInsets.all(15),
23 | decoration: BoxDecoration(
24 | border: Border.all(color: pObj.color ?? TColor.primary , width: 1 ),
25 | color: (pObj.color ?? TColor.primary).withOpacity(0.25),
26 | borderRadius: BorderRadius.circular(15),
27 | ),
28 | child: Column(
29 | mainAxisAlignment: MainAxisAlignment.center,
30 | crossAxisAlignment: CrossAxisAlignment.center,
31 | children: [
32 | Row(
33 | mainAxisAlignment: MainAxisAlignment.center,
34 | children: [
35 | CachedNetworkImage(
36 | imageUrl: pObj.image ?? "",
37 | placeholder: (context, url) => const Center(
38 | child: CircularProgressIndicator(),
39 | ),
40 | errorWidget: (context, url, error) => const Icon(Icons.error),
41 | width: 120,
42 | height: 90,
43 | fit: BoxFit.contain,
44 | ),
45 |
46 |
47 |
48 | ],
49 | ),
50 |
51 | const Spacer(),
52 |
53 | Text(
54 | pObj.catName ?? "",
55 | textAlign: TextAlign.center,
56 | style: TextStyle(
57 | color: TColor.primaryText,
58 | fontSize: 16,
59 | fontWeight: FontWeight.w700),
60 | ),
61 |
62 | const Spacer(),
63 | ],
64 | ),
65 | ),
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/lib/common_widget/favourite_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:online_groceries/model/offer_product_model.dart';
4 |
5 | import '../common/color_extension.dart';
6 |
7 | class FavoriteRow extends StatelessWidget {
8 | final OfferProductModel pObj;
9 | final VoidCallback onPressed;
10 |
11 | const FavoriteRow(
12 | {super.key,
13 | required this.pObj,
14 | required this.onPressed});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Column(
19 | mainAxisSize: MainAxisSize.min,
20 | children: [
21 | InkWell(
22 | onTap: onPressed,
23 | child: Padding(
24 | padding: const EdgeInsets.symmetric(vertical: 10),
25 | child: Row(
26 | children: [
27 | CachedNetworkImage(
28 | imageUrl: pObj.image ?? "",
29 | placeholder: (context, url) => const Center(
30 | child: CircularProgressIndicator(),
31 | ),
32 | errorWidget: (context, url, error) => const Icon(Icons.error),
33 | width: 60,
34 | height: 60,
35 | fit: BoxFit.contain,
36 | ),
37 |
38 | const SizedBox(
39 | width: 15,
40 | ),
41 |
42 | Expanded(
43 | child: Column(
44 | crossAxisAlignment: CrossAxisAlignment.start,
45 | children: [
46 |
47 | Text(
48 | pObj.name ?? "",
49 | style: TextStyle(
50 | color: TColor.primaryText,
51 | fontSize: 16,
52 | fontWeight: FontWeight.w700),
53 | ),
54 |
55 | const SizedBox(
56 | height: 2,
57 | ),
58 | Text(
59 | "${pObj.unitValue}${pObj.unitName}",
60 | style: TextStyle(
61 | color: TColor.secondaryText,
62 | fontSize: 14,
63 | fontWeight: FontWeight.w500),
64 | ),
65 |
66 | ],) ,
67 | ),
68 | const SizedBox(
69 | width: 8,
70 | ),
71 |
72 | Text(
73 | "\$${pObj.offerPrice ?? pObj.price}",
74 | style: TextStyle(
75 | color: TColor.primaryText,
76 | fontSize: 18,
77 | fontWeight: FontWeight.w600),
78 | ),
79 |
80 | const SizedBox(
81 | width: 15,
82 | ),
83 | Image.asset(
84 | "assets/img/next.png",
85 | height: 15,
86 | color: TColor.primaryText,
87 | ),
88 | ],
89 | ),
90 | ),
91 | ),
92 | const Divider(
93 | color: Colors.black26,
94 | height: 1,
95 | ),
96 | ],
97 | );
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/lib/common_widget/filter_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class FilterRow extends StatelessWidget {
6 | final Map fObj;
7 | final bool isSelect;
8 | final VoidCallback onPressed;
9 | const FilterRow(
10 | {super.key,
11 | required this.fObj,
12 | required this.isSelect,
13 | required this.onPressed});
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return InkWell(
18 | onTap: onPressed,
19 | child: Container(
20 | padding: const EdgeInsets.symmetric(vertical: 10),
21 | child: Row(children: [
22 | Image.asset(
23 | isSelect ? "assets/img/checkbox_check.png" : "assets/img/checkbox.png",
24 | width: 25,
25 | height: 25,
26 | ),
27 | const SizedBox(
28 | width: 15,
29 | ),
30 | Expanded(
31 | child: Text(
32 | fObj["name"],
33 | style: TextStyle(
34 | color: isSelect ? TColor.primary : TColor.primaryText,
35 | fontSize: 16,
36 | fontWeight: FontWeight.w500),
37 | ),
38 | ),
39 | ]),
40 | ),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/common_widget/line_textfield.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class LineTextField extends StatelessWidget {
6 | final TextEditingController controller;
7 | final String title;
8 | final String placeholder;
9 | final TextInputType? keyboardType;
10 | final bool obscureText;
11 | final Widget? right;
12 |
13 | const LineTextField({super.key, required this.title, required this.placeholder, required this.controller, this.right, this.keyboardType, this.obscureText = false });
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return Column(
18 | crossAxisAlignment: CrossAxisAlignment.start,
19 | mainAxisSize: MainAxisSize.min,
20 | children: [
21 | Text(
22 | title,
23 | style: TextStyle(
24 | color: TColor.textTittle,
25 | fontSize: 16,
26 | fontWeight: FontWeight.w600),
27 | ),
28 | TextField(
29 | controller: controller,
30 | keyboardType: keyboardType,
31 | obscureText: obscureText,
32 | decoration: InputDecoration(
33 | suffixIcon: right,
34 | border: InputBorder.none,
35 | enabledBorder: InputBorder.none,
36 | focusedBorder: InputBorder.none,
37 | hintText: placeholder,
38 | hintStyle: TextStyle(color: TColor.placeholder, fontSize: 17),
39 | ),
40 | ),
41 | Container(
42 | width: double.maxFinite,
43 | height: 1,
44 | color: const Color(0xffE2E2E2),
45 | )
46 | ],
47 | );
48 | }
49 | }
--------------------------------------------------------------------------------
/lib/common_widget/notification_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 | import '../model/notification_model.dart';
5 |
6 | class NotificationRow extends StatelessWidget {
7 | final NotificationModel nObj;
8 | final VoidCallback onTap;
9 | const NotificationRow({super.key, required this.nObj, required this.onTap});
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return InkWell(
14 | onTap: onTap,
15 | child: Container(
16 | margin: const EdgeInsets.symmetric(vertical: 8),
17 | decoration: BoxDecoration(
18 | color: nObj.isRead == 1 ? TColor.placeholder : Colors.white,
19 | borderRadius: BorderRadius.circular(5),
20 | boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 2)]),
21 | padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
22 | child: Row(
23 | children: [
24 | Expanded(
25 | child: Column(
26 | crossAxisAlignment: CrossAxisAlignment.start,
27 | children: [
28 | Row(
29 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
30 | children: [
31 | Text(
32 | nObj.title ?? "",
33 | textAlign: TextAlign.left,
34 | style: TextStyle(
35 | color: TColor.primaryText,
36 | fontSize: 14,
37 | fontWeight: FontWeight.w700),
38 | ),
39 |
40 | Text(
41 | nObj.createdDate ?? "",
42 | textAlign: TextAlign.left,
43 | style: TextStyle(
44 | color: TColor.secondaryText, fontSize: 12),
45 | ),
46 | ],
47 | ),
48 |
49 | const SizedBox(
50 | height: 4,
51 | ),
52 | Text(
53 | nObj.message ?? "",
54 | textAlign: TextAlign.left,
55 | style: TextStyle(
56 | color: TColor.primaryText,
57 | fontSize: 14,
58 | fontWeight: FontWeight.w500),
59 | )
60 |
61 | ],
62 | ),
63 | ),
64 |
65 |
66 | ],
67 | ),
68 | ),
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/common_widget/payment_method_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/view_model/payment_view_model.dart';
4 |
5 | import '../common/color_extension.dart';
6 | import '../model/payment_model.dart';
7 |
8 | class PaymentMethodRow extends StatelessWidget {
9 | final PaymentModel pObj;
10 | final VoidCallback didUpdateDone;
11 | final VoidCallback onTap;
12 | const PaymentMethodRow(
13 | {super.key, required this.pObj, required this.didUpdateDone, required this.onTap});
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return InkWell(
18 | onTap: onTap,
19 | child: Container(
20 | margin: const EdgeInsets.symmetric(vertical: 8),
21 | decoration: BoxDecoration(
22 | color: Colors.white,
23 | borderRadius: BorderRadius.circular(5),
24 | boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 2)]),
25 | padding: const EdgeInsets.symmetric(vertical: 15),
26 | child: Row(
27 | children: [
28 |
29 | Padding(
30 | padding: const EdgeInsets.symmetric(horizontal: 15),
31 | child: Image.asset(
32 | "assets/img/paymenth_methods.png",
33 | width: 30,
34 | height: 30,
35 | ),
36 | ),
37 |
38 | Expanded(
39 | child: Padding(
40 | padding: const EdgeInsets.only(left: 15),
41 | child: Column(
42 | crossAxisAlignment: CrossAxisAlignment.start,
43 | children: [
44 | Text(
45 | pObj.name ?? "",
46 | textAlign: TextAlign.left,
47 | style: TextStyle(
48 | color: TColor.primaryText,
49 | fontSize: 18,
50 | fontWeight: FontWeight.w700),
51 | ),
52 |
53 | const SizedBox(
54 | height: 4,
55 | ),
56 |
57 | Text(
58 | "**** **** **** ${pObj.cardNumber ?? ""}",
59 | textAlign: TextAlign.left,
60 | style: TextStyle(
61 | color: TColor.primary,
62 | fontSize: 15,
63 | fontWeight: FontWeight.w500),
64 | ),
65 |
66 |
67 | ],
68 | ),
69 | ),
70 | ),
71 | IconButton(
72 | onPressed: () {
73 | Get.find().serviceCallRemove(pObj);
74 | },
75 | icon: Image.asset(
76 | "assets/img/close.png",
77 | width: 15,
78 | height: 15,
79 | )),
80 | ],
81 | ),
82 | ),
83 | );
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/lib/common_widget/popup_layout.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 |
6 | class PopupLayout extends ModalRoute {
7 | EdgeInsets? margin;
8 | Color? bgColor;
9 | final Widget child;
10 |
11 | PopupLayout({Key? key, this.bgColor, required this.child, this.margin});
12 |
13 | @override
14 | // TODO: implement barrierColor
15 | Color? get barrierColor => bgColor ?? Colors.black.withOpacity(0.5);
16 |
17 | @override
18 | // TODO: implement barrierDismissible
19 | bool get barrierDismissible => false;
20 |
21 | @override
22 | // TODO: implement barrierLabel
23 | String? get barrierLabel => null;
24 |
25 | @override
26 | Widget buildPage(BuildContext context, Animation animation,
27 | Animation secondaryAnimation) {
28 | margin ??= const EdgeInsets.all(0);
29 |
30 | return GestureDetector(
31 | onTap: () {
32 | SystemChannels.textInput.invokeMethod("TextInput.hide");
33 | },
34 | child: Material(
35 | type: MaterialType.transparency,
36 | child: BackdropFilter(
37 | filter: ImageFilter.blur(
38 | sigmaX: 5,
39 | sigmaY: 5,
40 | ),
41 | child: buildOverlayContent(context),
42 | ),
43 | ),
44 | );
45 | }
46 |
47 | @override
48 | // TODO: implement maintainState
49 | bool get maintainState => false;
50 |
51 | @override
52 | // TODO: implement opaque
53 | bool get opaque => false;
54 |
55 | @override
56 | // TODO: implement transitionDuration
57 | Duration get transitionDuration => const Duration(milliseconds: 100);
58 |
59 | Widget buildOverlayContent(BuildContext context) {
60 | return Container(
61 | margin: margin,
62 | alignment: Alignment.center,
63 | child: child,
64 | );
65 | }
66 |
67 | @override
68 | Widget buildTransitions(BuildContext context, Animation animation,
69 | Animation secondaryAnimation, Widget child) {
70 | // You can add your own animations for the overlay content
71 | return FadeTransition(
72 | opacity: animation,
73 | child: ScaleTransition(
74 | scale: animation,
75 | child: child,
76 | ),
77 | );
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/lib/common_widget/promo_code_row.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 | import '../model/promo_code_model.dart';
5 |
6 | class PromoCodeRow extends StatelessWidget {
7 | final PromoCodeModel pObj;
8 | final VoidCallback onTap;
9 | const PromoCodeRow({super.key, required this.pObj, required this.onTap });
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return InkWell(
14 | onTap: onTap,
15 | child: Container(
16 | margin: const EdgeInsets.symmetric(vertical: 8),
17 | decoration: BoxDecoration(
18 | color: Colors.white,
19 | borderRadius: BorderRadius.circular(5),
20 | boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 2)]),
21 | padding: const EdgeInsets.symmetric(vertical: 15),
22 | child: Row(
23 | children: [
24 | Expanded(
25 | child: Padding(
26 | padding: const EdgeInsets.symmetric(horizontal: 15),
27 | child: Column(
28 | crossAxisAlignment: CrossAxisAlignment.start,
29 | children: [
30 | Row(
31 | children: [
32 | Expanded(
33 | child: Text(
34 | pObj.title ?? "",
35 | style: TextStyle(
36 | color: TColor.primaryText,
37 | fontSize: 14,
38 | fontWeight: FontWeight.w700),
39 | ),
40 | ),
41 | Container(
42 | padding: const EdgeInsets.symmetric(
43 | horizontal: 8, vertical: 4),
44 | decoration: BoxDecoration(
45 | color: TColor.secondaryText.withOpacity(0.2),
46 | borderRadius: BorderRadius.circular(5)),
47 | child: Text(
48 | pObj.code ?? "",
49 | style: TextStyle(
50 | color: TColor.primary,
51 | fontSize: 15,
52 | fontWeight: FontWeight.w700),
53 | ),
54 | )
55 | ],
56 | ),
57 | const SizedBox(
58 | height: 8,
59 | ),
60 | Text(
61 | pObj.description ?? "",
62 | style: TextStyle(
63 | color: TColor.secondaryText,
64 | fontSize: 14,
65 | fontWeight: FontWeight.w500),
66 | ),
67 |
68 | const SizedBox(
69 | height: 4,
70 | ),
71 |
72 | Row(
73 | children: [
74 | Text(
75 | "Expiry Date:",
76 | style: TextStyle(
77 | color: TColor.primary,
78 | fontSize: 14,
79 | fontWeight: FontWeight.w700),
80 | ),
81 |
82 | const SizedBox(width: 8,),
83 | Text(
84 | pObj.endDate ?? "",
85 | style: TextStyle(
86 | color: TColor.secondaryText,
87 | fontSize: 12,
88 | fontWeight: FontWeight.w500),
89 | ),
90 | ],
91 | )
92 |
93 | ],
94 | ),
95 | ),
96 | ),
97 |
98 | ],
99 | ),
100 | ),
101 | );
102 | }
103 | }
--------------------------------------------------------------------------------
/lib/common_widget/round_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class RoundButton extends StatelessWidget {
6 | final String title;
7 | final Color? bgColor;
8 | final VoidCallback onPressed;
9 | const RoundButton({super.key, required this.title, this.bgColor , required this.onPressed});
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialButton(
14 | onPressed: onPressed,
15 | height: 60,
16 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(19)),
17 | minWidth: double.maxFinite,
18 | elevation: 0.1,
19 | color: bgColor ?? TColor.primary,
20 | child: Text(
21 | title,
22 | style: const TextStyle(
23 | color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600),
24 | ),
25 | );
26 | }
27 | }
28 |
29 | class RoundIconButton extends StatelessWidget {
30 | final String title;
31 | final String icon;
32 | final Color bgColor;
33 | final VoidCallback onPressed;
34 | const RoundIconButton(
35 | {super.key,
36 | required this.title,
37 | required this.icon,
38 | required this.bgColor,
39 | required this.onPressed});
40 |
41 | @override
42 | Widget build(BuildContext context) {
43 | return MaterialButton(
44 | onPressed: onPressed,
45 | height: 60,
46 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(19)),
47 | minWidth: double.maxFinite,
48 | elevation: 0.1,
49 | color: bgColor,
50 | child: Row(
51 | children: [
52 |
53 | Image.asset(icon, width: 20, height: 20 , fit: BoxFit.contain, ),
54 |
55 | const SizedBox(width: 30,),
56 |
57 | Text(
58 | title,
59 | style: const TextStyle(
60 | color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600),
61 | ),
62 | ],
63 | ),
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/common_widget/section_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class SectionView extends StatelessWidget {
6 | final String title;
7 | final bool isShowSeeAllButton;
8 | final VoidCallback onPressed;
9 | final EdgeInsets? padding;
10 |
11 | const SectionView(
12 | {super.key,
13 | required this.title,
14 | this.isShowSeeAllButton = true,
15 | this.padding,
16 | required this.onPressed});
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return Container(
21 | padding: padding,
22 | child: Row(
23 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
24 | children: [
25 | Text(
26 | title,
27 | style: TextStyle(
28 | color: TColor.primaryText,
29 | fontSize: 24,
30 | fontWeight: FontWeight.w600),
31 | ),
32 | TextButton(
33 | onPressed: onPressed,
34 | child: Text(
35 | "See All",
36 | style: TextStyle(
37 | color: TColor.primary,
38 | fontSize: 16,
39 | fontWeight: FontWeight.w600),
40 | ),
41 | )
42 | ],
43 | ),
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_easyloading/flutter_easyloading.dart';
5 | import 'package:get/get.dart';
6 | import 'package:online_groceries/view/main_tabview/main_tabview.dart';
7 | import 'package:online_groceries/view/splash_view.dart';
8 | import 'package:shared_preferences/shared_preferences.dart';
9 |
10 | import 'common/color_extension.dart';
11 | import 'common/my_http_overrides.dart';
12 |
13 | SharedPreferences? prefs;
14 | void main() async {
15 | HttpOverrides.global = MyHttpOverrides();
16 | WidgetsFlutterBinding.ensureInitialized();
17 | prefs = await SharedPreferences.getInstance();
18 | runApp(const MyApp());
19 | }
20 |
21 | void configLoading() {
22 | EasyLoading.instance
23 | ..indicatorType = EasyLoadingIndicatorType.ring
24 | ..loadingStyle = EasyLoadingStyle.custom
25 | ..indicatorSize = 45.0
26 | ..radius = 5.0
27 | ..progressColor = TColor.primaryText
28 | ..backgroundColor = TColor.primary
29 | ..indicatorColor = Colors.yellow
30 | ..textColor = TColor.primaryText
31 | ..userInteractions = false
32 | ..dismissOnTap = false;
33 | }
34 |
35 | class MyApp extends StatelessWidget {
36 | const MyApp({super.key});
37 |
38 | // This widget is the root of your application.
39 | @override
40 | Widget build(BuildContext context) {
41 | return GetMaterialApp(
42 | title: 'Online Groceries',
43 | debugShowCheckedModeBanner: false,
44 | theme: ThemeData(
45 | fontFamily: "Gilroy",
46 | colorScheme: ColorScheme.fromSeed(seedColor: TColor.primary),
47 | useMaterial3: false,
48 | ),
49 | home: const SplashView(),
50 | builder: (context, child) {
51 | return FlutterEasyLoading(child: child);
52 | },
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/model/address_model.dart:
--------------------------------------------------------------------------------
1 | class AddressModel {
2 | int? addressId;
3 | String? name;
4 | String? phone;
5 | String? address;
6 | String? city;
7 | String? state;
8 | String? typeName;
9 | String? postalCode;
10 | int? isDefault;
11 |
12 | AddressModel(
13 | {this.addressId,
14 | this.name,
15 | this.phone,
16 | this.address,
17 | this.city,
18 | this.state,
19 | this.typeName,
20 | this.postalCode,
21 | this.isDefault});
22 |
23 | AddressModel.fromJson(Map json) {
24 | addressId = json['address_id'];
25 | name = json['name'];
26 | phone = json['phone'];
27 | address = json['address'];
28 | city = json['city'];
29 | state = json['state'];
30 | typeName = json['type_name'];
31 | postalCode = json['postal_code'];
32 | isDefault = json['is_default'];
33 | }
34 |
35 | Map toJson() {
36 | final Map data = {};
37 | data['address_id'] = addressId;
38 | data['name'] = name;
39 | data['phone'] = phone;
40 | data['address'] = address;
41 | data['city'] = city;
42 | data['state'] = state;
43 | data['type_name'] = typeName;
44 | data['postal_code'] = postalCode;
45 | data['is_default'] = isDefault;
46 | return data;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/model/cart_item_model.dart:
--------------------------------------------------------------------------------
1 | class CartItemModel {
2 | int? cartId;
3 | int? userId;
4 | int? prodId;
5 | int? qty;
6 | int? catId;
7 | int? brandId;
8 | int? typeId;
9 | String? name;
10 | String? detail;
11 | String? unitName;
12 | String? unitValue;
13 | String? nutritionWeight;
14 | double? price;
15 | String? createdDate;
16 | String? modifyDate;
17 | String? catName;
18 | int? isFav;
19 | String? brandName;
20 | String? typeName;
21 | double? offerPrice;
22 | String? startDate;
23 | String? endDate;
24 | int? isOfferActive;
25 | String? image;
26 | double? itemPrice;
27 | double? totalPrice;
28 |
29 | CartItemModel(
30 | {this.cartId,
31 | this.userId,
32 | this.prodId,
33 | this.qty,
34 | this.catId,
35 | this.brandId,
36 | this.typeId,
37 | this.name,
38 | this.detail,
39 | this.unitName,
40 | this.unitValue,
41 | this.nutritionWeight,
42 | this.price,
43 | this.createdDate,
44 | this.modifyDate,
45 | this.catName,
46 | this.isFav,
47 | this.brandName,
48 | this.typeName,
49 | this.offerPrice,
50 | this.startDate,
51 | this.endDate,
52 | this.isOfferActive,
53 | this.image,
54 | this.itemPrice,
55 | this.totalPrice});
56 |
57 | CartItemModel.fromJson(Map json) {
58 | cartId = json['cart_id'];
59 | userId = json['user_id'];
60 | prodId = json['prod_id'];
61 | qty = json['qty'];
62 | catId = json['cat_id'];
63 | brandId = json['brand_id'];
64 | typeId = json['type_id'];
65 | name = json['name'];
66 | detail = json['detail'];
67 | unitName = json['unit_name'];
68 | unitValue = json['unit_value'];
69 | nutritionWeight = json['nutrition_weight'];
70 | price = json['price'];
71 | createdDate = json['created_date'];
72 | modifyDate = json['modify_date'];
73 | catName = json['cat_name'];
74 | isFav = json['is_fav'];
75 | brandName = json['brand_name'];
76 | typeName = json['type_name'];
77 | offerPrice = json['offer_price'];
78 | startDate = json['start_date'];
79 | endDate = json['end_date'];
80 | isOfferActive = json['is_offer_active'];
81 | image = json['image'];
82 | itemPrice = json['item_price'];
83 | totalPrice = json['total_price'];
84 | }
85 |
86 | Map toJson() {
87 | final Map data = {};
88 | data['cart_id'] = cartId;
89 | data['user_id'] = userId;
90 | data['prod_id'] = prodId;
91 | data['qty'] = qty;
92 | data['cat_id'] = catId;
93 | data['brand_id'] = brandId;
94 | data['type_id'] = typeId;
95 | data['name'] = name;
96 | data['detail'] = detail;
97 | data['unit_name'] = unitName;
98 | data['unit_value'] = unitValue;
99 | data['nutrition_weight'] = nutritionWeight;
100 | data['price'] = price;
101 | data['created_date'] = createdDate;
102 | data['modify_date'] = modifyDate;
103 | data['cat_name'] = catName;
104 | data['is_fav'] = isFav;
105 | data['brand_name'] = brandName;
106 | data['type_name'] = typeName;
107 | data['offer_price'] = offerPrice;
108 | data['start_date'] = startDate;
109 | data['end_date'] = endDate;
110 | data['is_offer_active'] = isOfferActive;
111 | data['image'] = image;
112 | data['item_price'] = itemPrice;
113 | data['total_price'] = totalPrice;
114 | return data;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/lib/model/explore_category_model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class ExploreCategoryModel {
6 | int? catId;
7 | String? catName;
8 | String? image;
9 | Color? color;
10 |
11 | ExploreCategoryModel({this.catId, this.catName, this.image, this.color});
12 |
13 | ExploreCategoryModel.fromJson(Map json) {
14 | catId = json['cat_id'];
15 | catName = json['cat_name'];
16 | image = json['image'];
17 | color = HexColor.fromHex(json['color'].toString());
18 | }
19 |
20 | Map toJson() {
21 | final Map data = {};
22 | data['cat_id'] = catId;
23 | data['cat_name'] = catName;
24 | data['image'] = image;
25 | data['color'] = color?.toHex();
26 | return data;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/model/image_model.dart:
--------------------------------------------------------------------------------
1 | class ImageModel {
2 | int? imgId;
3 | int? prodId;
4 | String? image;
5 |
6 | ImageModel({this.imgId, this.prodId, this.image});
7 |
8 | ImageModel.fromJson(Map json) {
9 | imgId = json['img_id'];
10 | prodId = json['prod_id'];
11 | image = json['image'];
12 | }
13 |
14 | Map toJson() {
15 | final Map data = {};
16 | data['img_id'] = imgId;
17 | data['prod_id'] = prodId;
18 | data['image'] = image;
19 | return data;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/lib/model/my_order_model.dart:
--------------------------------------------------------------------------------
1 | class MyOrderModel {
2 | int? orderId;
3 | String? cartId;
4 | double? totalPrice;
5 | double? userPayPrice;
6 | double? discountPrice;
7 | double? deliverPrice;
8 | int? deliverType;
9 | int? paymentType;
10 | int? paymentStatus;
11 | int? orderStatus;
12 | int? status;
13 | String? createdDate;
14 | String? names;
15 | String? userName;
16 | String? phone;
17 | String? address;
18 | String? city;
19 | String? state;
20 | String? postalCode;
21 | List? images;
22 |
23 |
24 |
25 |
26 |
27 | MyOrderModel(
28 | {this.orderId,
29 | this.cartId,
30 | this.totalPrice,
31 | this.userPayPrice,
32 | this.discountPrice,
33 | this.deliverPrice,
34 | this.deliverType,
35 | this.paymentType,
36 | this.paymentStatus,
37 | this.orderStatus,
38 | this.status,
39 | this.createdDate,
40 | this.names,
41 | this.images});
42 |
43 | MyOrderModel.fromJson(Map json) {
44 | orderId = json['order_id'];
45 | cartId = json['cart_id'];
46 | totalPrice = double.tryParse("${json['total_price']}");
47 | userPayPrice = double.tryParse("${json['user_pay_price']}");
48 | discountPrice = double.tryParse("${json['discount_price']}");
49 | deliverPrice = double.tryParse("${json['deliver_price']}") ;
50 | deliverType = json['deliver_type'];
51 | paymentType = json['payment_type'];
52 | paymentStatus = json['payment_status'];
53 | orderStatus = json['order_status'];
54 | status = json['status'];
55 | createdDate = json['created_date'];
56 | names = json['names'];
57 | userName = json['user_name'];
58 | phone = json['phone'];
59 | address = json['address'];
60 | city = json['city'];
61 | state = json['state'];
62 | postalCode = json['postal_code'];
63 | images = (json['images'] as String? ?? "" ).split(",") ;
64 | }
65 |
66 | Map toJson() {
67 | final Map data = {};
68 | data['order_id'] = orderId;
69 | data['cart_id'] = cartId;
70 | data['total_price'] = totalPrice;
71 | data['user_pay_price'] = userPayPrice;
72 | data['discount_price'] = discountPrice;
73 | data['deliver_price'] = deliverPrice;
74 | data['deliver_type'] = deliverType;
75 | data['payment_type'] = paymentType;
76 | data['payment_status'] = paymentStatus;
77 | data['order_status'] = orderStatus;
78 | data['status'] = status;
79 | data['created_date'] = createdDate;
80 | data['names'] = names;
81 | data['user_name'] = userName;
82 | data['phone'] = phone;
83 | data['address'] = address;
84 | data['city'] = city;
85 | data['postal_code'] = postalCode;
86 | data['state'] = state;
87 | data['images'] = images?.join(",") ?? "";
88 | return data;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/lib/model/notification_model.dart:
--------------------------------------------------------------------------------
1 | class NotificationModel {
2 | int? notificationId;
3 | int? refId;
4 | String? title;
5 | String? message;
6 | int? notificationType;
7 | int? isRead;
8 | String? createdDate;
9 |
10 | NotificationModel(
11 | {this.notificationId,
12 | this.refId,
13 | this.title,
14 | this.message,
15 | this.notificationType,
16 | this.isRead,
17 | this.createdDate});
18 |
19 | NotificationModel.fromJson(Map json) {
20 | notificationId = json['notification_id'];
21 | refId = json['ref_id'];
22 | title = json['title'];
23 | message = json['message'];
24 | notificationType = json['notification_type'];
25 | isRead = json['is_read'];
26 | createdDate = json['created_date'];
27 | }
28 |
29 | Map toJson() {
30 | final Map data = {};
31 | data['notification_id'] = notificationId;
32 | data['ref_id'] = refId;
33 | data['title'] = title;
34 | data['message'] = message;
35 | data['notification_type'] = notificationType;
36 | data['is_read'] = isRead;
37 | data['created_date'] = createdDate;
38 | return data;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/model/nutrition_model.dart:
--------------------------------------------------------------------------------
1 | class NutritionModel {
2 | int? nutritionId;
3 | int? prodId;
4 | String? nutritionName;
5 | String? nutritionValue;
6 |
7 | NutritionModel(
8 | {this.nutritionId, this.prodId, this.nutritionName, this.nutritionValue});
9 |
10 | NutritionModel.fromJson(Map json) {
11 | nutritionId = json['nutrition_id'];
12 | prodId = json['prod_id'];
13 | nutritionName = json['nutrition_name'];
14 | nutritionValue = json['nutrition_value'];
15 | }
16 |
17 | Map toJson() {
18 | final Map data = {};
19 | data['nutrition_id'] = nutritionId;
20 | data['prod_id'] = prodId;
21 | data['nutrition_name'] = nutritionName;
22 | data['nutrition_value'] = nutritionValue;
23 | return data;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/lib/model/offer_product_model.dart:
--------------------------------------------------------------------------------
1 | class OfferProductModel {
2 | double? offerPrice;
3 | String? startDate;
4 | String? endDate;
5 | int? prodId;
6 | int? catId;
7 | int? brandId;
8 | int? typeId;
9 | String? name;
10 | String? detail;
11 | String? unitName;
12 | String? unitValue;
13 | String? nutritionWeight;
14 | double? price;
15 | String? image;
16 | String? catName;
17 | String? typeName;
18 | bool? isFav;
19 | double? avgRating;
20 |
21 | OfferProductModel({
22 | this.offerPrice,
23 | this.startDate,
24 | this.endDate,
25 | this.prodId,
26 | this.catId,
27 | this.brandId,
28 | this.typeId,
29 | this.name,
30 | this.detail,
31 | this.unitName,
32 | this.unitValue,
33 | this.nutritionWeight,
34 | this.price,
35 | this.image,
36 | this.catName,
37 | this.typeName,
38 | this.isFav,
39 | this.avgRating,
40 | });
41 |
42 | OfferProductModel.fromJson(Map json) {
43 | offerPrice = json['offer_price'];
44 | startDate = json['start_date'];
45 | endDate = json['end_date'];
46 | prodId = json['prod_id'];
47 | catId = json['cat_id'];
48 | brandId = json['brand_id'];
49 | typeId = json['type_id'];
50 | name = json['name'];
51 | detail = json['detail'];
52 | unitName = json['unit_name'];
53 | unitValue = json['unit_value'];
54 | nutritionWeight = json['nutrition_weight'];
55 | price = json['price'];
56 | image = json['image'];
57 | catName = json['cat_name'];
58 | typeName = json['type_name'];
59 | isFav = (json['is_fav'] as int? ?? 0) == 1;
60 | avgRating = double.tryParse(json['avg_rating'].toString()) ?? 0.0;
61 | }
62 |
63 | Map toJson() {
64 | final Map data = {};
65 | data['offer_price'] = offerPrice;
66 | data['start_date'] = startDate;
67 | data['end_date'] = endDate;
68 | data['prod_id'] = prodId;
69 | data['cat_id'] = catId;
70 | data['brand_id'] = brandId;
71 | data['type_id'] = typeId;
72 | data['name'] = name;
73 | data['detail'] = detail;
74 | data['unit_name'] = unitName;
75 | data['unit_value'] = unitValue;
76 | data['nutrition_weight'] = nutritionWeight;
77 | data['price'] = price;
78 | data['image'] = image;
79 | data['cat_name'] = catName;
80 | data['type_name'] = typeName;
81 | data['is_fav'] = isFav;
82 | data['avg_rating'] = avgRating;
83 | return data;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/lib/model/payment_model.dart:
--------------------------------------------------------------------------------
1 | class PaymentModel {
2 | int? payId;
3 | String? name;
4 | String? cardNumber;
5 | String? cardMonth;
6 | String? cardYear;
7 |
8 | PaymentModel(
9 | {this.payId, this.name, this.cardNumber, this.cardMonth, this.cardYear});
10 |
11 | PaymentModel.fromJson(Map json) {
12 | payId = json['pay_id'];
13 | name = json['name'];
14 | cardNumber = json['card_number'];
15 | cardMonth = json['card_month'];
16 | cardYear = json['card_year'];
17 | }
18 |
19 | Map toJson() {
20 | final Map data = {};
21 | data['pay_id'] = payId;
22 | data['name'] = name;
23 | data['card_number'] = cardNumber;
24 | data['card_month'] = cardMonth;
25 | data['card_year'] = cardYear;
26 | return data;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/model/product_detail_model.dart:
--------------------------------------------------------------------------------
1 | class ProductDetailModel {
2 | int? prodId;
3 | int? catId;
4 | int? brandId;
5 | int? typeId;
6 | int? orderId;
7 | int? qty;
8 | String? name;
9 | String? image;
10 | String? detail;
11 | String? unitName;
12 | String? unitValue;
13 | String? nutritionWeight;
14 | double? price;
15 | double? itemPrice;
16 | double? totalPrice;
17 | String? createdDate;
18 | String? modifyDate;
19 | String? catName;
20 | String? brandName;
21 | String? typeName;
22 | double? offerPrice;
23 | String? startDate;
24 | String? endDate;
25 | int? isOfferActive;
26 | bool? isFav;
27 | double? rating;
28 | String? message;
29 |
30 | ProductDetailModel(
31 | {this.prodId,
32 | this.catId,
33 | this.brandId,
34 | this.typeId,
35 | this.name,
36 | this.detail,
37 | this.unitName,
38 | this.unitValue,
39 | this.nutritionWeight,
40 | this.price,
41 | this.createdDate,
42 | this.modifyDate,
43 | this.catName,
44 | this.brandName,
45 | this.typeName,
46 | this.offerPrice,
47 | this.startDate,
48 | this.endDate,
49 | this.isOfferActive,
50 | this.isFav,
51 | this.rating,
52 | this.message});
53 |
54 | ProductDetailModel.fromJson(Map json) {
55 | prodId = json['prod_id'];
56 | orderId = json['order_id'];
57 | qty = json['qty'];
58 | catId = json['cat_id'];
59 | brandId = json['brand_id'];
60 | typeId = json['type_id'];
61 | name = json['name'];
62 | image = json['image'];
63 | detail = json['detail'];
64 | unitName = json['unit_name'];
65 | unitValue = json['unit_value'];
66 | nutritionWeight = json['nutrition_weight'];
67 | price = json['price'];
68 | itemPrice = json['item_price'];
69 | totalPrice = json['total_price'];
70 | createdDate = json['created_date'];
71 | modifyDate = json['modify_date'];
72 | catName = json['cat_name'];
73 | brandName = json['brand_name'];
74 | typeName = json['type_name'];
75 | offerPrice = json['offer_price'];
76 | startDate = json['start_date'];
77 | endDate = json['end_date'];
78 | isOfferActive = json['is_offer_active'];
79 | isFav = (json['is_fav'] as int? ?? 0) == 1;
80 | rating = double.tryParse(json['rating'].toString()) ?? 0;
81 | message = json['message'];
82 | }
83 |
84 | Map toJson() {
85 | final Map data = {};
86 | data['prod_id'] = prodId;
87 | data['cat_id'] = catId;
88 | data['brand_id'] = brandId;
89 | data['type_id'] = typeId;
90 | data['order_id'] = orderId;
91 | data['qty'] = qty;
92 | data['name'] = name;
93 | data['image'] = image;
94 | data['detail'] = detail;
95 | data['unit_name'] = unitName;
96 | data['unit_value'] = unitValue;
97 | data['nutrition_weight'] = nutritionWeight;
98 | data['price'] = price;
99 | data['item_price'] = itemPrice;
100 | data['total_price'] = totalPrice;
101 | data['created_date'] = createdDate;
102 | data['modify_date'] = modifyDate;
103 | data['cat_name'] = catName;
104 | data['brand_name'] = brandName;
105 | data['type_name'] = typeName;
106 | data['offer_price'] = offerPrice;
107 | data['start_date'] = startDate;
108 | data['end_date'] = endDate;
109 | data['is_offer_active'] = isOfferActive;
110 | data['is_fav'] = isFav;
111 | data['rating'] = rating;
112 | data['message'] = message;
113 | return data;
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/lib/model/promo_code_model.dart:
--------------------------------------------------------------------------------
1 | class PromoCodeModel {
2 | int? promoCodeId;
3 | String? code;
4 | String? title;
5 | String? description;
6 | int? type;
7 | int? minOrderAmount;
8 | int? maxDiscountAmount;
9 | int? offerPrice;
10 | String? startDate;
11 | String? endDate;
12 | String? createdDate;
13 | String? modifyDate;
14 |
15 | PromoCodeModel(
16 | {this.promoCodeId,
17 | this.code,
18 | this.title,
19 | this.description,
20 | this.type,
21 | this.minOrderAmount,
22 | this.maxDiscountAmount,
23 | this.offerPrice,
24 | this.startDate,
25 | this.endDate,
26 | this.createdDate,
27 | this.modifyDate});
28 |
29 | PromoCodeModel.fromJson(Map json) {
30 | promoCodeId = json['promo_code_id'];
31 | code = json['code'];
32 | title = json['title'];
33 | description = json['description'];
34 | type = json['type'];
35 | minOrderAmount = json['min_order_amount'];
36 | maxDiscountAmount = json['max_discount_amount'];
37 | offerPrice = json['offer_price'];
38 | startDate = json['start_date'];
39 | endDate = json['end_date'];
40 | createdDate = json['created_date'];
41 | modifyDate = json['modify_date'];
42 | }
43 |
44 | Map toJson() {
45 | final Map data = new Map();
46 | data['promo_code_id'] = this.promoCodeId;
47 | data['code'] = this.code;
48 | data['title'] = this.title;
49 | data['description'] = this.description;
50 | data['type'] = this.type;
51 | data['min_order_amount'] = this.minOrderAmount;
52 | data['max_discount_amount'] = this.maxDiscountAmount;
53 | data['offer_price'] = this.offerPrice;
54 | data['start_date'] = this.startDate;
55 | data['end_date'] = this.endDate;
56 | data['created_date'] = this.createdDate;
57 | data['modify_date'] = this.modifyDate;
58 | return data;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/lib/model/type_model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui';
2 |
3 | import '../common/color_extension.dart';
4 |
5 | class TypeModel {
6 | int? typeId;
7 | String? typeName;
8 | String? image;
9 | Color? color;
10 |
11 | TypeModel({this.typeId, this.typeName, this.image, this.color});
12 |
13 | TypeModel.fromJson(Map json) {
14 | typeId = json['type_id'];
15 | typeName = json['type_name'];
16 | image = json['image'];
17 | color = HexColor.fromHex(json['color'].toString()) ;
18 | }
19 |
20 | Map toJson() {
21 | final Map data = {};
22 | data['type_id'] = typeId;
23 | data['type_name'] = typeName;
24 | data['image'] = image;
25 | data['color'] = color?.toHex();
26 | return data;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lib/model/user_payload_model.dart:
--------------------------------------------------------------------------------
1 | class UserPayloadModel {
2 | int? userId;
3 | String? username;
4 | String? name;
5 | String? email;
6 | String? mobile;
7 | String? mobileCode;
8 | String? password;
9 | String? authToken;
10 | int? status;
11 | String? createdDate;
12 |
13 | UserPayloadModel(
14 | {this.userId,
15 | this.username,
16 | this.name,
17 | this.email,
18 | this.mobile,
19 | this.mobileCode,
20 | this.password,
21 | this.authToken,
22 | this.status,
23 | this.createdDate});
24 |
25 | UserPayloadModel.fromJson(Map json) {
26 | userId = json['user_id'];
27 | username = json['username'];
28 | name = json['name'];
29 | email = json['email'];
30 | mobile = json['mobile'];
31 | mobileCode = json['mobile_code'];
32 | password = json['password'];
33 | authToken = json['auth_token'];
34 | status = json['status'];
35 | createdDate = json['created_date'];
36 | }
37 |
38 | Map toJson() {
39 | final Map data = new Map();
40 | data['user_id'] = this.userId;
41 | data['username'] = this.username;
42 | data['name'] = this.name;
43 | data['email'] = this.email;
44 | data['mobile'] = this.mobile;
45 | data['mobile_code'] = this.mobileCode;
46 | data['password'] = this.password;
47 | data['auth_token'] = this.authToken;
48 | data['status'] = this.status;
49 | data['created_date'] = this.createdDate;
50 | return data;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/view/account/add_payment_method_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/line_textfield.dart';
4 | import 'package:online_groceries/common_widget/round_button.dart';
5 | import 'package:online_groceries/view_model/payment_view_model.dart';
6 |
7 | import '../../common/color_extension.dart';
8 |
9 | class AddPaymentMethodView extends StatefulWidget {
10 | const AddPaymentMethodView({super.key});
11 |
12 | @override
13 | State createState() => _AddPaymentMethodViewState();
14 | }
15 |
16 | class _AddPaymentMethodViewState extends State {
17 | final payVM = Get.put(PaymentViewModel());
18 |
19 | @override
20 | void dispose() {
21 | // TODO: implement dispose
22 | Get.delete();
23 | super.dispose();
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return Scaffold(
29 | appBar: AppBar(
30 | backgroundColor: Colors.white,
31 | elevation: 0.5,
32 | leading: IconButton(
33 | onPressed: () {
34 | Navigator.pop(context);
35 | },
36 | icon: Image.asset(
37 | "assets/img/back.png",
38 | width: 20,
39 | height: 20,
40 | )),
41 | centerTitle: true,
42 | title: Text(
43 | "Add Payment Method",
44 | style: TextStyle(
45 | color: TColor.primaryText,
46 | fontSize: 20,
47 | fontWeight: FontWeight.w700),
48 | ),
49 | ),
50 | backgroundColor: Colors.white,
51 | body: SingleChildScrollView(
52 | child: Padding(
53 | padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
54 | child: Column(
55 | children: [
56 | Column(
57 | children: [
58 | LineTextField(
59 | title: "Name",
60 | placeholder: "Enter you name",
61 | controller: payVM.txtName.value),
62 | const SizedBox(
63 | height: 15,
64 | ),
65 | LineTextField(
66 | title: "Card Number",
67 | placeholder: "Enter you Card Number",
68 | keyboardType: TextInputType.phone,
69 | controller: payVM.txtCardNumber.value),
70 | const SizedBox(
71 | height: 15,
72 | ),
73 | Row(
74 | children: [
75 | Expanded(
76 | child: LineTextField(
77 | title: "MM",
78 | placeholder: "Enter MM",
79 | keyboardType: TextInputType.number,
80 | controller: payVM.txtMonth.value)),
81 | const SizedBox(
82 | width: 15,
83 | ),
84 | Expanded(
85 | child: LineTextField(
86 | title: "YYYY",
87 | placeholder: "Enter YYYY",
88 | keyboardType: TextInputType.number,
89 | controller: payVM.txtYear.value))
90 | ],
91 | ),
92 |
93 |
94 | ],
95 | ),
96 | const SizedBox(
97 | height: 25,
98 | ),
99 | RoundButton(
100 | title: "Add Payment Method",
101 | onPressed: () {
102 |
103 | payVM.serviceCallAdd(() {
104 | Navigator.pop(context);
105 | });
106 |
107 | })
108 | ],
109 | ),
110 | ),
111 | ),
112 | );
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/lib/view/account/address_list_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/model/address_model.dart';
4 | import 'package:online_groceries/view_model/addres_view_mode.dart';
5 |
6 | import '../../common/color_extension.dart';
7 | import '../../common_widget/address_row.dart';
8 | import 'add_address_view.dart';
9 |
10 | class AddressListView extends StatefulWidget {
11 | final Function(AddressModel aObj)? didSelect;
12 | const AddressListView({super.key, this.didSelect });
13 |
14 | @override
15 | State createState() => _AddressListViewState();
16 | }
17 |
18 | class _AddressListViewState extends State {
19 |
20 | final addressVM = Get.put(AddressViewModel());
21 |
22 | @override
23 | void dispose() {
24 | // TODO: implement dispose
25 | Get.delete();
26 | super.dispose();
27 | }
28 |
29 | @override
30 | Widget build(BuildContext context) {
31 | return Scaffold(
32 | appBar: AppBar(
33 | backgroundColor: Colors.white,
34 | elevation: 0.5,
35 | leading: IconButton(
36 | onPressed: () {
37 | Navigator.pop(context);
38 | },
39 | icon: Image.asset(
40 | "assets/img/back.png",
41 | width: 20,
42 | height: 20,
43 | )),
44 | centerTitle: true,
45 | title: Text(
46 | "Delivery Address",
47 | style: TextStyle(
48 | color: TColor.primaryText,
49 | fontSize: 20,
50 | fontWeight: FontWeight.w700),
51 | ),
52 | actions: [
53 | IconButton(
54 | onPressed: () async {
55 |
56 | addressVM.clearAll();
57 |
58 | await Get.to( () => const AddAddressView() );
59 | addressVM.serviceCallList();
60 | },
61 | icon: Image.asset(
62 | "assets/img/add.png",
63 | width: 20,
64 | height: 20,
65 | color: TColor.primaryText,
66 | )),
67 | ]),
68 | backgroundColor: Colors.white,
69 | body: Obx(
70 | () => ListView.separated(
71 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
72 | itemBuilder: (context, index) {
73 | var aObj = addressVM.listArr[index];
74 | return AddressRow(aObj: aObj, onTap: (){
75 | if(widget.didSelect != null) {
76 |
77 | widget.didSelect!(aObj);
78 | Get.back();
79 | }
80 | } , didUpdateDone: (){
81 |
82 | addressVM.serviceCallList();
83 | }, );
84 | },
85 | separatorBuilder: (context, index) =>
86 | const Divider(color: Colors.black12, height: 1),
87 | itemCount: addressVM.listArr.length),
88 | ),
89 | );
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/lib/view/account/change_password_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/line_textfield.dart';
4 | import 'package:online_groceries/common_widget/round_button.dart';
5 |
6 | import '../../common/color_extension.dart';
7 | import '../../view_model/my_detail_view_model.dart';
8 |
9 | class ChangePasswordView extends StatefulWidget {
10 | const ChangePasswordView({super.key});
11 |
12 | @override
13 | State createState() => _ChangePasswordViewState();
14 | }
15 |
16 | class _ChangePasswordViewState extends State {
17 | final detailVM = Get.put(MyDetailViewModel());
18 |
19 | @override
20 | void initState() {
21 | super.initState();
22 | detailVM.clearPassword();
23 | }
24 |
25 | @override
26 | void dispose() {
27 | // TODO: implement dispose
28 | Get.delete();
29 | super.dispose();
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | return Scaffold(
35 | appBar: AppBar(
36 | backgroundColor: Colors.white,
37 | elevation: 0.5,
38 | leading: IconButton(
39 | onPressed: () {
40 | Navigator.pop(context);
41 | },
42 | icon: Image.asset(
43 | "assets/img/back.png",
44 | width: 20,
45 | height: 20,
46 | )),
47 | centerTitle: true,
48 | title: Text(
49 | "Change Password",
50 | style: TextStyle(
51 | color: TColor.primaryText,
52 | fontSize: 20,
53 | fontWeight: FontWeight.w700),
54 | ),
55 | ),
56 | backgroundColor: Colors.white,
57 | body: SingleChildScrollView(
58 | child: Padding(
59 | padding: const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
60 | child: Column(
61 | children: [
62 | Column(
63 | children: [
64 | LineTextField(
65 | title: "Current Password",
66 | placeholder: "Enter you current password",
67 | obscureText: true,
68 | controller: detailVM.txtCurrentPassword.value),
69 | const SizedBox(
70 | height: 15,
71 | ),
72 | LineTextField(
73 | title: "New Password",
74 | placeholder: "Enter you new password",
75 | obscureText: true,
76 | controller: detailVM.txtNewPassword.value),
77 | const SizedBox(
78 | height: 15,
79 | ),
80 |
81 | LineTextField(
82 | title: "Confirm Password",
83 | obscureText: true,
84 | placeholder: "Enter you Confirm password",
85 | controller: detailVM.txtConfirmPassword.value),
86 | const SizedBox(
87 | height: 15,
88 | ),
89 |
90 | ],
91 | ),
92 | const SizedBox(
93 | height: 25,
94 | ),
95 | RoundButton(
96 | title: "Set",
97 | onPressed: () {
98 | detailVM.serviceCallSetPassword(() {
99 | Navigator.pop(context);
100 | });
101 | })
102 | ],
103 | ),
104 | ),
105 | ),
106 | );
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lib/view/account/my_order_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/my_order_row.dart';
4 | import 'package:online_groceries/view_model/addres_view_mode.dart';
5 |
6 | import '../../common/color_extension.dart';
7 | import '../../view_model/my_orders_view_model.dart';
8 | import 'my_order_detail_view.dart';
9 |
10 | class MyOrdersView extends StatefulWidget {
11 | const MyOrdersView({super.key});
12 |
13 | @override
14 | State createState() => _MyOrdersViewState();
15 | }
16 |
17 | class _MyOrdersViewState extends State {
18 | final myVM = Get.put(MyOrdersViewModel());
19 |
20 | @override
21 | void dispose() {
22 | // TODO: implement dispose
23 | Get.delete();
24 | super.dispose();
25 | }
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | backgroundColor: Colors.white,
32 | elevation: 0.5,
33 | leading: IconButton(
34 | onPressed: () {
35 | Navigator.pop(context);
36 | },
37 | icon: Image.asset(
38 | "assets/img/back.png",
39 | width: 20,
40 | height: 20,
41 | )),
42 | centerTitle: true,
43 | title: Text(
44 | "My Orders",
45 | style: TextStyle(
46 | color: TColor.primaryText,
47 | fontSize: 20,
48 | fontWeight: FontWeight.w700),
49 | ),
50 | ),
51 | backgroundColor: Colors.white,
52 | body: Obx(
53 | () => myVM.listArr.isEmpty ? Center(
54 | child: Text(
55 | "No Any Order Place",
56 | style: TextStyle(
57 | color: TColor.primaryText,
58 | fontSize: 20,
59 | fontWeight: FontWeight.w700),
60 | ),
61 | ) : ListView.builder(
62 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
63 | itemBuilder: (context, index) {
64 | var mObj = myVM.listArr[index];
65 | return MyOrderRow(mObj: mObj, onTap: () {
66 | Get.to( () => MyOrdersDetailView(mObj: mObj) );
67 | });
68 | },
69 | itemCount: myVM.listArr.length),
70 | ),
71 | );
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/view/account/notification_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/notification_row.dart';
4 | import 'package:online_groceries/model/address_model.dart';
5 |
6 | import '../../common/color_extension.dart';
7 | import '../../view_model/notification_view_model.dart';
8 |
9 | class NotificationListView extends StatefulWidget {
10 | final Function(AddressModel aObj)? didSelect;
11 | const NotificationListView({super.key, this.didSelect});
12 |
13 | @override
14 | State createState() => _NotificationListViewState();
15 | }
16 |
17 | class _NotificationListViewState extends State {
18 | final notiVM = Get.put(NotificationViewModel());
19 |
20 | @override
21 | void dispose() {
22 | // TODO: implement dispose
23 | Get.delete();
24 | super.dispose();
25 | }
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | backgroundColor: Colors.white,
32 | elevation: 0.5,
33 | leading: IconButton(
34 | onPressed: () {
35 | Navigator.pop(context);
36 | },
37 | icon: Image.asset(
38 | "assets/img/back.png",
39 | width: 20,
40 | height: 20,
41 | )),
42 | centerTitle: true,
43 | title: Text(
44 | "Notifications",
45 | style: TextStyle(
46 | color: TColor.primaryText,
47 | fontSize: 20,
48 | fontWeight: FontWeight.w700),
49 | ),
50 | actions: [
51 | TextButton(
52 | onPressed: () {
53 | notiVM.serviceCallReadAll();
54 | },
55 | child: Text(
56 | "Read All",
57 | style: TextStyle(
58 | color: TColor.primary,
59 | fontSize: 16,
60 | fontWeight: FontWeight.w700),
61 | ),
62 | )
63 | ]),
64 | backgroundColor: Colors.white,
65 | body: Obx(
66 | () => ListView.builder(
67 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
68 | itemBuilder: (context, index) {
69 | var nObj = notiVM.listArr[index];
70 | return NotificationRow(
71 | nObj: nObj,
72 | onTap: () {},
73 | );
74 | },
75 | itemCount: notiVM.listArr.length),
76 | ),
77 | );
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/lib/view/account/payment_method_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/payment_method_row.dart';
4 | import 'package:online_groceries/view/account/add_payment_method_view.dart';
5 |
6 | import '../../common/color_extension.dart';
7 | import '../../model/payment_model.dart';
8 | import '../../view_model/payment_view_model.dart';
9 |
10 | class PaymentMethodListView extends StatefulWidget {
11 | final Function(PaymentModel pObj)? didSelect;
12 | const PaymentMethodListView({super.key, this.didSelect});
13 |
14 | @override
15 | State createState() => _PaymentMethodListViewState();
16 | }
17 |
18 | class _PaymentMethodListViewState extends State {
19 | final payVM = Get.put(PaymentViewModel());
20 |
21 | @override
22 | void dispose() {
23 | // TODO: implement dispose
24 | Get.delete();
25 | super.dispose();
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | backgroundColor: Colors.white,
33 | elevation: 0.5,
34 | leading: IconButton(
35 | onPressed: () {
36 | Navigator.pop(context);
37 | },
38 | icon: Image.asset(
39 | "assets/img/back.png",
40 | width: 20,
41 | height: 20,
42 | )),
43 | centerTitle: true,
44 | title: Text(
45 | "Payment Methods",
46 | style: TextStyle(
47 | color: TColor.primaryText,
48 | fontSize: 20,
49 | fontWeight: FontWeight.w700),
50 | ),
51 | actions: [
52 | IconButton(
53 | onPressed: () async {
54 | payVM.clearAll();
55 |
56 | await Get.to(() => const AddPaymentMethodView());
57 | payVM.serviceCallList();
58 | },
59 | icon: Image.asset(
60 | "assets/img/add.png",
61 | width: 20,
62 | height: 20,
63 | color: TColor.primaryText,
64 | )),
65 | ]),
66 | backgroundColor: Colors.white,
67 | body: Obx(
68 | () => ListView.builder(
69 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
70 | itemBuilder: (context, index) {
71 | var pObj = payVM.listArr[index];
72 | return PaymentMethodRow(
73 | pObj: pObj,
74 | onTap: (){
75 | if(widget.didSelect != null) {
76 | widget.didSelect!(pObj);
77 | Get.back();
78 | }
79 | },
80 | didUpdateDone: () {
81 | payVM.serviceCallList();
82 | },
83 | );
84 | },
85 | itemCount: payVM.listArr.length),
86 | ),
87 | );
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/lib/view/account/promo_code_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/model/promo_code_model.dart';
4 |
5 | import '../../common/color_extension.dart';
6 | import '../../common_widget/promo_code_row.dart';
7 | import '../../view_model/promo_code_view_model.dart';
8 |
9 | class PromoCodeView extends StatefulWidget {
10 | final Function(PromoCodeModel pObj)? didSelect;
11 | const PromoCodeView({super.key, this.didSelect });
12 |
13 | @override
14 | State createState() => _PromoCodeViewState();
15 | }
16 |
17 | class _PromoCodeViewState extends State {
18 | final promoVM = Get.put(PromoCodeViewModel());
19 |
20 | @override
21 | void dispose() {
22 | // TODO: implement dispose
23 | Get.delete();
24 | super.dispose();
25 | }
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | backgroundColor: Colors.white,
32 | elevation: 0.5,
33 | leading: IconButton(
34 | onPressed: () {
35 | Navigator.pop(context);
36 | },
37 | icon: Image.asset(
38 | "assets/img/back.png",
39 | width: 20,
40 | height: 20,
41 | )),
42 | centerTitle: true,
43 | title: Text(
44 | "Promo Code",
45 | style: TextStyle(
46 | color: TColor.primaryText,
47 | fontSize: 20,
48 | fontWeight: FontWeight.w700),
49 | ),
50 | ),
51 | backgroundColor: Colors.white,
52 | body: Obx(
53 | () => promoVM.listArr.isEmpty
54 | ? Center(
55 | child: Text(
56 | "No Any Promo Code Available",
57 | style: TextStyle(
58 | color: TColor.primaryText,
59 | fontSize: 20,
60 | fontWeight: FontWeight.w700),
61 | ),
62 | )
63 | : ListView.separated(
64 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
65 | itemBuilder: (context, index) {
66 | var pObj = promoVM.listArr[index];
67 | return PromoCodeRow(pObj: pObj, onTap: (){
68 | if(widget.didSelect != null) {
69 | widget.didSelect!(pObj);
70 | Get.back();
71 | }
72 | });
73 | },
74 | separatorBuilder: (context, index) =>
75 | const Divider(color: Colors.black12, height: 1),
76 | itemCount: promoVM.listArr.length),
77 | ),
78 | );
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/view/account/write_review_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_rating_bar/flutter_rating_bar.dart';
3 | import 'package:get/get.dart';
4 | import 'package:online_groceries/common/color_extension.dart';
5 | import 'package:online_groceries/common_widget/round_button.dart';
6 |
7 | class WriteReviewView extends StatefulWidget {
8 | final Function(double, String) didSubmit;
9 | const WriteReviewView({super.key, required this.didSubmit});
10 |
11 | @override
12 | State createState() => _WriteReviewViewState();
13 | }
14 |
15 | class _WriteReviewViewState extends State {
16 | double ratingVal = 5.0;
17 | TextEditingController txtMessage = TextEditingController();
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Container(
22 | margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 40),
23 | height: context.height,
24 | child: Column(
25 | mainAxisAlignment: MainAxisAlignment.center,
26 | children: [
27 | Container(
28 | padding: const EdgeInsets.all(20),
29 | decoration: BoxDecoration(
30 | color: Colors.white,
31 | borderRadius: BorderRadius.circular(20),
32 | boxShadow: const [
33 | BoxShadow(
34 | color: Colors.black26,
35 | blurRadius: 10,
36 | )
37 | ]),
38 | child: Column(
39 | children: [
40 | Row(
41 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
42 | children: [
43 | const SizedBox(
44 | width: 40,
45 | ),
46 | Text(
47 | "Write A Review",
48 | style: TextStyle(
49 | color: TColor.primaryText,
50 | fontSize: 24,
51 | fontWeight: FontWeight.w600),
52 | ),
53 | IconButton(
54 | onPressed: () {
55 | Navigator.pop(context);
56 | },
57 | icon: Icon(
58 | Icons.cancel,
59 | size: 30,
60 | color: TColor.primary,
61 | ),
62 | )
63 | ],
64 | ),
65 | Padding(
66 | padding: const EdgeInsets.symmetric(vertical: 15),
67 | child: RatingBar.builder(
68 | initialRating: ratingVal,
69 | minRating: 1,
70 | direction: Axis.horizontal,
71 | allowHalfRating: true,
72 | itemCount: 5,
73 | itemSize: context.width * 0.12,
74 | itemPadding: const EdgeInsets.symmetric(horizontal: 1.0),
75 | itemBuilder: (context, _) => const Icon(
76 | Icons.star,
77 | color: Colors.amber,
78 | ),
79 | onRatingUpdate: (rate) {
80 | ratingVal = rate;
81 | }),
82 | ),
83 | TextField(
84 | controller: txtMessage,
85 | maxLines: 10,
86 | minLines: 10,
87 | decoration: const InputDecoration(
88 | border: InputBorder.none,
89 | focusedBorder: InputBorder.none,
90 | enabledBorder: InputBorder.none,
91 | contentPadding: EdgeInsets.all(16.0),
92 | hintText: "write a review",
93 | filled: true,
94 | ),
95 | style: TextStyle(color: TColor.primary),
96 | )
97 | ],
98 | ),
99 | ),
100 | const SizedBox(
101 | height: 20,
102 | ),
103 | RoundButton(
104 | title: "Submit",
105 | onPressed: () {
106 | widget.didSubmit(ratingVal, txtMessage.text);
107 | })
108 | ],
109 | ),
110 | );
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/lib/view/explore/explore_detail_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/product_cell.dart';
4 |
5 | import '../../common/color_extension.dart';
6 | import '../../model/explore_category_model.dart';
7 | import '../../view_model/cart_view_model.dart';
8 | import '../../view_model/explore_item_view_model.dart';
9 | import '../home/product_details_view.dart';
10 | import 'filter_view.dart';
11 |
12 | class ExploreDetailView extends StatefulWidget {
13 | final ExploreCategoryModel eObj;
14 | const ExploreDetailView({super.key, required this.eObj});
15 |
16 | @override
17 | State createState() => _ExploreDetailViewState();
18 | }
19 |
20 | class _ExploreDetailViewState extends State {
21 | late ExploreItemViewMode listVM;
22 |
23 | @override
24 | void initState() {
25 | super.initState();
26 | listVM = Get.put(ExploreItemViewMode(widget.eObj));
27 | }
28 |
29 | @override
30 | void dispose() {
31 | Get.delete();
32 | super.dispose();
33 | }
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | backgroundColor: Colors.white,
39 | appBar: AppBar(
40 | backgroundColor: Colors.transparent,
41 | elevation: 0,
42 | centerTitle: true,
43 | leading: IconButton(
44 | onPressed: () {
45 | Navigator.pop(context);
46 | },
47 | icon: Image.asset(
48 | "assets/img/back.png",
49 | width: 20,
50 | height: 20,
51 | )),
52 | actions: [
53 | IconButton(
54 | onPressed: () {
55 | Navigator.push(
56 | context,
57 | MaterialPageRoute(
58 | builder: (context) => const FilterView()));
59 | },
60 | icon: Image.asset(
61 | "assets/img/filter_ic.png",
62 | width: 20,
63 | height: 20,
64 | )),
65 | ],
66 | title: Text(
67 | widget.eObj.catName ?? "",
68 | style: TextStyle(
69 | color: TColor.primaryText,
70 | fontSize: 20,
71 | fontWeight: FontWeight.w700),
72 | ),
73 | ),
74 | body: Obx(
75 | () => GridView.builder(
76 | padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20),
77 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
78 | crossAxisCount: 2,
79 | childAspectRatio: 0.75,
80 | crossAxisSpacing: 15,
81 | mainAxisSpacing: 15),
82 | itemCount: listVM.listArr.length,
83 | itemBuilder: ((context, index) {
84 | var pObj = listVM.listArr[index];
85 | return ProductCell(
86 | pObj: pObj,
87 | margin: 0,
88 | weight: double.maxFinite,
89 | onPressed: () async {
90 | await Get.to(() => ProductDetails(
91 | pObj: pObj,
92 | ));
93 | listVM.serviceCallList();
94 | },
95 | onCart: () {
96 | CartViewModel.serviceCallAddToCart(pObj.prodId ?? 0, 1, () {});
97 | },
98 | );
99 | }),
100 | ),
101 | ),
102 | );
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/lib/view/favourite/favourite_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common_widget/round_button.dart';
4 |
5 | import '../../common/color_extension.dart';
6 | import '../../common_widget/favourite_row.dart';
7 | import '../../view_model/favourite_view_model.dart';
8 |
9 | class FavoritesView extends StatefulWidget {
10 | const FavoritesView({super.key});
11 |
12 | @override
13 | State createState() => _FavoritesViewState();
14 | }
15 |
16 | class _FavoritesViewState extends State {
17 |
18 | final favVM = Get.find();
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return Scaffold(
23 | appBar: AppBar(
24 | backgroundColor: Colors.white,
25 | elevation: 0.5,
26 | centerTitle: true,
27 | title: Text(
28 | "Favorites",
29 | style: TextStyle(
30 | color: TColor.primaryText,
31 | fontSize: 20,
32 | fontWeight: FontWeight.w700),
33 | ),
34 | ),
35 | backgroundColor: Colors.white,
36 | body: Stack(
37 | alignment: Alignment.bottomCenter,
38 | children: [
39 | ListView.separated(
40 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
41 | itemCount: favVM.listArr.length,
42 | separatorBuilder: (context, index) => const Divider(
43 | color: Colors.black26,
44 | height: 1,
45 | ),
46 | itemBuilder: (context, index) {
47 | var pObj = favVM.listArr[index];
48 | return FavoriteRow(
49 | pObj: pObj,
50 | onPressed: (){
51 |
52 | },
53 | );
54 | }),
55 | Padding(
56 | padding: const EdgeInsets.all(20.0),
57 | child: Column(
58 | mainAxisAlignment: MainAxisAlignment.end,
59 | children: [
60 |
61 | RoundButton(title: "Add All To Cart", onPressed: (){
62 |
63 | })
64 | ],
65 | ),
66 | )
67 | ],
68 | ),
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/view/login/forgot_password_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import '../../common/color_extension.dart';
4 | import '../../common_widget/line_textfield.dart';
5 | import '../../common_widget/round_button.dart';
6 | import '../../view_model/forgot_password_view_model.dart';
7 |
8 | class ForgotPasswordView extends StatefulWidget {
9 | const ForgotPasswordView({super.key});
10 |
11 | @override
12 | State createState() => _ForgotPasswordViewState();
13 | }
14 |
15 | class _ForgotPasswordViewState extends State {
16 | final forgotVM = Get.put(ForgotPasswordViewModel());
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | var media = MediaQuery.sizeOf(context);
21 | return Stack(children: [
22 | Container(
23 | color: Colors.white,
24 | child: Image.asset("assets/img/bottom_bg.png",
25 | width: media.width, height: media.height, fit: BoxFit.cover),
26 | ),
27 | Scaffold(
28 | appBar: AppBar(
29 | backgroundColor: Colors.transparent,
30 | elevation: 0,
31 | leading: IconButton(
32 | onPressed: () {
33 | Navigator.pop(context);
34 | },
35 | icon: Image.asset(
36 | "assets/img/back.png",
37 | width: 20,
38 | height: 20,
39 | )),
40 | ),
41 | backgroundColor: Colors.transparent,
42 | body: SafeArea(
43 | child: SingleChildScrollView(
44 | child: Padding(
45 | padding: const EdgeInsets.symmetric(horizontal: 20),
46 | child: Column(
47 | crossAxisAlignment: CrossAxisAlignment.start,
48 | children: [
49 | Row(
50 | mainAxisAlignment: MainAxisAlignment.center,
51 | children: [
52 | Image.asset(
53 | "assets/img/color_logo.png",
54 | width: 40,
55 | ),
56 | ],
57 | ),
58 | SizedBox(
59 | height: media.width * 0.15,
60 | ),
61 | Text(
62 | "Forgot Password",
63 | style: TextStyle(
64 | color: TColor.primaryText,
65 | fontSize: 26,
66 | fontWeight: FontWeight.w600),
67 | ),
68 | SizedBox(
69 | height: media.width * 0.03,
70 | ),
71 | Text(
72 | "Enter your emails",
73 | style: TextStyle(
74 | color: TColor.secondaryText,
75 | fontSize: 16,
76 | fontWeight: FontWeight.w500),
77 | ),
78 | SizedBox(
79 | height: media.width * 0.1,
80 | ),
81 | LineTextField(
82 | title: "Email",
83 | placeholder: "Enter your email address",
84 | controller: forgotVM.txtEmail.value,
85 | keyboardType: TextInputType.emailAddress,
86 | ),
87 |
88 | SizedBox(
89 | height: media.width * 0.05,
90 | ),
91 | RoundButton(
92 | title: "Submit",
93 | onPressed: () {
94 | forgotVM.serviceCallRequest();
95 | // Navigator.push(
96 | // context,
97 | // MaterialPageRoute(
98 | // builder: (context) => const MainTabView()));
99 | },
100 | ),
101 | ],
102 | ),
103 | ),
104 | ),
105 | ),
106 | )
107 | ]);
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/lib/view/login/verification_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/view/login/select_location_view.dart';
4 |
5 | import '../../common/color_extension.dart';
6 | import '../../common_widget/line_textfield.dart';
7 | import '../../view_model/forgot_password_view_model.dart';
8 |
9 | class VerificationView extends StatefulWidget {
10 | const VerificationView({super.key});
11 |
12 | @override
13 | State createState() => _VerificationViewState();
14 | }
15 |
16 | class _VerificationViewState extends State {
17 | final forgotVM = Get.put(ForgotPasswordViewModel());
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | var media = MediaQuery.sizeOf(context);
22 | return Stack(children: [
23 | Container(
24 | color: Colors.white,
25 | child: Image.asset("assets/img/bottom_bg.png",
26 | width: media.width, height: media.height, fit: BoxFit.cover),
27 | ),
28 | Scaffold(
29 | appBar: AppBar(
30 | backgroundColor: Colors.transparent,
31 | elevation: 0,
32 | leading: IconButton(
33 | onPressed: () {
34 | Navigator.pop(context);
35 | },
36 | icon: Image.asset(
37 | "assets/img/back.png",
38 | width: 20,
39 | height: 20,
40 | )),
41 | ),
42 | backgroundColor: Colors.transparent,
43 | body: SafeArea(
44 | child: SingleChildScrollView(
45 | child: Padding(
46 | padding: const EdgeInsets.symmetric(horizontal: 20),
47 | child: Column(
48 | crossAxisAlignment: CrossAxisAlignment.start,
49 | children: [
50 | SizedBox(
51 | height: media.width * 0.1,
52 | ),
53 | Text(
54 | "Enter your 4-digit code",
55 | style: TextStyle(
56 | color: TColor.primaryText,
57 | fontSize: 26,
58 | fontWeight: FontWeight.w600),
59 | ),
60 | const SizedBox(
61 | height: 15,
62 | ),
63 | LineTextField(
64 | title: "Code",
65 | placeholder: " - - - -",
66 | controller: forgotVM.txtResetCode.value),
67 | SizedBox(
68 | height: media.width * 0.3,
69 | ),
70 | Row(
71 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
72 | children: [
73 | TextButton(
74 | onPressed: () {
75 | forgotVM.serviceCallRequest(isResend: true);
76 | },
77 | child: Text(
78 | "Resend Code",
79 | style: TextStyle(
80 | color: TColor.primary,
81 | fontSize: 18,
82 | fontWeight: FontWeight.w500),
83 | )),
84 | InkWell(
85 | borderRadius: BorderRadius.circular(30),
86 | onTap: () {
87 | forgotVM.serviceCallVerify();
88 | },
89 | child: Container(
90 | width: 60,
91 | height: 60,
92 | alignment: Alignment.center,
93 | decoration: BoxDecoration(
94 | color: TColor.primary,
95 | borderRadius: BorderRadius.circular(30)),
96 | child: Image.asset(
97 | "assets/img/next.png",
98 | width: 20,
99 | height: 20,
100 | ),
101 | ),
102 | )
103 | ],
104 | )
105 | ],
106 | ),
107 | ),
108 | ),
109 | ),
110 | )
111 | ]);
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/lib/view/login/welcome_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:online_groceries/view/login/sign_in_view.dart';
4 |
5 | import '../../common_widget/round_button.dart';
6 |
7 | class WelcomeView extends StatefulWidget {
8 | const WelcomeView({super.key});
9 |
10 | @override
11 | State createState() => _WelcomeViewState();
12 | }
13 |
14 | class _WelcomeViewState extends State {
15 |
16 |
17 | @override
18 | void initState() {
19 | // TODO: implement initState
20 | super.initState();
21 | SystemChrome.setEnabledSystemUIMode( SystemUiMode.leanBack );
22 | }
23 |
24 | @override
25 | Widget build(BuildContext context) {
26 | var media = MediaQuery.sizeOf(context);
27 | return Scaffold(
28 | backgroundColor: Colors.white,
29 | body: Stack(
30 | children: [
31 | Image.asset(
32 | "assets/img/welcom_bg.png",
33 | width: media.width,
34 | height: media.height,
35 | fit: BoxFit.cover,
36 | ),
37 | SafeArea(
38 | child: Column(
39 | mainAxisAlignment: MainAxisAlignment.end,
40 |
41 | children: [
42 |
43 | Image.asset("assets/img/app_logo.png", width: 60, height: 60, ),
44 | const SizedBox(
45 | height: 8,
46 | ),
47 |
48 | const Row(
49 | mainAxisAlignment: MainAxisAlignment.center,
50 | children: [
51 | Text(
52 | "Welcome\nto our store",
53 | style: TextStyle(
54 | color: Colors.white,
55 | fontSize: 48,
56 | fontWeight: FontWeight.w600),
57 | ),
58 | ],
59 | ),
60 |
61 | Row(
62 | mainAxisAlignment: MainAxisAlignment.center,
63 | children: [
64 | Text(
65 | "Ger your groceries in as fast as one hour",
66 | style: TextStyle(
67 | color: const Color(0xffFCFCFC).withOpacity(0.7),
68 | fontSize: 16,
69 | fontWeight: FontWeight.w500),
70 | ),
71 | ],
72 | ),
73 |
74 |
75 | const SizedBox(height: 20,),
76 |
77 | Padding(
78 | padding: const EdgeInsets.symmetric(horizontal: 20),
79 | child: RoundButton(title: "Get Started", onPressed: (){
80 | Navigator.push(context, MaterialPageRoute(builder: (context) => const SignInView() ) );
81 | },),
82 | ),
83 |
84 |
85 | const SizedBox(height: 46,),
86 | ],
87 | ),
88 | )
89 | ],
90 | ),
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/lib/view/my_cart/error_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../../common/color_extension.dart';
4 | import '../../common_widget/round_button.dart';
5 |
6 | class ErrorView extends StatelessWidget {
7 | const ErrorView({super.key});
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | var media = MediaQuery.sizeOf(context);
12 | return Container(
13 | width: media.width * 0.9 ,
14 |
15 | padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
16 | decoration: BoxDecoration(
17 | color: Colors.white, borderRadius: BorderRadius.circular(30)),
18 | child: Column(
19 | mainAxisSize: MainAxisSize.min,
20 | children: [
21 | Row(
22 | children: [
23 | IconButton(
24 | onPressed: () {
25 | Navigator.pop(context);
26 | },
27 | icon: Image.asset(
28 | "assets/img/close.png",
29 | width: 20,
30 | height: 20,
31 | ),
32 | )
33 | ],
34 | ),
35 | const SizedBox(
36 | height: 10,
37 | ),
38 | Image.asset(
39 | "assets/img/order_fail.png",
40 | width: media.width * 0.5,
41 | ),
42 | const SizedBox(
43 | height: 40,
44 | ),
45 | Text(
46 | "Oops! Order Failed",
47 | textAlign: TextAlign.center,
48 | style: TextStyle(
49 | color: TColor.primaryText,
50 | fontSize: 28,
51 | fontWeight: FontWeight.w600),
52 | ),
53 | const SizedBox(
54 | height: 20,
55 | ),
56 | Text(
57 | "Something went tembly wrong.",
58 | textAlign: TextAlign.center,
59 | style: TextStyle(
60 | color: TColor.secondaryText,
61 | fontSize: 16,
62 | fontWeight: FontWeight.w500),
63 | ),
64 |
65 | const SizedBox(
66 | height: 40,
67 | ),
68 | RoundButton(title: "Please Try Again", onPressed: () {}),
69 | TextButton(
70 | onPressed: () {
71 | Navigator.pop(context);
72 | },
73 | child: Text(
74 | "Back to home",
75 | textAlign: TextAlign.left,
76 | style: TextStyle(
77 | color: TColor.primaryText,
78 | fontSize: 18,
79 | fontWeight: FontWeight.w600),
80 | ),
81 | )
82 | ],
83 | ),
84 | );
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/lib/view/my_cart/order_accpet_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:online_groceries/common_widget/round_button.dart';
3 |
4 | import '../../common/color_extension.dart';
5 |
6 | class OrderAcceptView extends StatefulWidget {
7 | const OrderAcceptView({super.key});
8 |
9 | @override
10 | State createState() => _OrderAcceptViewState();
11 | }
12 |
13 | class _OrderAcceptViewState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | var media = MediaQuery.sizeOf(context);
17 |
18 | return Scaffold(
19 | backgroundColor: Colors.white,
20 | body: Stack(
21 | children: [
22 | Image.asset(
23 | "assets/img/bottom_bg.png",
24 | width: media.width,
25 | height: media.height,
26 | fit: BoxFit.cover,
27 | ),
28 | SafeArea(
29 | child: Padding(
30 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
31 | child: Column(
32 | children: [
33 | const Spacer(),
34 | Image.asset(
35 | "assets/img/order_accpeted.png",
36 | width: media.width * 0.7,
37 | ),
38 | const SizedBox(
39 | height: 40,
40 | ),
41 | Text(
42 | "Your Order has been\naccepted",
43 | textAlign: TextAlign.center,
44 | style: TextStyle(
45 | color: TColor.primaryText,
46 | fontSize: 28,
47 | fontWeight: FontWeight.w600),
48 | ),
49 | const SizedBox(
50 | height: 20,
51 | ),
52 | Text(
53 | "Your items has been placcd and is on\nit’s way to being processed",
54 | textAlign: TextAlign.center,
55 | style: TextStyle(
56 | color: TColor.secondaryText,
57 | fontSize: 16,
58 | fontWeight: FontWeight.w500),
59 | ),
60 | const Spacer(),
61 | const Spacer(),
62 | RoundButton(title: "Track Order", onPressed: () {}),
63 | TextButton(
64 | onPressed: () {
65 | Navigator.pop(context);
66 | },
67 | child: Text(
68 | "Back to home",
69 | textAlign: TextAlign.left,
70 | style: TextStyle(
71 | color: TColor.primaryText,
72 | fontSize: 18,
73 | fontWeight: FontWeight.w600),
74 | ),
75 | )
76 | ],
77 | ),
78 | ),
79 | ),
80 | ],
81 | ),
82 | );
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/lib/view/splash_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:get/get.dart';
3 |
4 | import '../common/color_extension.dart';
5 | import '../view_model/splash_view_model.dart';
6 |
7 | class SplashView extends StatefulWidget {
8 | const SplashView({super.key});
9 |
10 | @override
11 | State createState() => _SplashViewState();
12 | }
13 |
14 | class _SplashViewState extends State {
15 |
16 | final splashVM = Get.put( SplashViewModel() );
17 |
18 | @override
19 | void initState() {
20 | // TODO: implement initState
21 | super.initState();
22 | splashVM.loadView();
23 |
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | var media = MediaQuery.sizeOf(context);
29 | return Scaffold(
30 | backgroundColor: TColor.primary,
31 | body: Center(
32 | child:
33 | Image.asset("assets/img/splash_logo.png", width: media.width * 0.7),
34 | ),
35 | );
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/view_model/explore_item_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 | import 'package:online_groceries/model/product_detail_model.dart';
3 |
4 | import '../common/globs.dart';
5 | import '../common/service_call.dart';
6 | import '../model/explore_category_model.dart';
7 | import '../model/offer_product_model.dart';
8 |
9 | class ExploreItemViewMode extends GetxController {
10 | final ExploreCategoryModel pObj;
11 | final sProductObj = ProductDetailModel().obs;
12 | final RxList listArr = [].obs;
13 |
14 | ExploreItemViewMode(this.pObj);
15 |
16 | @override
17 | void onInit() {
18 | // TODO: implement onInit
19 |
20 | super.onInit();
21 |
22 | serviceCallList();
23 | }
24 |
25 | //MARK ServiceCall
26 | void serviceCallList() {
27 | Globs.showHUD();
28 | ServiceCall.post({
29 | "cat_id": pObj.catId.toString(),
30 | }, SVKey.svExploreItemList, isToken: true, withSuccess: (resObj) async {
31 | Globs.hideHUD();
32 |
33 | if (resObj[KKey.status] == "1") {
34 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
35 | return OfferProductModel.fromJson(oObj);
36 | }).toList();
37 |
38 | listArr.value = listDataArr;
39 | } else {}
40 | }, failure: (err) async {
41 | Globs.hideHUD();
42 | Get.snackbar(Globs.appName, err.toString());
43 | });
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/lib/view_model/explore_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common/globs.dart';
4 | import 'package:online_groceries/common/service_call.dart';
5 |
6 | import '../model/explore_category_model.dart';
7 |
8 | class ExploreViewModel extends GetxController {
9 |
10 | final RxList listArr = [].obs;
11 |
12 | final isLoading = false.obs;
13 |
14 | @override
15 | void onInit() {
16 | // TODO: implement onInit
17 | super.onInit();
18 |
19 | if (kDebugMode) {
20 | print("ExploreViewModel Init ");
21 | }
22 |
23 | serviceCallList();
24 | }
25 |
26 | //ServiceCall
27 | void serviceCallList() {
28 | Globs.showHUD();
29 | ServiceCall.post({}, SVKey.svExploreList, isToken: true,
30 | withSuccess: (resObj) async {
31 | Globs.hideHUD();
32 |
33 | if (resObj[KKey.status] == "1") {
34 |
35 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
36 | return ExploreCategoryModel.fromJson(oObj);
37 | }).toList();
38 |
39 | listArr.value = listDataArr;
40 | } else {}
41 | }, failure: (err) async {
42 | Globs.hideHUD();
43 | Get.snackbar(Globs.appName, err.toString());
44 | });
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/view_model/favourite_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common/globs.dart';
4 | import 'package:online_groceries/common/service_call.dart';
5 |
6 | import '../model/offer_product_model.dart';
7 |
8 | class FavoriteViewModel extends GetxController {
9 | final RxList listArr = [].obs;
10 |
11 |
12 | @override
13 | void onInit() {
14 | // TODO: implement onInit
15 | super.onInit();
16 |
17 | if (kDebugMode) {
18 | print("FavoriteViewModel Init ");
19 | }
20 |
21 | serviceCalList();
22 | }
23 |
24 | //ServiceCall
25 | void serviceCalList() {
26 | Globs.showHUD();
27 | ServiceCall.post({}, SVKey.svFavorite, isToken: true,
28 | withSuccess: (resObj) async {
29 | Globs.hideHUD();
30 |
31 | if (resObj[KKey.status] == "1") {
32 |
33 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
34 | return OfferProductModel.fromJson(oObj);
35 | }).toList();
36 |
37 | listArr.value = listDataArr;
38 | } else {}
39 | }, failure: (err) async {
40 | Globs.hideHUD();
41 | Get.snackbar(Globs.appName, err.toString());
42 | });
43 | }
44 |
45 | void serviceCallAddRemoveFavorite(int index) {
46 | Globs.showHUD();
47 | ServiceCall.post({
48 | "prod_id": listArr[index].prodId.toString(),
49 | }, SVKey.svAddRemoveFavorite, isToken: true, withSuccess: (resObj) async {
50 | Globs.hideHUD();
51 |
52 | if (resObj[KKey.status] == "1") {
53 | listArr.removeAt(index);
54 | Get.snackbar(Globs.appName, resObj[KKey.message]);
55 | } else {}
56 | }, failure: (err) async {
57 | Globs.hideHUD();
58 | Get.snackbar(Globs.appName, err.toString());
59 | });
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/view_model/forgot_password_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:get/get.dart';
4 | import 'package:online_groceries/common/globs.dart';
5 | import 'package:online_groceries/common/service_call.dart';
6 | import 'package:online_groceries/view/login/forgot_password_set_view.dart';
7 | import 'package:online_groceries/view/login/verification_view.dart';
8 |
9 | class ForgotPasswordViewModel extends GetxController {
10 | final txtEmail = TextEditingController().obs;
11 | final txtResetCode = TextEditingController().obs;
12 | final isLoading = false.obs;
13 |
14 | final isShowPassword = false.obs;
15 | final txtNewPassword = TextEditingController().obs;
16 | final txtConfirmPassword = TextEditingController().obs;
17 | Map? forgotResDict;
18 |
19 | @override
20 | void onInit() {
21 | // TODO: implement onInit
22 | super.onInit();
23 |
24 | if (kDebugMode) {
25 | print("ForgotPasswordViewModel Init ");
26 | }
27 | txtEmail.value.text = "test@gmail.com";
28 | }
29 |
30 | //ServiceCall
31 | void serviceCallRequest({ bool isResend = false}) {
32 | if (!GetUtils.isEmail(txtEmail.value.text)) {
33 | Get.snackbar(Globs.appName, "Pleaser enter valid email address");
34 | return;
35 | }
36 |
37 | Globs.showHUD();
38 |
39 | ServiceCall.post({
40 | "email": txtEmail.value.text,
41 | }, SVKey.svForgotPasswordRequest, withSuccess: (resObj) async {
42 | Globs.hideHUD();
43 |
44 | if (resObj[KKey.status] == "1") {
45 |
46 | if(!isResend) {
47 | Get.to(() => const VerificationView());
48 | }
49 |
50 | } else {
51 | Get.snackbar(Globs.appName, resObj["message"].toString());
52 | }
53 |
54 |
55 | }, failure: (err) async {
56 | Globs.hideHUD();
57 | Get.snackbar(Globs.appName, err.toString());
58 | });
59 | }
60 |
61 | void serviceCallVerify() {
62 | if (txtResetCode.value.text.length != 4) {
63 | Get.snackbar(Globs.appName, "Pleaser enter valid otp");
64 | return;
65 | }
66 |
67 | Globs.showHUD();
68 |
69 | ServiceCall.post({
70 | "email": txtEmail.value.text,
71 | "reset_code": txtResetCode.value.text,
72 | }, SVKey.svForgotPasswordVerify, withSuccess: (resObj) async {
73 | Globs.hideHUD();
74 |
75 | if (resObj[KKey.status] == "1") {
76 | forgotResDict = resObj[KKey.payload] as Map? ?? {};
77 | Get.to(() => const ForgotPasswordSetView());
78 | } else {
79 | Get.snackbar(Globs.appName, resObj["message"].toString());
80 | }
81 | }, failure: (err) async {
82 | Globs.hideHUD();
83 | Get.snackbar(Globs.appName, err.toString());
84 | });
85 | }
86 |
87 | void serviceCallSetPassword() {
88 | if (txtNewPassword.value.text.length < 6) {
89 | Get.snackbar(
90 | Globs.appName, "Please enter new password minimum 6 character");
91 | return;
92 | }
93 | if (txtNewPassword.value.text != txtConfirmPassword.value.text) {
94 | Get.snackbar(Globs.appName, "password not match");
95 | return;
96 | }
97 |
98 | Globs.showHUD();
99 |
100 | ServiceCall.post({
101 | "user_id": "${ forgotResDict?["user_id"] }" ,
102 | "reset_code": "${forgotResDict?["reset_code"]}",
103 | "new_password": txtNewPassword.value.text
104 | }, SVKey.svForgotPasswordSetPassword, withSuccess: (resObj) async {
105 | Globs.hideHUD();
106 |
107 | if (resObj[KKey.status] == "1") {
108 |
109 | Get.back();
110 | Get.delete();
111 | Get.snackbar(Globs.appName, resObj["message"].toString());
112 | } else {
113 | Get.snackbar(Globs.appName, resObj["message"].toString());
114 | }
115 |
116 | }, failure: (err) async {
117 | Globs.hideHUD();
118 | Get.snackbar(Globs.appName, err.toString());
119 | });
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/lib/view_model/home_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common/globs.dart';
4 | import 'package:online_groceries/common/service_call.dart';
5 |
6 | import '../model/offer_product_model.dart';
7 | import '../model/type_model.dart';
8 |
9 | class HomeViewModel extends GetxController {
10 |
11 | final RxList offerArr = [].obs;
12 | final RxList bestSellingArr = [].obs;
13 | final RxList groceriesArr = [].obs;
14 | final RxList listArr = [].obs;
15 |
16 | final isLoading = false.obs;
17 |
18 | @override
19 | void onInit() {
20 | // TODO: implement onInit
21 | super.onInit();
22 |
23 | if (kDebugMode) {
24 | print("HomeViewModel Init ");
25 | }
26 |
27 | serviceCallHome();
28 |
29 | }
30 |
31 | //ServiceCall
32 | void serviceCallHome() {
33 |
34 | Globs.showHUD();
35 | ServiceCall.post({
36 |
37 | }, SVKey.svHome, isToken: true, withSuccess: (resObj) async {
38 | Globs.hideHUD();
39 |
40 | if (resObj[KKey.status] == "1") {
41 | var payload = resObj[KKey.payload] as Map? ?? {};
42 |
43 |
44 | var offerDataArr = (payload["offer_list"] as List? ?? []).map((oObj) {
45 | return OfferProductModel.fromJson(oObj);
46 | }).toList();
47 |
48 | offerArr.value = offerDataArr;
49 |
50 | var bestSellingDataArr = (payload["best_sell_list"] as List? ?? []).map((oObj) {
51 | return OfferProductModel.fromJson(oObj);
52 | }).toList();
53 |
54 | bestSellingArr.value = bestSellingDataArr;
55 |
56 | var typeDataArr =
57 | (payload["type_list"] as List? ?? []).map((oObj) {
58 | return TypeModel.fromJson(oObj);
59 | }).toList();
60 |
61 | groceriesArr.value = typeDataArr;
62 |
63 | var listDataArr =
64 | (payload["list"] as List? ?? []).map((oObj) {
65 | return OfferProductModel.fromJson(oObj);
66 | }).toList();
67 |
68 | listArr.value = listDataArr;
69 |
70 | } else {}
71 |
72 |
73 | }, failure: (err) async {
74 | Globs.hideHUD();
75 | Get.snackbar(Globs.appName, err.toString());
76 | });
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/lib/view_model/login_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:get/get.dart';
4 | import 'package:online_groceries/common/globs.dart';
5 | import 'package:online_groceries/common/service_call.dart';
6 | import 'package:online_groceries/view_model/splash_view_model.dart';
7 |
8 | class LoginViewModel extends GetxController {
9 | final txtEmail = TextEditingController().obs;
10 | final txtPassword = TextEditingController().obs;
11 | final isShowPassword = false.obs;
12 |
13 | final isLoading = false.obs;
14 |
15 | @override
16 | void onInit() {
17 | // TODO: implement onInit
18 | super.onInit();
19 |
20 | if (kDebugMode) {
21 | print("LoginViewModel Init ");
22 | }
23 | txtEmail.value.text = "test@gmail.com";
24 | txtPassword.value.text = "123456";
25 | }
26 |
27 | //ServiceCall
28 | void serviceCallLogin() {
29 |
30 | if (!GetUtils.isEmail(txtEmail.value.text)) {
31 | Get.snackbar(Globs.appName, "Pleaser enter valid email address");
32 | return;
33 | }
34 |
35 | if (txtPassword.value.text.length < 6) {
36 | Get.snackbar(
37 | Globs.appName, "Pleaser enter valid password min 6 character");
38 | return;
39 | }
40 |
41 | Globs.showHUD();
42 |
43 | ServiceCall.post({
44 | "email": txtEmail.value.text,
45 | "password": txtPassword.value.text,
46 | "dervice_token": ""
47 | }, SVKey.svLogin, withSuccess: (resObj) async {
48 | Globs.hideHUD();
49 |
50 | if( resObj[KKey.status] == "1" ) {
51 | var payload = resObj[KKey.payload] as Map? ?? {};
52 |
53 | Globs.udSet(payload, Globs.userPayload);
54 | Globs.udBoolSet(true, Globs.userLogin);
55 |
56 |
57 | Get.delete();
58 | Get.find().goAfterLoginMainTab();
59 |
60 | }else{
61 |
62 | }
63 |
64 | Get.snackbar(Globs.appName, resObj["message"].toString());
65 | }, failure: (err) async {
66 | Globs.hideHUD();
67 | Get.snackbar(Globs.appName, err.toString());
68 | } );
69 |
70 |
71 | }
72 |
73 | void showPassword() {
74 | isShowPassword.value = !isShowPassword.value;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/lib/view_model/my_detail_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:fl_country_code_picker/fl_country_code_picker.dart';
2 | import 'package:flutter/foundation.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:get/get.dart';
5 | import 'package:online_groceries/view_model/splash_view_model.dart';
6 |
7 | import '../common/globs.dart';
8 | import '../common/service_call.dart';
9 |
10 | class MyDetailViewModel extends GetxController {
11 | final txtName = TextEditingController().obs;
12 | final txtMobile = TextEditingController().obs;
13 | final txtUsername = TextEditingController().obs;
14 | final txtMobileCode = "".obs;
15 |
16 | final txtCurrentPassword = TextEditingController().obs;
17 | final txtNewPassword = TextEditingController().obs;
18 | final txtConfirmPassword = TextEditingController().obs;
19 |
20 | final isLoading = false.obs;
21 | @override
22 | void onInit() {
23 | // TODO: implement onInit
24 | super.onInit();
25 |
26 | if (kDebugMode) {
27 | print("MyDetailViewModel Init ");
28 | }
29 |
30 | setDataModel();
31 | }
32 |
33 | //ServiceCall
34 |
35 | void serviceCallUpdate(VoidCallback didDone) {
36 | if (txtName.value.text.isEmpty) {
37 | Get.snackbar(Globs.appName, "Please enter name");
38 | return;
39 | }
40 |
41 | if (txtMobile.value.text.isEmpty) {
42 | Get.snackbar(Globs.appName, "Please enter phone");
43 | return;
44 | }
45 | if (txtUsername.value.text.isEmpty) {
46 | Get.snackbar(Globs.appName, "Please enter username");
47 | return;
48 | }
49 |
50 | Globs.showHUD();
51 | ServiceCall.post({
52 | "name": txtName.value.text,
53 | "mobile": txtMobile.value.text,
54 | "username": txtUsername.value.text,
55 | "mobile_code": txtMobileCode.value
56 | }, SVKey.svUpdateProfile, isToken: true, withSuccess: (resObj) async {
57 | Globs.hideHUD();
58 |
59 | if (resObj[KKey.status] == "1") {
60 | Get.snackbar(Globs.appName, resObj[KKey.message].toString());
61 | var payload = resObj[KKey.payload] as Map? ?? {};
62 |
63 | Globs.udSet(payload, Globs.userPayload);
64 | Globs.udBoolSet(true, Globs.userLogin);
65 | Get.find().setData();
66 | didDone();
67 | } else {}
68 | }, failure: (err) async {
69 | Globs.hideHUD();
70 | Get.snackbar(Globs.appName, err.toString());
71 | });
72 | }
73 |
74 | void serviceCallSetPassword(VoidCallback didDone) {
75 | if (txtCurrentPassword.value.text.isEmpty) {
76 | Get.snackbar(Globs.appName, "Please enter current password");
77 | return;
78 | }
79 |
80 | if (txtNewPassword.value.text.length < 6) {
81 | Get.snackbar(Globs.appName, "Please enter new password minimum 6 character");
82 | return;
83 | }
84 | if (txtNewPassword.value.text
85 | != txtConfirmPassword.value.text) {
86 | Get.snackbar(
87 | Globs.appName, "password not match");
88 | return;
89 | }
90 |
91 | Globs.showHUD();
92 | ServiceCall.post({
93 | "current_password": txtCurrentPassword.value.text,
94 | "new_password": txtNewPassword.value.text
95 | }, SVKey.svChangePassword, isToken: true, withSuccess: (resObj) async {
96 | Globs.hideHUD();
97 |
98 | if (resObj[KKey.status] == "1") {
99 | Get.snackbar(Globs.appName, resObj[KKey.message].toString());
100 | didDone();
101 | } else {}
102 | }, failure: (err) async {
103 | Globs.hideHUD();
104 | Get.snackbar(Globs.appName, err.toString());
105 | });
106 | }
107 |
108 | void setDataModel() {
109 | final sVM = Get.find();
110 | txtName.value.text = sVM.userPayload.value.name ?? "";
111 | txtMobile.value.text = sVM.userPayload.value.mobile ?? "";
112 | txtUsername.value.text = sVM.userPayload.value.username ?? "";
113 | txtMobileCode.value = sVM.userPayload.value.mobileCode ?? "";
114 | }
115 |
116 | void clearAll() {
117 | txtName.value.text = "";
118 | txtMobile.value.text = "";
119 | txtUsername.value.text = "";
120 | txtMobileCode.value = "";
121 |
122 | }
123 |
124 | void clearPassword(){
125 | txtConfirmPassword.value.text = "";
126 | txtNewPassword.value.text = "";
127 | txtConfirmPassword.value.text = "";
128 |
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/lib/view_model/my_order_detail_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/model/my_order_model.dart';
4 | import 'package:online_groceries/model/product_detail_model.dart';
5 |
6 | import '../common/globs.dart';
7 | import '../common/service_call.dart';
8 |
9 | class MyOrderDetailViewModel extends GetxController {
10 | final MyOrderModel mObj;
11 | final sOrderObj = MyOrderModel().obs;
12 | final RxList cartList = [].obs;
13 |
14 | final isShowDetail = true.obs;
15 | final isShowNutrition = true.obs;
16 |
17 | MyOrderDetailViewModel(this.mObj);
18 |
19 | @override
20 | void onInit() {
21 | // TODO: implement onInit
22 |
23 | super.onInit();
24 | serviceCallDetail();
25 | }
26 |
27 | //MARK ServiceCall
28 | void serviceCallDetail() {
29 | Globs.showHUD();
30 | ServiceCall.post({
31 | "order_id": mObj.orderId.toString(),
32 | }, SVKey.svMyOrdersDetail, isToken: true, withSuccess: (resObj) async {
33 | Globs.hideHUD();
34 |
35 | if (resObj[KKey.status] == "1") {
36 | var payload = resObj[KKey.payload];
37 |
38 | sOrderObj.value = MyOrderModel.fromJson(payload);
39 |
40 | var nutritionDataArr =
41 | (payload["cart_list"] as List? ?? []).map((oObj) {
42 | return ProductDetailModel.fromJson(oObj);
43 | }).toList();
44 |
45 | cartList.value = nutritionDataArr;
46 | } else {}
47 | }, failure: (err) async {
48 | Globs.hideHUD();
49 | Get.snackbar(Globs.appName, err.toString());
50 | });
51 | }
52 |
53 | void serviceCallGiveRatingReview(
54 | String prodId, String rating, String message, VoidCallback didDone) {
55 | Globs.showHUD();
56 | ServiceCall.post({
57 | "order_id": mObj.orderId.toString(),
58 | "prod_id": prodId,
59 | "rating": rating,
60 | "review_message": message
61 | }, SVKey.svProductRatingReview, isToken: true, withSuccess: (resObj) async {
62 | Globs.hideHUD();
63 |
64 | if (resObj[KKey.status] == "1") {
65 | serviceCallDetail();
66 | didDone();
67 |
68 | Get.snackbar(
69 | Globs.appName, resObj[KKey.message] as String? ?? MSG.success);
70 | } else {
71 | Get.snackbar(
72 | Globs.appName, resObj[KKey.message] as String? ?? MSG.fail);
73 | }
74 | }, failure: (err) async {
75 | Globs.hideHUD();
76 | Get.snackbar(Globs.appName, err.toString());
77 | });
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/lib/view_model/my_orders_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:get/get.dart';
3 |
4 | import '../common/globs.dart';
5 | import '../common/service_call.dart';
6 | import '../model/my_order_model.dart';
7 |
8 | class MyOrdersViewModel extends GetxController {
9 |
10 | final RxList listArr = [].obs;
11 |
12 | final isLoading = false.obs;
13 | @override
14 | void onInit() {
15 | // TODO: implement onInit
16 | super.onInit();
17 |
18 | if (kDebugMode) {
19 | print("MyOrdersViewModel Init ");
20 | }
21 |
22 | serviceCallList();
23 | }
24 |
25 | //ServiceCall
26 | void serviceCallList() {
27 | Globs.showHUD();
28 | ServiceCall.post({}, SVKey.svMyOrders, isToken: true,
29 | withSuccess: (resObj) async {
30 | Globs.hideHUD();
31 |
32 | if (resObj[KKey.status] == "1") {
33 |
34 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
35 | return MyOrderModel.fromJson(oObj);
36 | }).toList();
37 |
38 | listArr.value = listDataArr;
39 | } else {}
40 | }, failure: (err) async {
41 | Globs.hideHUD();
42 | Get.snackbar(Globs.appName, err.toString());
43 | });
44 | }
45 |
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/lib/view_model/notification_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:get/get.dart';
3 | import '../common/globs.dart';
4 | import '../common/service_call.dart';
5 | import '../model/notification_model.dart';
6 |
7 | class NotificationViewModel extends GetxController {
8 |
9 |
10 | final RxList listArr = [].obs;
11 |
12 | final isLoading = false.obs;
13 | @override
14 | void onInit() {
15 | // TODO: implement onInit
16 | super.onInit();
17 |
18 | if (kDebugMode) {
19 | print("NotificationViewModel Init ");
20 | }
21 |
22 | serviceCallList();
23 | }
24 |
25 | //ServiceCall
26 | void serviceCallList() {
27 | Globs.showHUD();
28 | ServiceCall.post({}, SVKey.svNotificationList, isToken: true,
29 | withSuccess: (resObj) async {
30 | Globs.hideHUD();
31 |
32 | if (resObj[KKey.status] == "1") {
33 |
34 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
35 | return NotificationModel.fromJson(oObj);
36 | }).toList();
37 |
38 | listArr.value = listDataArr;
39 | } else {}
40 | }, failure: (err) async {
41 | Globs.hideHUD();
42 | Get.snackbar(Globs.appName, err.toString());
43 | });
44 | }
45 |
46 |
47 |
48 | void serviceCallReadAll() {
49 | Globs.showHUD();
50 | ServiceCall.post({},
51 | SVKey.svNotificationReadAll, isToken: true,
52 | withSuccess: (resObj) async {
53 | Globs.hideHUD();
54 | if (resObj[KKey.status] == "1") {
55 | Get.snackbar(Globs.appName, resObj[KKey.message].toString());
56 | serviceCallList();
57 | } else {}
58 | }, failure: (err) async {
59 | Globs.hideHUD();
60 | Get.snackbar(Globs.appName, err.toString());
61 | });
62 | }
63 |
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/lib/view_model/payment_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:get/get.dart';
4 |
5 | import '../common/globs.dart';
6 | import '../common/service_call.dart';
7 | import '../model/payment_model.dart';
8 |
9 | class PaymentViewModel extends GetxController {
10 | final txtName = TextEditingController().obs;
11 | final txtCardNumber = TextEditingController().obs;
12 | final txtMonth = TextEditingController().obs;
13 | final txtYear = TextEditingController().obs;
14 |
15 | final RxList listArr = [].obs;
16 |
17 | final isLoading = false.obs;
18 | @override
19 | void onInit() {
20 | // TODO: implement onInit
21 | super.onInit();
22 |
23 | if (kDebugMode) {
24 | print("PaymentViewModel Init ");
25 | }
26 |
27 | serviceCallList();
28 | }
29 |
30 | //ServiceCall
31 | void serviceCallList() {
32 | Globs.showHUD();
33 | ServiceCall.post({}, SVKey.svPaymentMethodList, isToken: true,
34 | withSuccess: (resObj) async {
35 | Globs.hideHUD();
36 |
37 | if (resObj[KKey.status] == "1") {
38 | clearAll();
39 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
40 | return PaymentModel.fromJson(oObj);
41 | }).toList();
42 |
43 | listArr.value = listDataArr;
44 | } else {}
45 | }, failure: (err) async {
46 | Globs.hideHUD();
47 | Get.snackbar(Globs.appName, err.toString());
48 | });
49 | }
50 |
51 |
52 |
53 | void serviceCallRemove(PaymentModel pObj) {
54 | Globs.showHUD();
55 | ServiceCall.post({"pay_id": (pObj.payId ?? 0).toString()},
56 | SVKey.svRemovePaymentMethod, isToken: true,
57 | withSuccess: (resObj) async {
58 | Globs.hideHUD();
59 | if (resObj[KKey.status] == "1") {
60 | Get.snackbar(Globs.appName, resObj[KKey.message].toString());
61 | serviceCallList();
62 | } else {}
63 | }, failure: (err) async {
64 | Globs.hideHUD();
65 | Get.snackbar(Globs.appName, err.toString());
66 | });
67 | }
68 |
69 | void setDataModel(PaymentModel pObj) {
70 | txtName.value.text = pObj.name ?? "";
71 | txtCardNumber.value.text = pObj.cardNumber ?? "";
72 | txtMonth.value.text = pObj.cardMonth ?? "";
73 | txtYear.value.text = pObj.cardYear ?? "";
74 |
75 | }
76 |
77 | void clearAll() {
78 | txtName.value.text = "";
79 | txtCardNumber.value.text = "";
80 | txtMonth.value.text = "";
81 | txtYear.value.text = "";
82 |
83 | }
84 |
85 | void serviceCallAdd(VoidCallback didDone) {
86 | if (txtName.value.text.isEmpty) {
87 | Get.snackbar(Globs.appName, "Please enter name");
88 | return;
89 | }
90 |
91 |
92 |
93 | if (txtCardNumber.value.text.length != 16) {
94 | Get.snackbar(Globs.appName, "Please enter valid card number");
95 | return;
96 | }
97 | if (txtMonth.value.text.isEmpty) {
98 | Get.snackbar(Globs.appName, "Please enter card month");
99 | return;
100 | }
101 |
102 | if (txtYear.value.text.isEmpty) {
103 | Get.snackbar(Globs.appName, "Please enter card year");
104 | return;
105 | }
106 |
107 | Globs.showHUD();
108 | ServiceCall.post({
109 | "name": txtName.value.text,
110 | "card_number": txtCardNumber.value.text,
111 | "card_month": txtMonth.value.text,
112 | "card_year": txtYear.value.text
113 |
114 | }, SVKey.svAddPaymentMethod, isToken: true, withSuccess: (resObj) async {
115 | Globs.hideHUD();
116 | if (resObj[KKey.status] == "1") {
117 | Get.snackbar(Globs.appName, resObj[KKey.message].toString());
118 | didDone();
119 | } else {}
120 | }, failure: (err) async {
121 | Globs.hideHUD();
122 | Get.snackbar(Globs.appName, err.toString());
123 | });
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/lib/view_model/product_detail_view_model.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/model/image_model.dart';
4 | import 'package:online_groceries/model/nutrition_model.dart';
5 | import 'package:online_groceries/model/offer_product_model.dart';
6 | import 'package:online_groceries/model/product_detail_model.dart';
7 |
8 | import '../common/globs.dart';
9 | import '../common/service_call.dart';
10 |
11 | class ProductDetailViewMode extends GetxController {
12 | final OfferProductModel pObj;
13 | final sProductObj = ProductDetailModel().obs;
14 | final RxList nutritionList = [].obs;
15 | final RxList imageList = [].obs;
16 | final isShowDetail = true.obs;
17 | final isShowNutrition = true.obs;
18 | final isFav = false.obs;
19 | final qty = 1.obs;
20 |
21 | ProductDetailViewMode(this.pObj) {
22 | isFav.value = pObj.isFav ?? false;
23 | }
24 |
25 | String getPrice(){
26 | return (( pObj.offerPrice ?? pObj.price ?? 0.0) * qty.value).toStringAsFixed(2);
27 | }
28 | void addSubQTY({isAdd = true} ) {
29 | if(isAdd) {
30 | qty.value = qty.value + 1;
31 |
32 | if(qty.value > 99) {
33 | qty.value = 99;
34 | }
35 | }else{
36 | qty.value = qty.value - 1;
37 |
38 | if(qty.value < 1) {
39 | qty.value = 1;
40 | }
41 | }
42 | }
43 |
44 | void showDetail(){
45 | isShowDetail.value = !isShowDetail.value;
46 | }
47 |
48 | void showNutrition() {
49 | isShowNutrition.value = !isShowNutrition.value;
50 | }
51 |
52 |
53 | @override
54 | void onInit() {
55 | // TODO: implement onInit
56 |
57 | super.onInit();
58 |
59 | serviceCallProductDetail();
60 |
61 | }
62 |
63 | //MARK ServiceCall
64 | void serviceCallProductDetail(){
65 | Globs.showHUD();
66 | ServiceCall.post({
67 | "prod_id": pObj.prodId.toString(),
68 | }, SVKey.svProductDetail, isToken: true,
69 | withSuccess: (resObj) async {
70 | Globs.hideHUD();
71 |
72 | if (resObj[KKey.status] == "1") {
73 | var payload = resObj[KKey.payload];
74 |
75 | sProductObj.value = ProductDetailModel.fromJson(payload);
76 |
77 | var nutritionDataArr = (payload["nutrition_list"] as List? ?? []).map((oObj) {
78 | return NutritionModel.fromJson(oObj);
79 | }).toList();
80 |
81 | nutritionList.value = nutritionDataArr;
82 |
83 | var imageDataArr =
84 | (payload["images"] as List? ?? []).map((oObj) {
85 | return ImageModel.fromJson(oObj);
86 | }).toList();
87 |
88 | imageList.value = imageDataArr;
89 | } else {}
90 | }, failure: (err) async {
91 | Globs.hideHUD();
92 | Get.snackbar(Globs.appName, err.toString());
93 | });
94 | }
95 |
96 | void serviceCallAddRemoveFavorite() {
97 | Globs.showHUD();
98 | ServiceCall.post({
99 | "prod_id": pObj.prodId.toString(),
100 | }, SVKey.svAddRemoveFavorite, isToken: true, withSuccess: (resObj) async {
101 | Globs.hideHUD();
102 |
103 | if (resObj[KKey.status] == "1") {
104 |
105 | isFav.value = !isFav.value;
106 | Get.snackbar(Globs.appName, resObj[KKey.message]);
107 | } else {}
108 | }, failure: (err) async {
109 | Globs.hideHUD();
110 | Get.snackbar(Globs.appName, err.toString());
111 | });
112 | }
113 |
114 | }
--------------------------------------------------------------------------------
/lib/view_model/promo_code_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:get/get.dart';
3 | import 'package:online_groceries/common/globs.dart';
4 | import 'package:online_groceries/common/service_call.dart';
5 | import '../model/promo_code_model.dart';
6 |
7 | class PromoCodeViewModel extends GetxController {
8 | final RxList listArr = [].obs;
9 |
10 | @override
11 | void onInit() {
12 | // TODO: implement onInit
13 | super.onInit();
14 |
15 | if (kDebugMode) {
16 | print("PromoCodeViewModel Init ");
17 | }
18 |
19 | serviceCalList();
20 | }
21 |
22 | //ServiceCall
23 | void serviceCalList() {
24 | Globs.showHUD();
25 | ServiceCall.post({}, SVKey.svPromoCodeList, isToken: true,
26 | withSuccess: (resObj) async {
27 | Globs.hideHUD();
28 |
29 | if (resObj[KKey.status] == "1") {
30 | var listDataArr = (resObj[KKey.payload] as List? ?? []).map((oObj) {
31 | return PromoCodeModel.fromJson(oObj);
32 | }).toList();
33 |
34 | listArr.value = listDataArr;
35 | } else {}
36 | }, failure: (err) async {
37 | Globs.hideHUD();
38 | Get.snackbar(Globs.appName, err.toString());
39 | });
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/view_model/sign_up_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:get/get.dart';
4 | import 'package:online_groceries/common/globs.dart';
5 | import 'package:online_groceries/common/service_call.dart';
6 | import 'package:online_groceries/view_model/splash_view_model.dart';
7 |
8 | class SignUpViewModel extends GetxController {
9 | final txtUsername = TextEditingController().obs;
10 | final txtEmail = TextEditingController().obs;
11 | final txtPassword = TextEditingController().obs;
12 | final isShowPassword = false.obs;
13 |
14 | final isLoading = false.obs;
15 |
16 | @override
17 | void onInit() {
18 | // TODO: implement onInit
19 | super.onInit();
20 |
21 | if (kDebugMode) {
22 | print("SignUpViewModel Init ");
23 | }
24 | txtUsername.value.text = "User1";
25 | txtEmail.value.text = "user1@gmail.com";
26 | txtPassword.value.text = "123456";
27 | }
28 |
29 | //ServiceCall
30 | void serviceCallSignUp() {
31 |
32 | if(txtUsername.value.text.isEmpty) {
33 | Get.snackbar(Globs.appName, "Pleaser enter username");
34 | return;
35 | }
36 |
37 | if ( !GetUtils.isEmail( txtEmail.value.text ) ) {
38 | Get.snackbar(Globs.appName, "Pleaser enter valid email address");
39 | return;
40 | }
41 |
42 | if (txtPassword.value.text.length < 6) {
43 | Get.snackbar(Globs.appName, "Pleaser enter valid password min 6 character");
44 | return;
45 | }
46 |
47 | Globs.showHUD();
48 |
49 | ServiceCall.post({
50 | "username": txtUsername.value.text,
51 | "email": txtEmail.value.text,
52 | "password": txtPassword.value.text,
53 | "dervice_token": ""
54 | }, SVKey.svSignUp, withSuccess: (resObj) async {
55 | Globs.hideHUD();
56 |
57 | if (resObj[KKey.status] == "1") {
58 | var payload = resObj[KKey.payload] as Map? ?? {};
59 |
60 | Globs.udSet(payload, Globs.userPayload);
61 | Globs.udBoolSet(true, Globs.userLogin);
62 |
63 |
64 | Get.delete();
65 | Get.find().goAfterLoginMainTab();
66 | } else {}
67 |
68 | Get.snackbar(Globs.appName, resObj["message"].toString());
69 | }, failure: (err) async {
70 | Globs.hideHUD();
71 | Get.snackbar(Globs.appName, err.toString());
72 | });
73 | }
74 |
75 | void showPassword() {
76 | isShowPassword.value = !isShowPassword.value;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/lib/view_model/splash_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:get/get.dart';
2 | import 'package:online_groceries/common/globs.dart';
3 | import 'package:online_groceries/view/login/welcome_view.dart';
4 | import 'package:online_groceries/view/main_tabview/main_tabview.dart';
5 |
6 | import '../model/user_payload_model.dart';
7 |
8 | class SplashViewModel extends GetxController {
9 | final userPayload = UserPayloadModel().obs;
10 |
11 | void loadView() async {
12 | await Future.delayed(const Duration(seconds: 3));
13 |
14 | if (Globs.udValueBool(Globs.userLogin)) {
15 | userPayload.value =
16 | UserPayloadModel.fromJson(Globs.udValue(Globs.userPayload));
17 | Get.to(() => const MainTabView());
18 | } else {
19 | Get.to(() => const WelcomeView());
20 | }
21 | }
22 |
23 | void goAfterLoginMainTab(){
24 | userPayload.value = UserPayloadModel.fromJson( Globs.udValue(Globs.userPayload));
25 | Get.to(() => const MainTabView() );
26 | }
27 |
28 | void setData() {
29 | userPayload.value =
30 | UserPayloadModel.fromJson(Globs.udValue(Globs.userPayload));
31 |
32 | }
33 |
34 | void logout() {
35 | userPayload.value = UserPayloadModel();
36 | Globs.udBoolSet(false, Globs.userLogin);
37 | Get.to(() => const WelcomeView());
38 | }
39 | }
40 |
--------------------------------------------------------------------------------