├── .gitignore ├── .metadata ├── .vscode └── settings.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ecommerce_major_project │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── applepay.json ├── dialog_flow_auth.json ├── dialog_flow_key.json ├── fonts │ └── Poppins │ │ ├── Poppins-Black.ttf │ │ ├── Poppins-BlackItalic.ttf │ │ ├── Poppins-Bold.ttf │ │ ├── Poppins-BoldItalic.ttf │ │ ├── Poppins-ExtraBold.ttf │ │ ├── Poppins-ExtraBoldItalic.ttf │ │ ├── Poppins-ExtraLight.ttf │ │ ├── Poppins-ExtraLightItalic.ttf │ │ ├── Poppins-Italic.ttf │ │ ├── Poppins-Light.ttf │ │ ├── Poppins-LightItalic.ttf │ │ ├── Poppins-Medium.ttf │ │ ├── Poppins-MediumItalic.ttf │ │ ├── Poppins-Regular.ttf │ │ ├── Poppins-SemiBold.ttf │ │ ├── Poppins-SemiBoldItalic.ttf │ │ ├── Poppins-Thin.ttf │ │ └── Poppins-ThinItalic.ttf ├── google_pay_config.json └── images │ ├── 4957136.jpg │ ├── License free.txt │ ├── License premium.txt │ ├── amazon_in.png │ ├── appliances-category.jpg │ ├── appliances-category.png │ ├── appliances-svg.svg │ ├── appliances.jpeg │ ├── books-category.jpg │ ├── books-svg.svg │ ├── books.jpeg │ ├── camera.png │ ├── chatbot-final.png │ ├── chatbot2.png │ ├── chatbott.jpg │ ├── croppedsuccess.gif │ ├── dealOfTheDaypng.png │ ├── electronics.jpeg │ ├── elite-without-bg.png │ ├── elite.jpg │ ├── elite.png │ ├── elite.rar │ ├── essentials-category.jpg │ ├── essentials-dark-svg.svg │ ├── essentials-svg.svg │ ├── essentials.jpeg │ ├── fashion-category.jpg │ ├── fashion-svg.svg │ ├── fashion.jpeg │ ├── gallery.png │ ├── login.svg │ ├── loginBackground.png │ ├── loginPage.png │ ├── loginSvg.svg │ ├── logo.png │ ├── mobile-svg.svg │ ├── mobiles-category.jpg │ ├── mobiles.jpeg │ ├── no-orders.png │ ├── no-orderss.png │ ├── register.svg │ ├── search-svg.svg │ ├── splash_1.png │ ├── splash_2.png │ ├── splash_3.png │ └── successpayment.JPG ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── 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-50x50@1x.png │ │ ├── Icon-App-50x50@2x.png │ │ ├── Icon-App-57x57@1x.png │ │ ├── Icon-App-57x57@2x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-72x72@1x.png │ │ ├── Icon-App-72x72@2x.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 ├── lib ├── common │ └── widgets │ │ ├── bottom_bar.dart │ │ ├── bottom_navbar.dart │ │ ├── color_loader_2.dart │ │ ├── color_loader_3.dart │ │ ├── custom_appbar.dart │ │ ├── custom_button.dart │ │ ├── custom_textfield.dart │ │ ├── loader.dart │ │ └── stars.dart ├── constants │ ├── error_handling.dart │ ├── global_variables.dart │ └── utils.dart ├── features │ ├── account │ │ ├── screens │ │ │ ├── account_screen.dart │ │ │ └── all_orders_screen.dart │ │ ├── services │ │ │ └── account_services.dart │ │ └── widgets │ │ │ ├── account_button.dart │ │ │ ├── below_app_bar.dart │ │ │ ├── orders.dart │ │ │ ├── single_product.dart │ │ │ └── top_buttons.dart │ ├── address │ │ ├── screens │ │ │ ├── address_screen.dart │ │ │ └── payment_screen.dart │ │ ├── services │ │ │ └── address_services.dart │ │ └── widgets │ │ │ └── delivery_product.dart │ ├── admin │ │ ├── models │ │ │ └── sales.dart │ │ ├── screens │ │ │ ├── add_product_screen.dart │ │ │ ├── admin_screen.dart │ │ │ ├── analytics_screen.dart │ │ │ ├── orders_screen.dart │ │ │ └── posts_screen.dart │ │ ├── services │ │ │ └── admin_services.dart │ │ └── widgets │ │ │ ├── bar_graph │ │ │ ├── bar_data.dart │ │ │ ├── bar_graph.dart │ │ │ └── individual_bar.dart │ │ │ └── sales_graph │ │ │ ├── individual_bar.dart │ │ │ ├── sales_data.dart │ │ │ └── sales_graph.dart │ ├── auth │ │ ├── screens │ │ │ └── auth_screen.dart │ │ └── services │ │ │ └── auth_service.dart │ ├── cart │ │ ├── screens │ │ │ └── cart_screen.dart │ │ ├── services │ │ │ └── cart_services.dart │ │ └── widgets │ │ │ ├── cart_product.dart │ │ │ └── cart_subtotal.dart │ ├── category_grid │ │ └── category_grid_screen.dart │ ├── chatbot │ │ ├── chatbot_screen.dart │ │ └── message_screen.dart │ ├── home │ │ ├── providers │ │ │ ├── filter_provider.dart │ │ │ └── search_provider.dart │ │ ├── screens │ │ │ ├── category_deals_screen.dart │ │ │ ├── filters_screen.dart │ │ │ ├── home_screen.dart │ │ │ ├── my_end_drawer.dart │ │ │ ├── wish_list_product.dart │ │ │ └── wish_list_screen.dart │ │ ├── services │ │ │ └── home_services.dart │ │ └── widgets │ │ │ ├── address_box.dart │ │ │ ├── carousel_image.dart │ │ │ ├── deal_of_day.dart │ │ │ └── top_categories.dart │ ├── order_details │ │ └── screens │ │ │ └── order_details_screen.dart │ ├── product_details │ │ ├── screens │ │ │ └── product_detail_screen.dart │ │ └── services │ │ │ └── product_detail_services.dart │ ├── return_product │ │ └── return_product_screen.dart │ ├── search │ │ ├── screens │ │ │ └── search_screen.dart │ │ ├── services │ │ │ └── search_services.dart │ │ └── widgets │ │ │ └── searched_product.dart │ ├── search_delegate │ │ └── my_search_screen.dart │ └── splash │ │ ├── splash_screen.dart │ │ └── widgets │ │ ├── body.dart │ │ └── splash_content.dart ├── main.dart ├── models │ ├── order.dart │ ├── product.dart │ ├── rating.dart │ ├── review.dart │ └── user.dart ├── providers │ └── user_provider.dart └── router.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── screenshots ├── GitHubRepo.svg └── new │ ├── flutter_01.png │ ├── flutter_02.png │ ├── flutter_03.png │ ├── flutter_04.png │ ├── flutter_05.png │ ├── flutter_06.png │ ├── flutter_07.png │ ├── flutter_08.jpg │ ├── flutter_09.jpg │ ├── flutter_10.png │ ├── flutter_11.png │ ├── flutter_12.png │ ├── flutter_13.png │ ├── flutter_14.png │ ├── flutter_15.png │ ├── flutter_16.png │ ├── flutter_17.png │ └── flutter_18.png ├── server ├── .gitignore ├── index.js ├── middlewares │ ├── admin.js │ └── auth.js ├── models │ ├── order.js │ ├── product.js │ ├── rating.js │ └── user.js ├── package-lock.json ├── package.json └── routes │ ├── admin.js │ ├── auth.js │ ├── product.js │ └── user.js ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.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 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 7048ed95a5ad3e43d697e0c397464193991fc230 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 17 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 18 | - platform: android 19 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 20 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 21 | - platform: ios 22 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 23 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 24 | - platform: linux 25 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 26 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 27 | - platform: macos 28 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 29 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 30 | - platform: web 31 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 32 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 33 | - platform: windows 34 | create_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 35 | base_revision: 7048ed95a5ad3e43d697e0c397464193991fc230 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.configuration.updateBuildConfiguration": "interactive" 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | ## Few Screenshots 6 | 7 | | Sign up | Sign in | 8 | | ------------------ | ------------------ | 9 | | Screenshot | Screenshot | 10 | 11 | 12 | | Home | Categories | Cart | Checkout | 13 | | ------------------ | ------------------ | ------------------ | ------------------ | 14 | | Screenshot | Screenshot | Screenshot | Screenshot | 15 | 16 | 17 | | Pay now | Payment gateway (Razorpay) | Payment success | Order placed | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | Screenshot | Screenshot | Screenshot | Screenshot | 20 | 21 | 22 | | Orders | Order details | Chatbot(1) | Chatbot(2) | 23 | | ------------------ | ------------------ | ------------------ | ------------------ | 24 | | Screenshot | Screenshot | Screenshot | Screenshot | 25 | 26 | 27 | | Profile picture | 28 | | ------------------ | 29 | | Screenshot | 30 | 31 | 32 | | Search suggestions | Search history | Search via audio | 33 | | ------------------ | ------------------ | ------------------ | 34 | | Screenshot | Screenshot | Screenshot | 35 | 36 | ## Features 37 | 38 | - User 39 | - Email and password authentication 40 | - Search | Search history | Search via Audio 41 | - Filters 42 | - Categories 43 | - Rating 44 | - Deal of the Day 45 | - Cart integration 46 | - Payment integration with Razorpay API 47 | - Chatbot (Customer Support) 48 | - Order history 49 | - Track order status 50 | - Sign out 51 | - Admin 52 | - Product Management (View | Add | Delete Products) 53 | - Order Management (View | Update Orders) 54 | - Sales Analytics (View Total Sales | Sales Graphs) 55 | 56 | ## Technologies used 57 | |**Server**| **Client** | **Database** | **SAAS (media assets)** | 58 | | ------------------ | ------------------ | ------------------ | ------------------ | 59 | | [Nodejs](https://nodejs.org/en/docs), [Expressjs](https://expressjs.com/) | [Flutter](https://docs.flutter.dev/) | [MongoDB](https://www.mongodb.com/docs/) | [Cloudinary](https://cloudinary.com/documentation) | 60 | 61 | npm packages used : [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken), [bcryptjs](https://www.npmjs.com/package/bcryptjs), [mongoose](https://www.npmjs.com/package/mongoose) 62 | 63 | Chatbot : [DialogFlow](https://cloud.google.com/dialogflow/docs) 64 | 65 | State management : [Provider](https://pub.dev/packages/provider) 66 | 67 | ___ 68 | 69 | #### I hope this repository will be helpful to flutter developers. Feel free to reach out to me in case you have any queries or feedback. 70 | -------------------------------------------------------------------------------- /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 FileNotFoundException("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 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.ecommerce_major_project" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 50 | minSdkVersion 21 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 25 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/ecommerce_major_project/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.ecommerce_major_project 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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.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 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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.2.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 | task clean(type: 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/applepay.json: -------------------------------------------------------------------------------- 1 | { 2 | "provider": "apple_pay", 3 | "data": { 4 | "merchantIdentifier": "merchant.com.sams.fish", 5 | "displayName": "Sam's Fish", 6 | "merchantCapabilities": ["3DS", "debit", "credit"], 7 | "supportedNetworks": ["amex", "visa", "discover", "masterCard"], 8 | "countryCode": "US", 9 | "currencyCode": "USD", 10 | "requiredBillingContactFields": ["post"], 11 | "requiredShippingContactFields": ["post", "phone", "email", "name"], 12 | "shippingMethods": [ 13 | { 14 | "amount": "0.00", 15 | "detail": "Available within an hour", 16 | "identifier": "in_store_pickup", 17 | "label": "In-Store Pickup" 18 | }, 19 | { 20 | "amount": "4.99", 21 | "detail": "5-8 Business Days", 22 | "identifier": "flat_rate_shipping_id_2", 23 | "label": "UPS Ground" 24 | }, 25 | { 26 | "amount": "29.99", 27 | "detail": "1-3 Business Days", 28 | "identifier": "flat_rate_shipping_id_1", 29 | "label": "FedEx Priority Mail" 30 | } 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /assets/dialog_flow_auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "service_account", 3 | "project_id": "akrchatbot-edym", 4 | "private_key_id": "64308a3548fa950535e0d79cd0eea58e8fc60043", 5 | "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDGX5jE566uV0+t\n9saa0k09F9VEOCdRO9tKPkEzcrMIyVIwlguUxz7ZGgS0JKOEOvnSWJ57lNmm6uSm\nN5BBw7w6cvwttJfiLk4RWxqQg5kpOUeU1xWr0f34nvZoyNYeqkpsVllnollZHSO7\nn3Q2guElAwerCZhnevX0XQJ+ElHIaJRT98ydH9BfWaou9WSnuRI8i+NwW5q7pgxN\nUgoDUHV2FXUWkHAgwR1WH18ABDY0wu7hN9XiHhB1u8HLbz8C0hkZy4qm9LGcqsrU\ngGnf5scdCk5HeApzM+XINhi1SQvqDE6siN1kqJR6ZcffKcn4Z1QlGmzfwWMbhbjr\n5w3g4uMXAgMBAAECggEACoB2GHqBc2ZY6AdH9VtLzn+sASwN3M2T6ubH0d7xHnZ1\n/O98lnhD2f94H0dPRslOf3XEkhtLuHv39dq8LtcbaGa89fh5D/bOmDmf+uWUnquT\nIAyQ76My1E4qElsLht0SCpE5s3RTUZXq1dx3rQkZvTlfVw0vfc7zJWglISJ8JOVY\nhR+L6yJorB1qlOqgDEOwWLpbr20QAUHyJ2HKTfZGmp3T2g7LqojLTH2yW4LpPedH\nu4wYasfvFkH3W7+mJgYp5PX5QNwmUPnBx9MwheYsDQfMWAtVe65kvS9DbmQH4eUO\nUyRJHNKs2QXlw+wj0r9yPS0MA4ZuZUkEE7wqrcnC1QKBgQDx/a+N693/fh+nMif3\nuW/KRvhxHrs0yJ9PshLaELWyfJUDVmXZ0Sva5N/1FYC/IvPGkkQA/W9EfAgj1o/y\nxWnKexk9CaLiQaEH3bFi7m/GJrpm9gk757IO8Yue/JWnTriHtbh45fpa4xot0/Bs\nMDAbKubAJA/pNQ3DZGRNlx3a/QKBgQDR239lkG9kmOjxgzmZIv0gO1NL0Y2NEbAe\nYqg+nMkhk3YBh+TOXSAseFTcFZWr6faWAPk4efZqapcNpwcTcuqCHP2fax2OfRW7\nncnMrsjyVm3oJDBhyJL2omzkg991uwXX2LOGBcLfVhZhgBIq/SMd7QKOZuFn6t2J\nFR/r3K6EowKBgGWiW4oqxylYSmkJarnjey0kk5HHC29G14o8SyilHfrh0h/9uHc8\nH8Qmnl0r88/TGTmMEt2rk4Da6vxKUFjxStZMzzPQiUWntL8+ABOB+xXpDB7UNNqh\nHCqkjjRu91e2e1AcJWc5h+WGPmeC/RYjQwEWCqYmPzx+GNK4plvkHRjtAoGAFJLZ\nTYK4ePtIswyzY+D7QeKvCtrTbsYSJxhy+Bh023bSddn1w4l7swBlCWKQVtdMFm6o\nADJsxwgGIQ+D8RMuDG19K9jbf/GhZNBWTVvBVYjFo6GQoLWCOu23kTugd7FLJFsZ\nVoVQEoclEI/2uAIzJCbtPjq11HNBHsRUadIrxdMCgYEAvg9JOTiAQafttqsqHNCi\nlW73EKrh6hNYpwLZJLtkc5dA+TCKc/02RU0lnkecUa6XLq/mMbHHN6ABpJ2vSUbm\nw7NkFbJEqV5WtXov52x4ud49GTubJjgCtj/frEl33+3z7C2GF+oBJ7ZA2MiJSXy5\ni07ZUJFLYeveoq/ROAgGuMY=\n-----END PRIVATE KEY-----\n", 6 | "client_email": "akrbot@akrchatbot-edym.iam.gserviceaccount.com", 7 | "client_id": "113917952352793857223", 8 | "auth_uri": "https://accounts.google.com/o/oauth2/auth", 9 | "token_uri": "https://oauth2.googleapis.com/token", 10 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 11 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/akrbot%40akrchatbot-edym.iam.gserviceaccount.com" 12 | } 13 | -------------------------------------------------------------------------------- /assets/dialog_flow_key.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "service_account", 3 | "project_id": "akrchatbot-edym", 4 | "private_key_id": "de2676aad2a3fde53c4933ff5e2b9ef7bbafed01", 5 | "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDDm8qYB/2XCOYl\nKQA/ETdHykYGBuGZmL0ISEL068TG37HQ/j9cBb3EP/9E3HPHKH/gSNnuTLpZ/f6b\nbO1NdMQJzgmYbC513s+dVgBAIRY9Xn6L6HvQlYfd85bcszvPdEbIWWSKiQidKtb7\njczTVOlR3T10hKliO/AMbOhLY9AP1EMrNlRZC7kA7gMJ1w4NrbeNLdA/NkItybsk\nREluZPZbAX5h6hMeSIKF6bI8DsLn4Q7Nl2MhCASdJJqwqc+9YLDhSg9W6/EnHYej\n+RUNfPAG2ww9JI3FGYsjyiIVeUc/n4/lBXEigxP83WTMJD0GtPMtztY+Vi67fVMr\nc5ts7lUJAgMBAAECggEAJe2Z2WPHQJdppK/wC8qHSQTIEhgYe2NZ1/bHAN2MYLF0\nNZ1u5KV6V8i+8ve5/VZ1gSQvGZ1IDvYIfdOfqcKn1mzcgHENiy5iXFQWJVklCk49\nxFwWUeoEl71JNc8NHFsj9Goc7B3JDUyGte0XV6zhts1qwqKMg28yyv39Bs06RS8g\n5fCwmTrE6b5gmo+n6Zsj4kLTEUD3yc1P5Ci1uUr0eVPbl7M8sdpiOYcTxmBeYegB\netMjEl/eANjcvfi19CQ7rGzeCv8h4+3ak53qEZnGA8GD+h2XEpcNwScu3upasElF\n31iyYMtPrMMBpG1TtsJOmZqLr5Jj9nWKuqIJ6nzx7wKBgQDoNPGA99UEY4plhuMw\n1ER9i66joc6/xlhtvg8rxXwCYLJEdzP4NbWffYn1rECMqUddHgdiBfOiBDWNtNZi\nS8IUqQaQJFcN7E1HkAfHCpWaFFn2R3CKM2tup96rczSJghHLkqh3fJDEATAxHLNO\noV5kFoXMt2B7JXpmXGHgka1imwKBgQDXptVCOOzZVHI5UZc3FA9goxH6hXNVgRNo\n8uwe5hGAL3JkV58uemVgXDQn0+zHEMqj2/iaLogLHGLtIwpLpw/h65lMK+uBfgEQ\nHKK2i+WUq4K2f05lVPqbb/byJ46nOZSxmqTmhSp1c9I4qaE3pLnMhtaqN1ALLpgP\nGmsdaHofKwKBgQDhx5DHELLMGKlZvIUtVkfeNrIxIsSvzYDv++wuaFAC09iiH7Gl\ndzvI/zzkZn9BBduA3BDbq+PPtf4Icjw9yWHFyu+5ucv3mrstiQs26sC51239vErd\n5c9hAdLNrC/6QEFjSo+J1tG/81PTfQ+PtfHcqdWhTvB97NwNqWf1/k+zXwKBgFyS\nlHdiAmJk+seaO8R8CwHb3qrhQJpS12c06KF298pEE+H5Ly7/gac0zXrPYZQupB5l\nHjnpgaLrY5gSc6f4JjxAK8VkESu8UG5/LGYadco1Od5nldqv+QhirupSis1ETY1U\nKjd+sLRMrNCAGOHPB6dBtsLJDcZPER1ipNqx78KTAoGBANMpWrbAUR8EGy7m/YiB\nsxLrevKiZwLngD00HncFjwrulYEusWLGsSsZ2ecr/iXwZH9hbFZsV5D6NL80hDYL\nX/gO7gbgpm4LPJFS+5dHWupGX86Ev4taHG8cESfqBu6WHVhiugiChdMuWRuvCnMj\nsdmk0pfEgxKSXZI1D2QsRrZV\n-----END PRIVATE KEY-----\n", 6 | "client_email": "akrchatbot@akrchatbot-edym.iam.gserviceaccount.com", 7 | "client_id": "112437435953281031064", 8 | "auth_uri": "https://accounts.google.com/o/oauth2/auth", 9 | "token_uri": "https://oauth2.googleapis.com/token", 10 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 11 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/akrchatbot%40akrchatbot-edym.iam.gserviceaccount.com", 12 | "universe_domain": "googleapis.com" 13 | } 14 | -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Black.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-BlackItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-ExtraBold.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-ExtraLight.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-LightItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-MediumItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-Thin.ttf -------------------------------------------------------------------------------- /assets/fonts/Poppins/Poppins-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/fonts/Poppins/Poppins-ThinItalic.ttf -------------------------------------------------------------------------------- /assets/google_pay_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "provider": "google_pay", 3 | "data": { 4 | "environment": "TEST", 5 | "apiVersion": 2, 6 | "apiVersionMinor": 0, 7 | "allowedPaymentMethods": [ 8 | { 9 | "type": "CARD", 10 | "tokenizationSpecification": { 11 | "type": "PAYMENT_GATEWAY", 12 | "parameters": { 13 | "gateway": "example", 14 | "gatewayMerchantId": "gatewayMerchantId" 15 | } 16 | }, 17 | "parameters": { 18 | "allowedCardNetworks": ["VISA", "MASTERCARD"], 19 | "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], 20 | "billingAddressRequired": true, 21 | "billingAddressParameters": { 22 | "format": "FULL", 23 | "phoneNumberRequired": true 24 | } 25 | } 26 | } 27 | ], 28 | "merchantInfo": { 29 | "merchantId": "01234567890123456789", 30 | "merchantName": "Example Merchant Name" 31 | }, 32 | "transactionInfo": { 33 | "countryCode": "US", 34 | "currencyCode": "USD" 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /assets/images/4957136.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/4957136.jpg -------------------------------------------------------------------------------- /assets/images/License free.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT NOTICE: This license only applies if you downloaded this content as 2 | an unsubscribed user. If you are a premium user (ie, you pay a subscription) 3 | you are bound to the license terms described in the accompanying file 4 | "License premium.txt". 5 | 6 | --------------------- 7 | 8 | You must attribute the image to its author: 9 | 10 | In order to use a content or a part of it, you must attribute it to / Freepik, 11 | so we will be able to continue creating new graphic resources every day. 12 | 13 | 14 | How to attribute it? 15 | 16 | For websites: 17 | 18 | Please, copy this code on your website to accredit the author: 19 | Designed by / Freepik 20 | 21 | For printing: 22 | 23 | Paste this text on the final work so the authorship is known. 24 | - For example, in the acknowledgements chapter of a book: 25 | "Designed by / Freepik" 26 | 27 | 28 | You are free to use this image: 29 | 30 | - For both personal and commercial projects and to modify it. 31 | - In a website or presentation template or application or as part of your design. 32 | 33 | You are not allowed to: 34 | 35 | - Sub-license, resell or rent it. 36 | - Include it in any online or offline archive or database. 37 | 38 | The full terms of the license are described in section 7 of the Freepik 39 | terms of use, available online in the following link: 40 | 41 | http://www.freepik.com/terms_of_use 42 | 43 | The terms described in the above link have precedence over the terms described 44 | in the present document. In case of disagreement, the Freepik Terms of Use 45 | will prevail. 46 | -------------------------------------------------------------------------------- /assets/images/License premium.txt: -------------------------------------------------------------------------------- 1 | IMPORTANT NOTICE: This license only applies if you downloaded this content as 2 | a subscribed (or "premium") user. If you are an unsubscribed user (or "free" 3 | user) you are bound to the license terms described in the accompanying file 4 | "License free.txt". 5 | 6 | --------------------- 7 | 8 | You can download from your profile in Freepik a personalized license stating 9 | your right to use this content as a "premium" user: 10 | 11 | https://profile.freepik.com/my_downloads 12 | 13 | You are free to use this image: 14 | 15 | - For both personal and commercial projects and to modify it. 16 | - In a website or presentation template or application or as part of your design. 17 | 18 | You are not allowed to: 19 | 20 | - Sub-license, resell or rent it. 21 | - Include it in any online or offline archive or database. 22 | 23 | The full terms of the license are described in sections 7 and 8 of the Freepik 24 | terms of use, available online in the following link: 25 | 26 | http://www.freepik.com/terms_of_use 27 | 28 | The terms described in the above link have precedence over the terms described 29 | in the present document. In case of disagreement, the Freepik Terms of Use 30 | will prevail. 31 | -------------------------------------------------------------------------------- /assets/images/amazon_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/amazon_in.png -------------------------------------------------------------------------------- /assets/images/appliances-category.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/appliances-category.jpg -------------------------------------------------------------------------------- /assets/images/appliances-category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/appliances-category.png -------------------------------------------------------------------------------- /assets/images/appliances-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/images/appliances.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/appliances.jpeg -------------------------------------------------------------------------------- /assets/images/books-category.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/books-category.jpg -------------------------------------------------------------------------------- /assets/images/books-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | books 5 | 6 | -------------------------------------------------------------------------------- /assets/images/books.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/books.jpeg -------------------------------------------------------------------------------- /assets/images/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/camera.png -------------------------------------------------------------------------------- /assets/images/chatbot-final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/chatbot-final.png -------------------------------------------------------------------------------- /assets/images/chatbot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/chatbot2.png -------------------------------------------------------------------------------- /assets/images/chatbott.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/chatbott.jpg -------------------------------------------------------------------------------- /assets/images/croppedsuccess.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/croppedsuccess.gif -------------------------------------------------------------------------------- /assets/images/dealOfTheDaypng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/dealOfTheDaypng.png -------------------------------------------------------------------------------- /assets/images/electronics.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/electronics.jpeg -------------------------------------------------------------------------------- /assets/images/elite-without-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/elite-without-bg.png -------------------------------------------------------------------------------- /assets/images/elite.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/elite.jpg -------------------------------------------------------------------------------- /assets/images/elite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/elite.png -------------------------------------------------------------------------------- /assets/images/elite.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/elite.rar -------------------------------------------------------------------------------- /assets/images/essentials-category.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/essentials-category.jpg -------------------------------------------------------------------------------- /assets/images/essentials-dark-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/images/essentials-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/images/essentials.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/essentials.jpeg -------------------------------------------------------------------------------- /assets/images/fashion-category.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/fashion-category.jpg -------------------------------------------------------------------------------- /assets/images/fashion-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /assets/images/fashion.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/fashion.jpeg -------------------------------------------------------------------------------- /assets/images/gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/gallery.png -------------------------------------------------------------------------------- /assets/images/loginBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/loginBackground.png -------------------------------------------------------------------------------- /assets/images/loginPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/loginPage.png -------------------------------------------------------------------------------- /assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/logo.png -------------------------------------------------------------------------------- /assets/images/mobile-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/images/mobiles-category.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/mobiles-category.jpg -------------------------------------------------------------------------------- /assets/images/mobiles.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/mobiles.jpeg -------------------------------------------------------------------------------- /assets/images/no-orders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/no-orders.png -------------------------------------------------------------------------------- /assets/images/no-orderss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/no-orderss.png -------------------------------------------------------------------------------- /assets/images/search-svg.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/images/splash_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/splash_1.png -------------------------------------------------------------------------------- /assets/images/splash_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/splash_2.png -------------------------------------------------------------------------------- /assets/images/splash_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/splash_3.png -------------------------------------------------------------------------------- /assets/images/successpayment.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/assets/images/successpayment.JPG -------------------------------------------------------------------------------- /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 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /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 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/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 | eSHOP 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ecommerce_major_project 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 | NSPhotoLibraryUsageDescription 51 | App needs access to the photo library 52 | 53 | 54 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/common/widgets/custom_appbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/main.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_svg/flutter_svg.dart'; 4 | 5 | // class CustomAppbar { 6 | // static AppBar customAppbar = AppBar( 7 | // iconTheme: const IconThemeData(color: Colors.black), 8 | // // automaticallyImplyLeading: true, 9 | // leading: Padding( 10 | // padding: EdgeInsets.all(mq.width * .025).copyWith(right: 0), 11 | // child: Image.asset( 12 | // "assets/images/logo.png", 13 | // // height: 5, 14 | // // height: mq.height * .04, 15 | // ), 16 | // ), 17 | // backgroundColor: Colors.white, 18 | // elevation: 2, 19 | // actions: [ 20 | // Padding( 21 | // padding: EdgeInsets.only(right: mq.width * 0.035), 22 | // child: Row( 23 | // mainAxisSize: MainAxisSize.min, 24 | // children: [ 25 | // InkWell( 26 | // onTap: () { 27 | // setState(() { 28 | // isSearchOn = true; 29 | // }); 30 | // showSearch( 31 | // context: context, 32 | // delegate: MySearchDelegate(searchResults: productNames!)); 33 | // }, 34 | // child: 35 | // SvgPicture.asset("assets/images/search-svg.svg", height: 25), 36 | // ), 37 | // SizedBox(width: mq.width * .04), 38 | // InkWell( 39 | // onTap: () { 40 | // // Scaffold.of(context).openDrawer(); 41 | // // _scaffoldKey.currentState!.openEndDrawer(); 42 | // }, 43 | // child: const Icon(Icons.mic, size: 30)), 44 | // ], 45 | // ), 46 | // ), 47 | // ], 48 | // ); 49 | // } 50 | -------------------------------------------------------------------------------- /lib/common/widgets/custom_button.dart: -------------------------------------------------------------------------------- 1 | import '/main.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class CustomButton extends StatelessWidget { 5 | final String text; 6 | final Color? color; 7 | final VoidCallback onTap; 8 | const CustomButton( 9 | {super.key, required this.text, required this.onTap, this.color}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return ElevatedButton( 14 | onPressed: onTap, 15 | style: ElevatedButton.styleFrom( 16 | splashFactory: NoSplash.splashFactory, 17 | minimumSize: Size(double.infinity, mq.height * .08), 18 | backgroundColor: color, 19 | ), 20 | child: Text( 21 | text, 22 | style: TextStyle(color: Colors.black), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/common/widgets/custom_textfield.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTextField extends StatelessWidget { 4 | final TextEditingController controller; 5 | final String hintText; 6 | final int maxLines; 7 | bool? isObscureText; 8 | TextInputType inputType; 9 | CustomTextField({ 10 | super.key, 11 | required this.controller, 12 | required this.hintText, 13 | this.maxLines = 1, 14 | this.isObscureText = false, 15 | this.inputType = TextInputType.text, 16 | }); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return TextFormField( 21 | cursorColor: Colors.black, 22 | controller: controller, 23 | maxLines: maxLines, 24 | obscureText: isObscureText!, 25 | keyboardType: inputType, 26 | decoration: InputDecoration( 27 | filled: true, 28 | fillColor: const Color.fromARGB(255, 236, 236, 236), 29 | hintText: hintText, 30 | border: OutlineInputBorder( 31 | borderRadius: BorderRadius.circular(12), 32 | borderSide: BorderSide.none, 33 | ), 34 | enabledBorder: OutlineInputBorder( 35 | borderRadius: BorderRadius.circular(12), 36 | borderSide: BorderSide(width: 0.8, color: Colors.grey.shade800), 37 | ), 38 | focusedBorder: OutlineInputBorder( 39 | borderRadius: BorderRadius.circular(12), 40 | borderSide: BorderSide(width: 0.25), 41 | ), 42 | ), 43 | validator: (val) { 44 | if (val == null || val.isEmpty) { 45 | return '$hintText required'; 46 | } 47 | return null; 48 | }, 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/common/widgets/loader.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Loader extends StatelessWidget { 4 | const Loader({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Center(child: CircularProgressIndicator(color: Colors.black)); 9 | } 10 | } 11 | 12 | //loader dialog 13 | // import 'package:flutter/material.dart'; 14 | 15 | // showLoader(BuildContext context) { 16 | // return showDialog( 17 | // context: context, 18 | // //user cannot interrupt the loader 19 | // barrierDismissible: false, 20 | // builder: (BuildContext context) { 21 | // return const Center( 22 | // child: CircularProgressIndicator( 23 | // valueColor: AlwaysStoppedAnimation(Colors.blue), 24 | // ), 25 | // ); 26 | // }); 27 | // } 28 | -------------------------------------------------------------------------------- /lib/common/widgets/stars.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_rating_bar/flutter_rating_bar.dart'; 4 | 5 | class Stars extends StatelessWidget { 6 | final double rating; 7 | const Stars({required this.rating, super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return RatingBarIndicator( 12 | itemCount: 5, 13 | direction: Axis.horizontal, 14 | rating: rating, 15 | itemSize: 15, 16 | itemBuilder: (context, index) { 17 | return const Icon( 18 | Icons.star, 19 | color: GlobalVariables.secondaryColor, 20 | ); 21 | }, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/constants/error_handling.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import '/constants/utils.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:http/http.dart' as http; 5 | 6 | void httpErrorHandle({ 7 | required http.Response response, 8 | required BuildContext context, 9 | required VoidCallback onSuccess, 10 | }) { 11 | switch (response.statusCode) { 12 | //Successful responses (200 – 299) 13 | //200 OK 14 | case 200: 15 | onSuccess(); 16 | break; 17 | 18 | //decoding response.body to String 19 | //Client error responses (400 – 499) 20 | //400 Bad Request 21 | case 400: 22 | showSnackBar(context: context, text: jsonDecode(response.body)['msg']); 23 | break; 24 | 25 | //Server error responses (500 – 599) 26 | //500 Internal Serveer Error 27 | case 500: 28 | showSnackBar(context: context, text: jsonDecode(response.body)['error']); 29 | break; 30 | 31 | default: 32 | showSnackBar(context: context, text: response.body); 33 | break; 34 | } 35 | } 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | // import 'dart:convert'; 44 | // import 'package:ecommerce_major_project/constants/utils.dart'; 45 | // import 'package:flutter/material.dart'; 46 | // import 'package:http/http.dart' as http; 47 | 48 | // void httpErrorHandle({ 49 | // required http.Response response, 50 | // required BuildContext context, 51 | // required VoidCallback onSuccess, 52 | // }) { 53 | // switch (response.statusCode) { 54 | // case 200: 55 | // onSuccess(); 56 | // break; 57 | // case 400: 58 | // //decoding response.body to String 59 | // showSnackBar(context: context, text: jsonDecode(response.body)['msg']); 60 | // break; 61 | // case 500: 62 | // showSnackBar(context: context, text: jsonDecode(response.body)['error']); 63 | // break; 64 | // default: 65 | // showSnackBar(context: context, text: response.body); 66 | // break; 67 | // } 68 | // } 69 | 70 | 71 | -------------------------------------------------------------------------------- /lib/constants/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:file_picker/file_picker.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'dart:io'; 4 | 5 | void showSnackBar({ 6 | required BuildContext context, 7 | required String text, 8 | VoidCallback? onTapFunction, 9 | String? actionLabel, 10 | }) { 11 | ScaffoldMessenger.of(context).showSnackBar( 12 | onTapFunction != null && actionLabel != null 13 | ? SnackBar( 14 | content: Text(text), 15 | action: SnackBarAction( 16 | label: actionLabel, 17 | textColor: Colors.white, 18 | onPressed: onTapFunction, 19 | ), 20 | behavior: SnackBarBehavior.floating, 21 | backgroundColor: const Color(0xFF7700C6), 22 | ) 23 | : SnackBar( 24 | content: Text(text), 25 | behavior: SnackBarBehavior.floating, 26 | backgroundColor: const Color(0xFF7700C6), 27 | ), 28 | ); 29 | } 30 | 31 | void showErrorSnackBar({ 32 | required BuildContext context, 33 | required String text, 34 | VoidCallback? onTapFunction, 35 | String? actionLabel, 36 | }) { 37 | ScaffoldMessenger.of(context).showSnackBar( 38 | onTapFunction != null && actionLabel != null 39 | ? SnackBar( 40 | content: Text(text), 41 | action: SnackBarAction( 42 | label: actionLabel, 43 | textColor: Colors.white, 44 | onPressed: onTapFunction, 45 | ), 46 | behavior: SnackBarBehavior.floating, 47 | backgroundColor: Color.fromARGB(255, 252, 30, 100), 48 | ) 49 | : SnackBar( 50 | content: Text(text), 51 | behavior: SnackBarBehavior.floating, 52 | backgroundColor: Color.fromARGB(255, 252, 30, 100), 53 | ), 54 | ); 55 | } 56 | 57 | // void showSnackBar(BuildContext context, String msg, Duration passDuration) { 58 | // ScaffoldMessenger.of(context).showSnackBar(SnackBar( 59 | // content: Text(msg), 60 | // duration: passDuration, 61 | // behavior: SnackBarBehavior.floating, 62 | // backgroundColor: const Color(0xFF7700C6), 63 | // //Text Copied snackbar(in message_card bottomsheet) color : const Color(0xFFA841FC) 64 | // )); 65 | // } 66 | 67 | Future> pickImages() async { 68 | List images = []; 69 | 70 | try { 71 | FilePickerResult? files = await FilePicker.platform.pickFiles( 72 | type: FileType.image, 73 | allowMultiple: true, 74 | ); 75 | 76 | if (files != null && files.files.isNotEmpty) { 77 | for (int i = 0; i < files.files.length; i++) { 78 | images.add(File(files.files[i].path!)); 79 | } 80 | } 81 | } catch (e) { 82 | debugPrint("Error in picking image : ${e.toString()}"); 83 | } 84 | 85 | return images; 86 | } 87 | 88 | Future pickImage() async { 89 | File image = File(""); 90 | 91 | try { 92 | FilePickerResult? file = 93 | await FilePicker.platform.pickFiles(type: FileType.image); 94 | 95 | image = File(file!.files[0].path!); 96 | 97 | if (file.files.isNotEmpty) { 98 | image = File(file.files[0].path!); 99 | } 100 | } catch (e) { 101 | debugPrint("Error in picking image : ${e.toString()}"); 102 | } 103 | 104 | return image; 105 | } 106 | -------------------------------------------------------------------------------- /lib/features/account/screens/account_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 4 | import 'package:ecommerce_major_project/features/account/widgets/below_app_bar.dart'; 5 | import 'package:ecommerce_major_project/features/account/widgets/orders.dart'; 6 | import 'package:ecommerce_major_project/features/account/widgets/top_buttons.dart'; 7 | import 'package:ecommerce_major_project/features/chatbot/chatbot_screen.dart'; 8 | import 'package:ecommerce_major_project/features/search_delegate/my_search_screen.dart'; 9 | import 'package:ecommerce_major_project/main.dart'; 10 | 11 | class AccountScreen extends StatelessWidget { 12 | const AccountScreen({super.key}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | appBar: GlobalVariables.getAppBar( 18 | context: context, 19 | wantBackNavigation: false, 20 | title: "Your Account", 21 | onClickSearchNavigateTo: MySearchScreen()), 22 | body: Column( 23 | children: [ 24 | SizedBox(height: mq.width * .025), 25 | const BelowAppBar(), 26 | SizedBox(height: mq.width * .025), 27 | TopButtons(), 28 | SizedBox(height: mq.width * .045), 29 | const Orders(), 30 | ], 31 | ), 32 | floatingActionButton: FloatingActionButton.extended( 33 | elevation: 10, 34 | icon: Icon(Icons.chat_bubble_outline_outlined), 35 | onPressed: () { 36 | Navigator.of(context) 37 | .push(MaterialPageRoute(builder: (_) => ChatbotScreen())); 38 | }, 39 | backgroundColor: Colors.deepPurple.shade600, 40 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), 41 | label: Text("Ask buddy", style: TextStyle(fontSize: 12)), 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/features/account/widgets/account_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '/main.dart'; 3 | 4 | //account page buttons 5 | class AccountButton extends StatelessWidget { 6 | final String text; 7 | final VoidCallback onTap; 8 | const AccountButton({super.key, required this.text, required this.onTap}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Expanded( 13 | child: Container( 14 | height: mq.height * .06, 15 | margin: EdgeInsets.symmetric(horizontal: mq.width * .025), 16 | decoration: BoxDecoration( 17 | borderRadius: BorderRadius.circular(mq.height * .06), 18 | ), 19 | child: OutlinedButton( 20 | onPressed: onTap, 21 | style: OutlinedButton.styleFrom( 22 | backgroundColor: Colors.black12.withOpacity(.03), 23 | shape: RoundedRectangleBorder( 24 | borderRadius: BorderRadius.circular(mq.height * .06), 25 | )), 26 | child: Text( 27 | text, 28 | style: const TextStyle(color: Colors.black), 29 | ), 30 | ), 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/features/account/widgets/single_product.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/main.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SingleProduct extends StatelessWidget { 5 | final String image; 6 | SingleProduct({super.key, required this.image}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric(horizontal: mq.width * .0125), 12 | child: DecoratedBox( 13 | decoration: BoxDecoration( 14 | border: Border.all(color: Colors.black12, width: 1.5), 15 | borderRadius: BorderRadius.circular(mq.width * .0125), 16 | color: Colors.white), 17 | child: Container( 18 | width: mq.width * .45, 19 | padding: EdgeInsets.all(mq.width * .025), 20 | child: Image.network( 21 | image, 22 | fit: BoxFit.fitHeight, 23 | width: mq.width * .45, 24 | ), 25 | ), 26 | )); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/features/address/services/address_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'package:provider/provider.dart'; 6 | 7 | import 'package:ecommerce_major_project/models/user.dart'; 8 | import 'package:ecommerce_major_project/constants/utils.dart'; 9 | import 'package:ecommerce_major_project/providers/user_provider.dart'; 10 | import 'package:ecommerce_major_project/constants/error_handling.dart'; 11 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 12 | 13 | class AddressServices { 14 | void saveUserAddress({ 15 | required BuildContext context, 16 | required String address, 17 | }) async { 18 | final userProvider = Provider.of(context, listen: false); 19 | 20 | try { 21 | http.Response res = await http.post( 22 | Uri.parse('$uri/api/save-user-address'), 23 | headers: { 24 | 'Content-Type': 'application/json; charset=UTF-8', 25 | 'x-auth-token': userProvider.user.token, 26 | }, 27 | body: jsonEncode({ 28 | 'address': address, 29 | }), 30 | // body: product.toJson(), 31 | ); 32 | 33 | if (context.mounted) { 34 | httpErrorHandle( 35 | response: res, 36 | context: context, 37 | onSuccess: () { 38 | User user = userProvider.user 39 | .copyWith(address: jsonDecode(res.body)['address']); 40 | userProvider.setUserFromModel(user); 41 | Navigator.pop(context); 42 | }, 43 | ); 44 | } 45 | } catch (e) { 46 | showSnackBar(context: context, text: e.toString()); 47 | } 48 | } 49 | 50 | // get all the products 51 | void placeOrder({ 52 | required BuildContext context, 53 | required String address, 54 | required num totalSum, 55 | }) async { 56 | final userProvider = Provider.of(context, listen: false); 57 | 58 | try { 59 | http.Response res = await http.post( 60 | Uri.parse('$uri/api/order'), 61 | headers: { 62 | 'Content-Type': 'application/json; charset=UTF-8', 63 | 'x-auth-token': userProvider.user.token, 64 | }, 65 | body: jsonEncode({ 66 | 'cart': userProvider.user.cart, 67 | 'address': address, 68 | 'totalPrice': totalSum, 69 | }), 70 | ); 71 | 72 | // var data = jsonDecode(res.body); 73 | if (context.mounted) { 74 | httpErrorHandle( 75 | response: res, 76 | context: context, 77 | onSuccess: () { 78 | // success on the payment will redirect the user 79 | // to the payment successful dialog, order placed 80 | // clear the cart 81 | // and add the address as the current address if one didn't exist before 82 | // add the payment successful dialog here! 83 | // the gif and showDialog 84 | showSnackBar(context: context, text: "Your order has been placed"); 85 | User user = userProvider.user.copyWith( 86 | cart: [], 87 | ); 88 | userProvider.setUserFromModel(user); 89 | }, 90 | ); 91 | } 92 | } catch (e) { 93 | showSnackBar(context: context, text: e.toString()); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/features/address/widgets/delivery_product.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import 'package:ecommerce_major_project/main.dart'; 5 | import 'package:ecommerce_major_project/models/product.dart'; 6 | import 'package:ecommerce_major_project/providers/user_provider.dart'; 7 | import 'package:ecommerce_major_project/features/cart/services/cart_services.dart'; 8 | import 'package:ecommerce_major_project/features/product_details/services/product_detail_services.dart'; 9 | 10 | class DeliveryProduct extends StatefulWidget { 11 | final int index; 12 | const DeliveryProduct({required this.index, super.key}); 13 | 14 | @override 15 | State createState() => _DeliveryProductState(); 16 | } 17 | 18 | class _DeliveryProductState extends State { 19 | final ProductDetailServices productDetailServices = ProductDetailServices(); 20 | final CartServices cartServices = CartServices(); 21 | 22 | void increaseQuantity(Product product) { 23 | productDetailServices.addToCart(context: context, product: product); 24 | } 25 | 26 | void decreaseQuantity(Product product) { 27 | cartServices.removeFromCart(context: context, product: product); 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | // fetching the particular product 33 | final productCart = context.watch().user.cart[widget.index]; 34 | final product = Product.fromJson(productCart['product']); 35 | final quantity = productCart['quantity']; 36 | 37 | return Row( 38 | mainAxisAlignment: MainAxisAlignment.center, 39 | children: [ 40 | // image 41 | Image.network( 42 | product.images[0], 43 | fit: BoxFit.contain, 44 | height: mq.width * .25, 45 | width: mq.width * .25, 46 | ), 47 | // description 48 | Column( 49 | children: [ 50 | Container( 51 | width: mq.width * .57, 52 | padding: 53 | EdgeInsets.only(left: mq.width * .025, top: mq.width * .0125), 54 | child: Text( 55 | product.name, 56 | textAlign: TextAlign.left, 57 | overflow: TextOverflow.ellipsis, 58 | style: const TextStyle(fontSize: 15), 59 | maxLines: 1, 60 | ), 61 | ), 62 | Container( 63 | width: mq.width * .57, 64 | padding: EdgeInsets.only(left: mq.width * .025), 65 | child: Text( 66 | "₹ ${product.price.toStringAsFixed(2)}", 67 | style: 68 | const TextStyle(fontWeight: FontWeight.bold, fontSize: 17), 69 | maxLines: 2, 70 | ), 71 | ), 72 | Container( 73 | width: mq.width * .57, 74 | padding: EdgeInsets.only(left: mq.width * .025), 75 | child: Text( 76 | product.price < 500 77 | ? "Shipping charges might apply" 78 | : "Eligible for free shipping", 79 | style: const TextStyle(fontSize: 13), 80 | ), 81 | ), 82 | ], 83 | ), 84 | ], 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/features/admin/models/sales.dart: -------------------------------------------------------------------------------- 1 | class Sales { 2 | final String label; 3 | final num earning; 4 | 5 | Sales(this.label, this.earning); 6 | } 7 | -------------------------------------------------------------------------------- /lib/features/admin/screens/admin_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 4 | import 'package:ecommerce_major_project/features/admin/screens/posts_screen.dart'; 5 | import 'package:ecommerce_major_project/features/admin/screens/orders_screen.dart'; 6 | import 'package:ecommerce_major_project/features/admin/screens/analytics_screen.dart'; 7 | 8 | class AdminScreen extends StatefulWidget { 9 | const AdminScreen({super.key}); 10 | 11 | @override 12 | State createState() => _AdminScreenState(); 13 | } 14 | 15 | class _AdminScreenState extends State { 16 | int _page = 0; 17 | double bottomBarWidth = 42; 18 | double bottomBarBorderWidth = 5; 19 | 20 | List pages = [ 21 | const PostsScreen(), 22 | const AnalyticsScreen(), 23 | const OrdersScreen(), 24 | ]; 25 | 26 | void updatePage(int page) { 27 | setState(() { 28 | _page = page; 29 | }); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | // print( 35 | // "Type of user ==========> ${Provider.of(context).user.type}"); 36 | return Scaffold( 37 | body: pages[_page], 38 | bottomNavigationBar: BottomNavigationBar( 39 | currentIndex: _page, 40 | selectedItemColor: GlobalVariables.selectedNavBarColor, 41 | unselectedItemColor: GlobalVariables.unselectedNavBarColor, 42 | backgroundColor: GlobalVariables.backgroundColor, 43 | iconSize: 28, 44 | onTap: updatePage, 45 | items: [ 46 | //POSTS 47 | BottomNavigationBarItem( 48 | icon: Container( 49 | width: bottomBarWidth, 50 | decoration: BoxDecoration( 51 | border: Border( 52 | top: BorderSide( 53 | color: _page == 0 54 | ? GlobalVariables.selectedNavBarColor 55 | : GlobalVariables.backgroundColor, 56 | width: bottomBarBorderWidth), 57 | ), 58 | ), 59 | child: const Icon(Icons.home_outlined), 60 | ), 61 | label: '', 62 | ), 63 | //ANALYTICS 64 | BottomNavigationBarItem( 65 | icon: Container( 66 | width: bottomBarWidth, 67 | decoration: BoxDecoration( 68 | border: Border( 69 | top: BorderSide( 70 | color: _page == 1 71 | ? GlobalVariables.selectedNavBarColor 72 | : GlobalVariables.backgroundColor, 73 | width: bottomBarBorderWidth), 74 | ), 75 | ), 76 | child: const Icon(Icons.analytics_outlined), 77 | ), 78 | label: '', 79 | ), 80 | //ORDERS 81 | BottomNavigationBarItem( 82 | icon: Container( 83 | width: bottomBarWidth, 84 | decoration: BoxDecoration( 85 | border: Border( 86 | top: BorderSide( 87 | color: _page == 2 88 | ? GlobalVariables.selectedNavBarColor 89 | : GlobalVariables.backgroundColor, 90 | width: bottomBarBorderWidth), 91 | ), 92 | ), 93 | child: const Icon(Icons.all_inbox_outlined), 94 | ), 95 | label: '', 96 | ), 97 | ], 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/features/admin/screens/orders_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/common/widgets/color_loader_2.dart'; 2 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 3 | import 'package:ecommerce_major_project/features/account/services/account_services.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import 'package:ecommerce_major_project/main.dart'; 7 | import 'package:ecommerce_major_project/models/order.dart'; 8 | import 'package:ecommerce_major_project/common/widgets/loader.dart'; 9 | import 'package:ecommerce_major_project/features/admin/services/admin_services.dart'; 10 | import 'package:ecommerce_major_project/features/account/widgets/single_product.dart'; 11 | import 'package:ecommerce_major_project/features/order_details/screens/order_details_screen.dart'; 12 | 13 | class OrdersScreen extends StatefulWidget { 14 | const OrdersScreen({super.key}); 15 | 16 | @override 17 | State createState() => _OrdersScreenState(); 18 | } 19 | 20 | class _OrdersScreenState extends State { 21 | final AdminServices adminServices = AdminServices(); 22 | List? orders; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | fetchAllOrders(); 28 | } 29 | 30 | void fetchAllOrders() async { 31 | orders = await adminServices.fetchAllOrders(context); 32 | setState(() {}); 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | appBar: GlobalVariables.getAdminAppBar( 39 | title: "Orders", 40 | context: context, 41 | ), 42 | body: orders == null 43 | ? const ColorLoader2() 44 | : GridView.builder( 45 | padding: EdgeInsets.all(10), 46 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( 47 | mainAxisSpacing: 10, 48 | childAspectRatio: 1.75, 49 | crossAxisCount: 2), 50 | itemCount: orders!.length, 51 | itemBuilder: (context, index) { 52 | final orderData = orders![index]; 53 | return GestureDetector( 54 | onTap: () { 55 | Navigator.pushNamed(context, OrderDetailsScreen.routeName, 56 | arguments: orderData); 57 | }, 58 | child: SizedBox( 59 | height: mq.height * .18, 60 | child: 61 | SingleProduct(image: orderData.products[0].images[0]), 62 | ), 63 | ); 64 | }, 65 | ), 66 | floatingActionButton: FloatingActionButton.extended( 67 | elevation: 10, 68 | icon: Icon(Icons.logout_outlined), 69 | onPressed: () { 70 | AccountServices().logOut(context); 71 | }, 72 | backgroundColor: Colors.deepPurple.shade600, 73 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)), 74 | label: Text( 75 | "LogOut", 76 | style: TextStyle(fontSize: 12), 77 | ), 78 | ), 79 | ); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/features/admin/widgets/bar_graph/bar_data.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | import 'package:ecommerce_major_project/features/admin/widgets/bar_graph/individual_bar.dart'; 3 | 4 | class BarData { 5 | final double sunAmount; 6 | final double monAmount; 7 | final double tueAmount; 8 | final double wedAmount; 9 | final double thuAmount; 10 | final double friAmount; 11 | final double satAmount; 12 | BarData({ 13 | required this.sunAmount, 14 | required this.monAmount, 15 | required this.tueAmount, 16 | required this.wedAmount, 17 | required this.thuAmount, 18 | required this.friAmount, 19 | required this.satAmount, 20 | }); 21 | 22 | List barData = []; 23 | 24 | void initializeBar() { 25 | barData = [ 26 | IndividualBar(x: 0, y: sunAmount), 27 | IndividualBar(x: 0, y: monAmount), 28 | IndividualBar(x: 0, y: tueAmount), 29 | IndividualBar(x: 0, y: wedAmount), 30 | IndividualBar(x: 0, y: thuAmount), 31 | IndividualBar(x: 0, y: friAmount), 32 | IndividualBar(x: 0, y: satAmount), 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/features/admin/widgets/bar_graph/bar_graph.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:fl_chart/fl_chart.dart'; 3 | 4 | import 'package:ecommerce_major_project/features/admin/widgets/bar_graph/bar_data.dart'; 5 | 6 | class MyBarGraph extends StatelessWidget { 7 | final List weeklySummary; 8 | const MyBarGraph({super.key, required this.weeklySummary}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | BarData myBarData = BarData( 13 | sunAmount: weeklySummary[0], 14 | monAmount: weeklySummary[1], 15 | tueAmount: weeklySummary[2], 16 | wedAmount: weeklySummary[3], 17 | thuAmount: weeklySummary[4], 18 | friAmount: weeklySummary[5], 19 | satAmount: weeklySummary[6], 20 | ); 21 | 22 | myBarData.initializeBar(); 23 | 24 | return BarChart( 25 | BarChartData( 26 | maxY: 200, 27 | minY: 0, 28 | barGroups: myBarData.barData 29 | .map((data) => BarChartGroupData( 30 | x: data.x, barRods: [BarChartRodData(toY: data.y)])) 31 | .toList(), 32 | ), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/features/admin/widgets/bar_graph/individual_bar.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | class IndividualBar { 3 | final int x; // for x axis 4 | final double y; // for y axis 5 | 6 | IndividualBar({ 7 | required this.x, 8 | required this.y, 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /lib/features/admin/widgets/sales_graph/individual_bar.dart: -------------------------------------------------------------------------------- 1 | class IndividualBar { 2 | final String label; 3 | final num earnings; 4 | IndividualBar({ 5 | required this.label, 6 | required this.earnings, 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /lib/features/admin/widgets/sales_graph/sales_data.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | import 'package:ecommerce_major_project/features/admin/widgets/sales_graph/individual_bar.dart'; 3 | 4 | class SalesData { 5 | final num mobileSales; 6 | final num essentialsSales; 7 | final num booksSales; 8 | final num appliancesSales; 9 | final num fashionSales; 10 | SalesData({ 11 | required this.mobileSales, 12 | required this.essentialsSales, 13 | required this.booksSales, 14 | required this.appliancesSales, 15 | required this.fashionSales, 16 | }); 17 | 18 | List salesBarData = []; 19 | 20 | void initializeBar() { 21 | salesBarData = [ 22 | IndividualBar(earnings: double.parse(mobileSales.toString()), label: '0'), 23 | IndividualBar( 24 | earnings: double.parse(essentialsSales.toString()), label: '1'), 25 | IndividualBar(earnings: double.parse(booksSales.toString()), label: '2'), 26 | IndividualBar( 27 | earnings: double.parse(appliancesSales.toString()), label: '3'), 28 | IndividualBar( 29 | earnings: double.parse(fashionSales.toString()), label: '4'), 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/features/cart/services/cart_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'package:provider/provider.dart'; 6 | 7 | import 'package:ecommerce_major_project/models/user.dart'; 8 | import 'package:ecommerce_major_project/models/product.dart'; 9 | import 'package:ecommerce_major_project/constants/utils.dart'; 10 | import 'package:ecommerce_major_project/providers/user_provider.dart'; 11 | import 'package:ecommerce_major_project/constants/error_handling.dart'; 12 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 13 | 14 | class CartServices { 15 | void removeFromCart({ 16 | required BuildContext context, 17 | required Product product, 18 | }) async { 19 | print("========> Inside the remove from cart function"); 20 | final userProvider = Provider.of(context, listen: false); 21 | try { 22 | http.Response res = await http.delete( 23 | Uri.parse( 24 | '$uri/api/remove-from-cart/${product.id}', 25 | ), 26 | headers: { 27 | 'Content-Type': 'application/json; charset=UTF-8', 28 | 'x-auth-token': userProvider.user.token, 29 | }, 30 | body: jsonEncode({ 31 | 'id': product.id!, 32 | }), 33 | ); 34 | 35 | //use context ensuring the mounted property across async functions 36 | if (context.mounted) { 37 | httpErrorHandle( 38 | response: res, 39 | context: context, 40 | onSuccess: () { 41 | print("\nInside on success method.."); 42 | User user = 43 | userProvider.user.copyWith(cart: jsonDecode(res.body)['cart']); 44 | userProvider.setUserFromModel(user); 45 | print("\nUser cart now is ${user.cart}"); 46 | }, 47 | ); 48 | } 49 | } catch (e) { 50 | print("\n========>Inside the catch block of remove from cart"); 51 | showSnackBar(context: context, text: e.toString()); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/cart_subtotal.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/main.dart'; 2 | import 'package:ecommerce_major_project/providers/user_provider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class CartSubtotal extends StatelessWidget { 7 | const CartSubtotal({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final user = context.watch().user; 12 | num sum = 0; 13 | 14 | user.cart 15 | .map((e) => sum += e['quantity'] * e['product']['price'] as num) 16 | .toList(); 17 | 18 | return Container( 19 | margin: EdgeInsets.all(mq.width * .025), 20 | child: Row( 21 | children: [ 22 | Text( 23 | "Subtotal ", 24 | style: TextStyle(fontSize: 18), 25 | ), 26 | Text( 27 | "₹ ${sum.toStringAsFixed(2)}", 28 | style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600), 29 | ), 30 | ], 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/features/category_grid/category_grid_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:ecommerce_major_project/main.dart'; 4 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 5 | import 'package:ecommerce_major_project/features/search_delegate/my_search_screen.dart'; 6 | import 'package:ecommerce_major_project/features/home/screens/category_deals_screen.dart'; 7 | 8 | class CategoryGridScreen extends StatelessWidget { 9 | CategoryGridScreen({super.key}); 10 | 11 | List> myCategoryList = GlobalVariables.categoryImages2; 12 | 13 | List productCategories = [ 14 | "Mobiles", 15 | "Essentials", 16 | "Appliances", 17 | "Books", 18 | "Fashion" 19 | ]; 20 | 21 | void navigateToCategoryPage(BuildContext context, String category) { 22 | Navigator.pushNamed(context, CategoryDealsScreen.routeName, 23 | arguments: category); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | backgroundColor: Colors.grey.shade100, 30 | appBar: GlobalVariables.getAppBar( 31 | context: context, 32 | wantBackNavigation: false, 33 | title: "All Categories", 34 | onClickSearchNavigateTo: MySearchScreen()), 35 | body: GridView.builder( 36 | scrollDirection: Axis.vertical, 37 | padding: EdgeInsets.all(mq.height * .01), 38 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 39 | childAspectRatio: 1.4, 40 | crossAxisSpacing: mq.width * .03, 41 | mainAxisSpacing: mq.width * .015, 42 | crossAxisCount: 2), 43 | itemCount: myCategoryList.length, 44 | itemBuilder: (context, index) { 45 | // print("\n\nimage path is : ${myCategoryList[index]['title']}"); 46 | final categoryTitle = myCategoryList[index]['title']; 47 | final categoryImage = myCategoryList[index]['image']; 48 | 49 | return InkWell( 50 | onTap: () { 51 | navigateToCategoryPage(context, productCategories[index]); 52 | }, 53 | child: Card( 54 | shape: RoundedRectangleBorder( 55 | borderRadius: BorderRadius.circular(25)), 56 | elevation: 2, 57 | child: Column( 58 | mainAxisAlignment: MainAxisAlignment.center, 59 | mainAxisSize: MainAxisSize.min, 60 | children: [ 61 | SizedBox( 62 | height: 80, 63 | child: Image.asset(categoryImage!), 64 | ), 65 | SizedBox(height: mq.height * .01), 66 | Text( 67 | categoryTitle!, 68 | overflow: TextOverflow.ellipsis, 69 | maxLines: 2, 70 | style: TextStyle(fontWeight: FontWeight.w200, fontSize: 16), 71 | ) 72 | ], 73 | ), 74 | ), 75 | ); 76 | }, 77 | ), 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/features/home/providers/filter_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/features/home/screens/filters_screen.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class FilterProvider with ChangeNotifier { 5 | int filterNumber = 0; 6 | 7 | int get getFilterNumber => filterNumber; 8 | 9 | void setFilterNumber(int filterNo) { 10 | filterNumber = filterNo; 11 | 12 | notifyListeners(); 13 | } 14 | 15 | FilterType getFilterRadio(int filterNumber) { 16 | switch (filterNumber) { 17 | case 0: 18 | return FilterType.atoZ; 19 | case 1: 20 | return FilterType.priceLtoH; 21 | case 2: 22 | return FilterType.priceHtoL; 23 | default: 24 | return FilterType.atoZ; 25 | } 26 | notifyListeners(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/features/home/providers/search_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SearchProvider with ChangeNotifier { 4 | List? suggestionList = []; 5 | 6 | List? get getSuggetions => suggestionList; 7 | 8 | void addToSuggestions(String item) { 9 | suggestionList!.add(item); 10 | notifyListeners(); 11 | } 12 | 13 | void removeFromSuggestions(String item) { 14 | suggestionList!.removeWhere((elem) => elem == item); 15 | notifyListeners(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/features/home/screens/wish_list_screen.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 3 | import 'package:ecommerce_major_project/features/search_delegate/my_search_screen.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_svg/flutter_svg.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | import 'package:ecommerce_major_project/main.dart'; 9 | import 'package:ecommerce_major_project/models/product.dart'; 10 | import 'package:ecommerce_major_project/providers/user_provider.dart'; 11 | import 'package:ecommerce_major_project/common/widgets/bottom_bar.dart'; 12 | import 'package:ecommerce_major_project/features/home/screens/wish_list_product.dart'; 13 | 14 | class WishListScreen extends StatefulWidget { 15 | // List? wishList; 16 | const WishListScreen({ 17 | Key? key, 18 | // this.wishList, 19 | }) : super(key: key); 20 | 21 | @override 22 | State createState() => _WishListScreenState(); 23 | } 24 | 25 | class _WishListScreenState extends State { 26 | @override 27 | Widget build(BuildContext context) { 28 | final user = context.watch().user; 29 | // List? wishList = userProvider.user.wishList; 30 | 31 | return Scaffold( 32 | appBar: GlobalVariables.getAppBar( 33 | context: context, 34 | title: "Your Wishlist", 35 | onClickSearchNavigateTo: MySearchScreen()), 36 | body: Container( 37 | alignment: Alignment.center, 38 | // color: Colors.redAccent, 39 | padding: EdgeInsets.only(top: mq.height * .02), 40 | // height: mq.height * 0.55, 41 | child: user.wishList!.isEmpty 42 | ? Column( 43 | mainAxisAlignment: MainAxisAlignment.start, 44 | // crossAxisAlignment: CrossAxisAlignment.center, 45 | children: [ 46 | Image.asset( 47 | "assets/images/no-orderss.png", 48 | height: mq.height * .25, 49 | ), 50 | const Text( 51 | "Oops, no item in wishList", 52 | style: TextStyle( 53 | fontSize: 20, 54 | fontWeight: FontWeight.w300, 55 | ), 56 | ), 57 | SizedBox(height: mq.height * .01), 58 | ElevatedButton( 59 | onPressed: () { 60 | Navigator.pushReplacementNamed( 61 | context, BottomBar.routeName); 62 | }, 63 | style: ElevatedButton.styleFrom( 64 | backgroundColor: Colors.deepPurpleAccent), 65 | child: const Text( 66 | "Add a product now", 67 | style: TextStyle(color: Colors.white), 68 | )) 69 | ], 70 | ) 71 | : Column(mainAxisAlignment: MainAxisAlignment.start, children: [ 72 | for (int index = 0; index < user.wishList!.length; index++) 73 | WishListProduct(index: index) 74 | ]), 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/features/home/widgets/address_box.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:provider/provider.dart'; 4 | import '/providers/user_provider.dart'; 5 | import '/main.dart'; 6 | 7 | class AddressBox extends StatelessWidget { 8 | const AddressBox({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | final user = Provider.of(context).user; 13 | return Container( 14 | margin: EdgeInsets.symmetric(horizontal: mq.width * .05), 15 | padding: EdgeInsets.only(left: mq.width * .025), 16 | height: mq.height * .055, 17 | decoration: BoxDecoration( 18 | border: Border.all(width: 0.7, color: Colors.grey.shade300), 19 | borderRadius: BorderRadius.circular(15) 20 | // gradient: LinearGradient( 21 | // colors: [ 22 | // Color.fromARGB(255, 114, 226, 221), 23 | // Color.fromARGB(255, 162, 236, 233), 24 | // ], 25 | // stops: [0.5, 1.0], 26 | // ), 27 | ), 28 | child: Row( 29 | children: [ 30 | Icon(Icons.location_on_outlined, 31 | color: GlobalVariables.secondaryGreyTextColor), 32 | Expanded( 33 | child: Padding( 34 | padding: EdgeInsets.only(left: mq.width * .0125), 35 | child: Text( 36 | "Delivery to ${user.name} - ${user.address}", 37 | style: TextStyle( 38 | color: GlobalVariables.secondaryGreyTextColor, 39 | fontWeight: FontWeight.w500, 40 | overflow: TextOverflow.ellipsis, 41 | fontSize: 12), 42 | ), 43 | ), 44 | ), 45 | // Padding( 46 | // padding: EdgeInsets.only( 47 | // left: mq.width * .0125, right: mq.width * .0125), 48 | // child: const Icon(Icons.arrow_drop_down_outlined, size: 22)) 49 | ], 50 | ), 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/features/home/widgets/carousel_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:carousel_slider/carousel_slider.dart'; 2 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 3 | import 'package:ecommerce_major_project/main.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class CarouselImage extends StatelessWidget { 7 | const CarouselImage({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return CarouselSlider( 12 | items: GlobalVariables.carouselImages.map((imageUrl) { 13 | return Builder( 14 | builder: (context) => Container( 15 | padding: EdgeInsets.symmetric(horizontal: mq.height * .025), 16 | child: ClipRRect( 17 | borderRadius: BorderRadius.circular(20), 18 | child: Image.network( 19 | imageUrl, 20 | fit: BoxFit.cover, 21 | height: mq.width * .48, 22 | )), 23 | ), 24 | ); 25 | }).toList(), 26 | options: CarouselOptions( 27 | enlargeCenterPage: true, 28 | autoPlayAnimationDuration: const Duration(milliseconds: 1500), 29 | 30 | // aspectRatio: 16 / 9, 31 | autoPlayCurve: Curves.easeInOutCubic, 32 | 33 | scrollPhysics: ClampingScrollPhysics(), 34 | autoPlay: true, 35 | autoPlayInterval: const Duration(seconds: 3), 36 | viewportFraction: 1, 37 | height: mq.width * .4, 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/features/search/screens/search_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:ecommerce_major_project/main.dart'; 4 | import 'package:ecommerce_major_project/models/product.dart'; 5 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 6 | import 'package:ecommerce_major_project/common/widgets/color_loader_2.dart'; 7 | import 'package:ecommerce_major_project/features/home/widgets/address_box.dart'; 8 | import 'package:ecommerce_major_project/features/search/widgets/searched_product.dart'; 9 | import 'package:ecommerce_major_project/features/search/services/search_services.dart'; 10 | import 'package:ecommerce_major_project/features/search_delegate/my_search_screen.dart'; 11 | import 'package:ecommerce_major_project/features/product_details/screens/product_detail_screen.dart'; 12 | 13 | class SearchScreen extends StatefulWidget { 14 | static const String routeName = "/search-screen"; 15 | final String searchQuery; 16 | const SearchScreen({required this.searchQuery, super.key}); 17 | 18 | @override 19 | State createState() => _SearchScreenState(); 20 | } 21 | 22 | class _SearchScreenState extends State { 23 | List? products; 24 | final SearchServices searchServices = SearchServices(); 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | fetchSearchedProduct(); 30 | } 31 | 32 | void navigateToSearchScreen(String query) { 33 | //make sure to pass the arguments here! 34 | Navigator.pushNamed(context, SearchScreen.routeName, arguments: query); 35 | } 36 | 37 | //fetching the searched product with the search query 38 | fetchSearchedProduct() async { 39 | products = await searchServices.fetchSearchedProduct( 40 | context: context, searchQuery: widget.searchQuery); 41 | setState(() {}); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return Scaffold( 47 | appBar: GlobalVariables.getAppBar( 48 | context: context, 49 | wantBackNavigation: true, 50 | title: "All results for ${widget.searchQuery}", 51 | onClickSearchNavigateTo: 52 | MySearchScreen(searchQueryAlready: widget.searchQuery)), 53 | body: products == null 54 | ? const ColorLoader2() 55 | : products!.isEmpty 56 | ? const Text("No product to display") 57 | : Column( 58 | children: [ 59 | const AddressBox(), 60 | SizedBox(height: mq.width * .025), 61 | Expanded( 62 | child: ListView.builder( 63 | itemCount: products!.length, 64 | itemBuilder: (context, index) { 65 | return GestureDetector( 66 | onTap: () { 67 | Navigator.pushNamed( 68 | context, ProductDetailScreen.routeName, 69 | arguments: products![index]); 70 | }, 71 | child: 72 | SearchedProduct(product: products![index])); 73 | }), 74 | ) 75 | ], 76 | ), 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/features/search/services/search_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'package:provider/provider.dart'; 6 | 7 | import 'package:ecommerce_major_project/models/product.dart'; 8 | import 'package:ecommerce_major_project/constants/utils.dart'; 9 | import 'package:ecommerce_major_project/providers/user_provider.dart'; 10 | import 'package:ecommerce_major_project/constants/error_handling.dart'; 11 | import 'package:ecommerce_major_project/constants/global_variables.dart'; 12 | 13 | class SearchServices { 14 | Future> fetchSearchedProduct( 15 | {required BuildContext context, required String searchQuery}) async { 16 | final userProvider = Provider.of(context, listen: false); 17 | List productList = []; 18 | try { 19 | http.Response res = await http.get( 20 | Uri.parse("$uri/api/products/search/$searchQuery"), 21 | headers: { 22 | 'Content-Type': 'application/json; charset=UTF-8', 23 | 'x-auth-token': userProvider.user.token, 24 | }, 25 | ); 26 | var data = jsonDecode(res.body); 27 | 28 | // List listLength = jsonDecode(res.body); 29 | //jsonEncode => [object] to a JSON string. 30 | //jsonDecode => String to JSON object. 31 | if (context.mounted) { 32 | httpErrorHandle( 33 | //handling the http errors quiet efficiently 34 | response: res, 35 | context: context, 36 | onSuccess: () { 37 | for (Map item in data) { 38 | // print(item['name']); 39 | productList.add(Product.fromJson(item)); 40 | } 41 | }, 42 | ); 43 | } 44 | 45 | // print("Products length : ${jsonDecode(res.body).length}"); 46 | } catch (e) { 47 | showSnackBar( 48 | context: context, 49 | text: 50 | "Following Error in fetching Products [Search] : ${e.toString()}"); 51 | } 52 | return productList; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/features/splash/widgets/splash_content.dart: -------------------------------------------------------------------------------- 1 | import 'package:ecommerce_major_project/main.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SplashContent extends StatelessWidget { 5 | const SplashContent({ 6 | Key? key, 7 | this.text, 8 | this.image, 9 | }) : super(key: key); 10 | final String? text, image; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Column( 15 | children: [ 16 | const Spacer(), 17 | Row( 18 | mainAxisAlignment: MainAxisAlignment.center, 19 | children: [ 20 | Image.asset( 21 | "assets/images/logo.png", 22 | height: 40, 23 | // height: mq.height * .04, 24 | ), 25 | SizedBox(width: mq.width * .03), 26 | Text( 27 | "eSHOP", 28 | style: TextStyle( 29 | fontSize: 50, 30 | color: Colors.orange.shade400, 31 | fontWeight: FontWeight.w800, 32 | ), 33 | ), 34 | ], 35 | ), 36 | Text( 37 | text!, 38 | textAlign: TextAlign.center, 39 | style: TextStyle(fontSize: 18), 40 | ), 41 | const Spacer(flex: 2), 42 | Image.asset( 43 | image!, 44 | height: 265, 45 | width: 235, 46 | ), 47 | ], 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/models/order.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | import 'dart:convert'; 3 | 4 | import 'package:ecommerce_major_project/models/product.dart'; 5 | 6 | class Order { 7 | final String id; 8 | final List products; 9 | final List quantity; 10 | final String address; 11 | final String userId; 12 | final int orderedAt; 13 | final int status; 14 | final num totalPrice; 15 | 16 | Order({ 17 | required this.id, 18 | required this.products, 19 | required this.quantity, 20 | required this.address, 21 | required this.userId, 22 | required this.orderedAt, 23 | required this.status, 24 | required this.totalPrice, 25 | }); 26 | 27 | Map toMap() { 28 | return { 29 | 'id': id, 30 | 'products': products.map((x) => x.toJson()).toList(), 31 | 'quantity': quantity, 32 | 'address': address, 33 | 'userId': userId, 34 | 'orderedAt': orderedAt, 35 | 'status': status, 36 | 'totalPrice': totalPrice 37 | }; 38 | } 39 | 40 | factory Order.fromMap(Map map) { 41 | return Order( 42 | id: map['_id'] as String, 43 | products: List.from( 44 | (map['products']).map( 45 | (x) => Product.fromJson(x['product'] as Map), 46 | ), 47 | ), 48 | quantity: List.from(map['products']?.map((x) => x['quantity'])), 49 | address: map['address'] as String, 50 | userId: map['userId'] as String, 51 | orderedAt: map['orderedAt'] as int, 52 | status: map['status'] as int, 53 | totalPrice: map['totalPrice'] as num, 54 | ); 55 | } 56 | 57 | String toJson() => json.encode(toMap()); 58 | 59 | factory Order.fromJson(String source) => 60 | Order.fromMap(json.decode(source) as Map); 61 | } 62 | -------------------------------------------------------------------------------- /lib/models/rating.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | // ignore_for_file: public_member_api_docs, sort_constructors_first 4 | class Rating { 5 | final String userId; 6 | final num rating; 7 | Rating({ 8 | required this.userId, 9 | required this.rating, 10 | }); 11 | 12 | Map toMap() { 13 | return { 14 | 'userId': userId, 15 | 'rating': rating, 16 | }; 17 | } 18 | 19 | factory Rating.fromMap(Map map) { 20 | return Rating( 21 | userId: map['userId'] as String, 22 | rating: map['rating'] as num, 23 | ); 24 | } 25 | 26 | String toJson() => json.encode(toMap()); 27 | 28 | factory Rating.fromJson(String source) => 29 | Rating.fromMap(json.decode(source) as Map); 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/review.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | import 'package:ecommerce_major_project/models/user.dart'; 3 | 4 | class Review { 5 | final User user; 6 | final String reviewString; 7 | final int reviewedAt; 8 | final List? reviewImages; 9 | Review({ 10 | required this.user, 11 | required this.reviewString, 12 | required this.reviewedAt, 13 | this.reviewImages, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /lib/models/user.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs, sort_constructors_first 2 | import 'dart:convert'; 3 | 4 | //user model 5 | class User { 6 | final String id; 7 | final String name; 8 | final String email; 9 | final String password; 10 | final String address; 11 | final String type; 12 | final String token; 13 | final String? imageUrl; 14 | final List cart; 15 | final List? wishList; 16 | final List? searchHistory; 17 | final List? returnList; 18 | 19 | User({ 20 | required this.id, 21 | required this.name, 22 | required this.email, 23 | required this.password, 24 | required this.address, 25 | required this.type, 26 | required this.token, 27 | required this.imageUrl, 28 | required this.cart, 29 | this.wishList, 30 | this.searchHistory, 31 | this.returnList, 32 | }); 33 | 34 | Map toMap() { 35 | return { 36 | 'id': id, 37 | 'name': name, 38 | 'email': email, 39 | 'password': password, 40 | 'address': address, 41 | 'type': type, 42 | 'token': token, 43 | 'imageUrl': imageUrl, 44 | 'cart': cart, 45 | 'wishList': wishList, 46 | 'searchHistory': searchHistory, 47 | 'returnList': returnList, 48 | }; 49 | } 50 | 51 | factory User.fromMap(Map map) { 52 | return User( 53 | //ensure id is _id 54 | id: map['_id'] ?? '', 55 | name: map['name'] ?? '', 56 | email: map['email'] ?? '', 57 | password: map['password'] ?? '', 58 | address: map['address'] ?? '', 59 | type: map['type'] ?? '', 60 | token: map['token'] ?? '', 61 | imageUrl: map['imageUrl'] ?? '', 62 | cart: List>.from( 63 | map['cart']?.map( 64 | (x) => Map.from(x), 65 | ) ?? 66 | [], 67 | ), 68 | wishList: map['wishList'] != null 69 | ? List>.from( 70 | map['wishList']?.map( 71 | (x) => Map.from(x), 72 | ) ?? 73 | [], 74 | ) 75 | : null, 76 | searchHistory: map['searchHistory'] != null 77 | ? List.from(map['searchHistory']) 78 | : null, 79 | 80 | returnList: map['returnList'] != null 81 | ? List>.from( 82 | map['returnList']?.map( 83 | (x) => Map.from(x), 84 | ) ?? 85 | [], 86 | ) 87 | : null, 88 | // searchHistory: List.from(map['searchHistory']?.map((x)=>)) 89 | ); 90 | } 91 | 92 | String toJson() => json.encode(toMap()); 93 | 94 | factory User.fromJson(String source) => 95 | User.fromMap(json.decode(source) as Map); 96 | 97 | User copyWith({ 98 | String? id, 99 | String? name, 100 | String? email, 101 | String? password, 102 | String? address, 103 | String? type, 104 | String? token, 105 | String? imageUrl, 106 | List? cart, 107 | List? wishList, 108 | List? searchHistory, 109 | List? returnList, 110 | }) { 111 | return User( 112 | id: id ?? this.id, 113 | name: name ?? this.name, 114 | email: email ?? this.email, 115 | password: password ?? this.password, 116 | address: address ?? this.address, 117 | type: type ?? this.type, 118 | token: token ?? this.token, 119 | imageUrl: imageUrl ?? this.imageUrl, 120 | cart: cart ?? this.cart, 121 | wishList: wishList ?? this.wishList, 122 | searchHistory: searchHistory ?? this.searchHistory, 123 | returnList: returnList ?? this.returnList, 124 | ); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /lib/providers/user_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '/models/user.dart'; 3 | 4 | class UserProvider extends ChangeNotifier { 5 | User _user = User( 6 | id: '', 7 | name: '', 8 | email: '', 9 | password: '', 10 | address: '', 11 | type: '', 12 | token: '', 13 | imageUrl: '', 14 | cart: [], 15 | wishList: [], 16 | searchHistory: [], 17 | returnList: [], 18 | ); 19 | 20 | User get user => _user; 21 | 22 | void setUser(String user) { 23 | _user = User.fromJson(user); 24 | notifyListeners(); 25 | } 26 | 27 | void setUserFromModel(User user) { 28 | _user = user; 29 | notifyListeners(); 30 | } 31 | 32 | // void addToHistory(String searchQuery) { 33 | // _user.searchHistory!.add(searchQuery.trim()); 34 | // notifyListeners(); 35 | // } 36 | } 37 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import package_info_plus_macos 9 | import path_provider_foundation 10 | import shared_preferences_foundation 11 | import speech_to_text_macos 12 | 13 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 14 | FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) 15 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 16 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 17 | SpeechToTextMacosPlugin.register(with: registry.registrar(forPlugin: "SpeechToTextMacosPlugin")) 18 | } 19 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = ecommerce_major_project 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.ecommerceMajorProject 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /screenshots/new/flutter_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_01.png -------------------------------------------------------------------------------- /screenshots/new/flutter_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_02.png -------------------------------------------------------------------------------- /screenshots/new/flutter_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_03.png -------------------------------------------------------------------------------- /screenshots/new/flutter_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_04.png -------------------------------------------------------------------------------- /screenshots/new/flutter_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_05.png -------------------------------------------------------------------------------- /screenshots/new/flutter_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_06.png -------------------------------------------------------------------------------- /screenshots/new/flutter_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_07.png -------------------------------------------------------------------------------- /screenshots/new/flutter_08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_08.jpg -------------------------------------------------------------------------------- /screenshots/new/flutter_09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_09.jpg -------------------------------------------------------------------------------- /screenshots/new/flutter_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_10.png -------------------------------------------------------------------------------- /screenshots/new/flutter_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_11.png -------------------------------------------------------------------------------- /screenshots/new/flutter_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_12.png -------------------------------------------------------------------------------- /screenshots/new/flutter_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_13.png -------------------------------------------------------------------------------- /screenshots/new/flutter_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_14.png -------------------------------------------------------------------------------- /screenshots/new/flutter_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_15.png -------------------------------------------------------------------------------- /screenshots/new/flutter_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_16.png -------------------------------------------------------------------------------- /screenshots/new/flutter_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_17.png -------------------------------------------------------------------------------- /screenshots/new/flutter_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/screenshots/new/flutter_18.png -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /node_modules -------------------------------------------------------------------------------- /server/index.js: -------------------------------------------------------------------------------- 1 | //MongoDB 2 | //username : akr2803 3 | //pwd : rajput?283 4 | 5 | // IMPORTS FROM PACKAGES 6 | const express = require("express"); 7 | const mongoose = require("mongoose"); 8 | 9 | // IMPORTS FROM OTHER FILES 10 | const authRouter = require("./routes/auth"); 11 | const adminRouter = require("./routes/admin"); 12 | const productRouter = require("./routes/product"); 13 | const userRouter = require("./routes/user"); 14 | 15 | const PORT = process.env.PORT || 3000; 16 | const app = express(); 17 | // const DB = 18 | // "mongodb+srv://akr2803:123@ecommerceapplication.ibqdbpv.mongodb.net/?retryWrites=true&w=majority"; 19 | const DB = 20 | "mongodb://akr2803:123@ac-ieqge19-shard-00-00.ibqdbpv.mongodb.net:27017,ac-ieqge19-shard-00-01.ibqdbpv.mongodb.net:27017,ac-ieqge19-shard-00-02.ibqdbpv.mongodb.net:27017/?ssl=true&replicaSet=atlas-d74wfg-shard-0&authSource=admin&retryWrites=true&w=majority"; 21 | 22 | // middleware 23 | // CLIENT -> middleware -> SERVER -> CLIENT 24 | 25 | app.use(express.json()); 26 | app.use(authRouter); 27 | app.use(adminRouter); 28 | app.use(productRouter); 29 | app.use(userRouter); 30 | 31 | // Connecting DB 32 | mongoose 33 | .connect(DB) 34 | .then(() => { 35 | console.log("DB Connected Successfully"); 36 | }) 37 | .catch((e) => console.log(e)); 38 | 39 | //CREATING AN API 40 | app.listen(PORT, "0.0.0.0", () => { 41 | console.log(`Listening at PORT ${PORT}`); 42 | }); 43 | 44 | // GET, PUT, POST, DELETE, UPDATE -> CRUD 45 | -------------------------------------------------------------------------------- /server/middlewares/admin.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | const User = require("../models/user"); 3 | 4 | const admin = async (req, res, next) => { 5 | try { 6 | const token = req.header("x-auth-token"); 7 | if (!token) { 8 | return res 9 | .status(401) 10 | .json({ msg: "No auth token, access denied" }); 11 | } 12 | const verified = jwt.verify(token, "passwordKey"); 13 | if (!verified) { 14 | return res.status(401).json({ 15 | msg: "Token verification failed, authorization denied.", 16 | }); 17 | } 18 | 19 | const user = await User.findById(verified.id); 20 | 21 | if (user.type == "user" || user.type == "seller") { 22 | return res.status(401).json({ 23 | msg: "Unauthorized access, you might not be an admin", 24 | }); 25 | } 26 | 27 | req.user = verified.id; 28 | req.token = token; 29 | next(); 30 | } catch (e) { 31 | return res.status(500).json({ error: e.message }); 32 | } 33 | }; 34 | 35 | module.exports = admin; 36 | -------------------------------------------------------------------------------- /server/middlewares/auth.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | 3 | const auth = async (req, res, next) => { 4 | try { 5 | const token = req.header("x-auth-token"); 6 | if (!token) 7 | return res 8 | .status(401) 9 | .json({ msg: "No Auth token, access denied" }); 10 | 11 | const verified = jwt.verify(token, "passwordKey"); 12 | //if token does not match, i.e. not verified 13 | if (!verified) 14 | return res.status(401).json({ 15 | msg: "Token verification failed, authorization denied", 16 | }); 17 | 18 | req.user = verified.id; 19 | req.token = token; 20 | //IMPORTANT to add next() 21 | next(); 22 | } catch (e) { 23 | res.status(500).json({ error: e.message }); 24 | } 25 | }; 26 | 27 | module.exports = auth; 28 | -------------------------------------------------------------------------------- /server/models/order.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const { productSchema } = require("./product"); 3 | 4 | const orderSchema = mongoose.Schema({ 5 | products: [ 6 | { 7 | product: productSchema, 8 | quantity: { 9 | type: Number, 10 | required: true, 11 | }, 12 | }, 13 | ], 14 | 15 | totalPrice: { 16 | type: Number, 17 | required: true, 18 | }, 19 | 20 | address: { 21 | type: String, 22 | required: true, 23 | }, 24 | 25 | userId: { 26 | type: String, 27 | required: true, 28 | }, 29 | 30 | orderedAt: { 31 | type: Number, 32 | required: true, 33 | }, 34 | 35 | status: { 36 | type: Number, 37 | default: 0, 38 | }, 39 | }); 40 | 41 | const Order = mongoose.model("Order", orderSchema); 42 | module.exports = Order; 43 | -------------------------------------------------------------------------------- /server/models/product.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const ratingSchema = require("./rating"); 3 | 4 | const productSchema = mongoose.Schema({ 5 | name: { 6 | type: String, 7 | required: true, 8 | trim: true, 9 | }, 10 | 11 | description: { 12 | type: String, 13 | required: true, 14 | trim: true, 15 | }, 16 | 17 | brandName: { 18 | type: String, 19 | required: true, 20 | trim: true, 21 | }, 22 | 23 | images: [ 24 | { 25 | type: String, 26 | required: true, 27 | }, 28 | ], 29 | 30 | quantity: { 31 | type: Number, 32 | required: true, 33 | }, 34 | 35 | price: { 36 | type: Number, 37 | required: true, 38 | }, 39 | 40 | category: { 41 | type: String, 42 | required: true, 43 | }, 44 | 45 | ratings: [ratingSchema], 46 | }); 47 | const Product = mongoose.model("Product", productSchema); 48 | 49 | module.exports = { Product, productSchema }; 50 | -------------------------------------------------------------------------------- /server/models/rating.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const ratingSchema = mongoose.Schema({ 4 | userId: { 5 | type: String, 6 | required: true, 7 | }, 8 | rating: { 9 | type: Number, 10 | required: true, 11 | }, 12 | }); 13 | 14 | module.exports = ratingSchema; 15 | -------------------------------------------------------------------------------- /server/models/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const { productSchema } = require("./product"); 3 | 4 | const userSchema = mongoose.Schema({ 5 | name: { 6 | required: true, 7 | type: String, 8 | trim: true, 9 | }, 10 | email: { 11 | required: true, 12 | type: String, 13 | trim: true, 14 | validate: { 15 | validator: (value) => { 16 | /* 17 | const re =/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/; 18 | // const re = /^\S+@\S+\.\S+$/; 19 | 20 | */ 21 | const re = 22 | /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/; 23 | 24 | console.log( 25 | "==================> validating email adrress <==================" 26 | ); 27 | return value.match(re); 28 | }, 29 | message: "Please enter a valid email address", 30 | }, 31 | }, 32 | password: { 33 | required: true, 34 | type: String, 35 | /* 36 | validate : { 37 | validator : (value) => { 38 | const re =/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\ ]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; 39 | 40 | return value.length > 6; 41 | }, 42 | message : 'Please enter a longer paswword', 43 | }, 44 | */ 45 | }, 46 | 47 | address: { 48 | type: String, 49 | default: "", 50 | }, 51 | //you can add seller part here 52 | type: { 53 | type: String, 54 | default: "user", 55 | }, 56 | imageUrl: { 57 | type: String, 58 | default: "", 59 | }, 60 | // cart 61 | cart: [ 62 | { 63 | product: productSchema, 64 | quantity: { 65 | type: Number, 66 | required: true, 67 | }, 68 | }, 69 | ], 70 | 71 | wishList: [ 72 | { 73 | product: productSchema, 74 | }, 75 | ], 76 | 77 | searchHistory: [ 78 | { 79 | type: String, 80 | }, 81 | ], 82 | }); 83 | 84 | const User = mongoose.model("User", userSchema); 85 | 86 | module.exports = User; 87 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node ./index.js", 8 | "dev": "nodemon ./index.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "bcryptjs": "^2.4.3", 14 | "express": "^4.18.2", 15 | "http": "^0.0.1-security", 16 | "jsonwebtoken": "^9.0.0", 17 | "mongoose": "^7.0.4" 18 | }, 19 | "devDependencies": { 20 | "nodemon": "^2.0.22" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:ecommerce_major_project/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ecommerce_major_project 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ecommerce_major_project", 3 | "short_name": "ecommerce_major_project", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "ecommerce_major_project" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "ecommerce_major_project" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "ecommerce_major_project.exe" "\0" 98 | VALUE "ProductName", "ecommerce_major_project" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"ecommerce_major_project", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AKR-2803/ecommerce-application-flutter/ec942ad011e6c9575e0c39d7103d9dac536e284f/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responsponds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | --------------------------------------------------------------------------------