├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── dev │ │ │ │ └── scarvs │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── animations │ ├── error.json │ ├── nodata.json │ ├── onBoardingOne.json │ ├── onBoardingThree.json │ └── onBoardingTwo.json ├── fonts │ └── contax.ttf └── images │ ├── logo │ └── logo.png │ ├── misc │ ├── diamondBlack.png │ └── diamondWhite.png │ └── shoes │ ├── jordan.png │ └── jordanT.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── app │ ├── constants │ │ ├── app.assets.dart │ │ ├── app.colors.dart │ │ ├── app.fonts.dart │ │ ├── app.keys.dart │ │ └── app.theme.dart │ ├── providers │ │ └── app.provider.dart │ └── routes │ │ ├── api.routes.dart │ │ └── app.routes.dart ├── core │ ├── api │ │ ├── authentication.api.dart │ │ ├── cart.api.dart │ │ ├── product.api.dart │ │ └── user.api.dart │ ├── models │ │ ├── cart.model.dart │ │ ├── onBoarding.model.dart │ │ ├── product.model.dart │ │ ├── productID.model.dart │ │ ├── update.user.model.dart │ │ ├── user.model.dart │ │ └── userDetails.model.dart │ ├── notifiers │ │ ├── authentication.notifer.dart │ │ ├── cart.notifier.dart │ │ ├── product.notifier.dart │ │ ├── size.notifier.dart │ │ ├── theme.notifier.dart │ │ └── user.notifier.dart │ ├── service │ │ └── payment.service.dart │ └── utils │ │ └── snackbar.util.dart ├── main.dart ├── presentation │ ├── screens │ │ ├── cartScreen │ │ │ ├── cart.screen.dart │ │ │ └── widgets │ │ │ │ └── show.cart.data.dart │ │ ├── categoryScreen │ │ │ ├── category.screen.dart │ │ │ └── widgets │ │ │ │ └── category.widget.dart │ │ ├── homeScreen │ │ │ └── home.screen.dart │ │ ├── loginScreen │ │ │ ├── login.view.dart │ │ │ └── widget │ │ │ │ └── welcome.login.widget.dart │ │ ├── onBoardingScreen │ │ │ ├── onBoarding.screen.dart │ │ │ └── widget │ │ │ │ └── onBoarding.widget.dart │ │ ├── productDetailScreen │ │ │ ├── product.detail.screen.dart │ │ │ └── widget │ │ │ │ ├── select.size.dart │ │ │ │ └── ui.detail.dart │ │ ├── productScreen │ │ │ ├── product.screen.dart │ │ │ └── widgets │ │ │ │ ├── brands.widget.dart │ │ │ │ └── recommended.widget.dart │ │ ├── profileScreens │ │ │ ├── accountInformationScreen │ │ │ │ └── account.information.screen.dart │ │ │ ├── appSettingsScreen │ │ │ │ └── app.setting.screen.dart │ │ │ ├── changePasswordScreen │ │ │ │ └── change.password.screen.dart │ │ │ ├── editProfileScreen │ │ │ │ └── edit.profile.screen.dart │ │ │ └── mainProfileScreen │ │ │ │ └── profile.screen.dart │ │ ├── searchScreen │ │ │ └── search.screen.dart │ │ ├── signUpScreen │ │ │ ├── signup.screen.dart │ │ │ └── widget │ │ │ │ └── welcome.signup.widget.dart │ │ └── splashScreen │ │ │ └── splash.screen.dart │ └── widgets │ │ ├── custom.animated.container.dart │ │ ├── custom.back.btn.dart │ │ ├── custom.design.dart │ │ ├── custom.loader.dart │ │ ├── custom.text.field.dart │ │ ├── custom.text.style.dart │ │ ├── dimensions.widget.dart │ │ └── shimmer.effects.dart └── web_url │ ├── configure_nonweb.dart │ └── configure_web.dart ├── pubspec.lock ├── pubspec.yaml ├── 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 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /.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 and should not be manually edited. 5 | 6 | version: 7 | revision: 3595343e20a61ff16d14e8ecc25f364276bb1b8b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![Logo](https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/main/assets/images/logo/logo.png) 3 | 4 | # Scarvs Shoe E-commerce App 5 | 6 | For us, sneakers have always been more than just shoes. They have their own culture. Those who know understand the impact sneakers have had on art, music and fashion. Scarves are looking for their sneaker culture. Over time, we aim to advance the history of sneaker and street culture in India. The Scarvs store is not just a retail space. 7 | It will be a concert hall, an art studio, a chat room, a party space. 8 | 9 | ## Tech Stack 10 | 11 | **Client:** Flutter 12 | 13 | [**Server:** Node, Express ,Typescript](https://github.com/Dev-Adnani/Scarvs-Backend) 14 | 15 | [**Database:** Postgres](https://github.com/Dev-Adnani/Scarvs-Backend) 16 | 17 | ## Demo 18 | 19 | Youtube Video : https://youtu.be/VMaL6kxFd4I 20 | 21 | ## Features 22 | 23 | - Login / Sign Up 24 | - Dark / Light Mode 25 | - Complex Cart System 26 | - Complex Cool UI 27 | - RazorPay Integration 28 | 29 | ## Libraries 30 | 31 | - Main Library Used in App 32 | - Provider 33 | - Cache Manager 34 | - Concentric Transition 35 | - Cupertino Icons 36 | - Eva Icons Flutter 37 | - Flutter Launcher Icons 38 | - Flutter SVG 39 | - Http 40 | - Lottie 41 | - Salomon Bottom Bar 42 | - Shared Preferences 43 | - Shimmer 44 | - Url Strategy 45 | 46 |
47 | Screenshots 48 | 49 | 50 | 51 | 52 | 53 | 54 |
55 | 56 | 57 | ## Feedback 58 | 59 | If you have any feedback, please reach out to us at dev.adnani26@gmail.com 60 | 61 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 33 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.dev.scarvs" 47 | minSdkVersion 21 48 | targetSdkVersion 30 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 8 | 15 | 19 | 23 | 27 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/dev/scarvs/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.dev.scarvs 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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.21' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https://services.gradle.org/distributions/gradle-7.5.1-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME -------------------------------------------------------------------------------- /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/fonts/contax.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/assets/fonts/contax.ttf -------------------------------------------------------------------------------- /assets/images/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/assets/images/logo/logo.png -------------------------------------------------------------------------------- /assets/images/misc/diamondBlack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/assets/images/misc/diamondBlack.png -------------------------------------------------------------------------------- /assets/images/misc/diamondWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/assets/images/misc/diamondWhite.png -------------------------------------------------------------------------------- /assets/images/shoes/jordan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/assets/images/shoes/jordan.png -------------------------------------------------------------------------------- /assets/images/shoes/jordanT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/assets/images/shoes/jordanT.png -------------------------------------------------------------------------------- /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? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /ios/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 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | scarvs 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/app/constants/app.assets.dart: -------------------------------------------------------------------------------- 1 | class AppAssets { 2 | static const String onBoardingOne = 'assets/animations/onBoardingOne.json'; 3 | static const String onBoardingTwo = 'assets/animations/onBoardingTwo.json'; 4 | static const String onBoardingThree = 5 | 'assets/animations/onBoardingThree.json'; 6 | static const String error = 'assets/animations/error.json'; 7 | static const String nodata = 'assets/animations/nodata.json'; 8 | 9 | static const String homeJordan = 'assets/images/shoes/jordan.png'; 10 | static const String diamondWhite = 'assets/images/misc/diamondWhite.png'; 11 | static const String diamondBlack = 'assets/images/misc/diamondBlack.png'; 12 | 13 | static const String brandJordan = 14 | 'https://res.cloudinary.com/devadnani/image/upload/v1638344627/Scarvs%20Main/Products/as_oxfgjh.png'; 15 | static const String brandReebok = 16 | 'https://res.cloudinary.com/devadnani/image/upload/v1637740600/Scarvs%20Main/Category/Reebok_h08nkr.png'; 17 | static const String brandNike = 18 | 'https://res.cloudinary.com/devadnani/image/upload/v1637740600/Scarvs%20Main/Category/Nike_jewqpl.png'; 19 | static const String brandAdidas = 20 | 'https://res.cloudinary.com/devadnani/image/upload/v1637740600/Scarvs%20Main/Category/adidas_ourejg.png'; 21 | static const String brandPuma = 22 | 'https://res.cloudinary.com/devadnani/image/upload/v1637740600/Scarvs%20Main/Category/Puma_ab8d0u.png'; 23 | } 24 | -------------------------------------------------------------------------------- /lib/app/constants/app.colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppColors { 4 | static Color white = Colors.white; 5 | static Color blackPearl = const Color(0xff040e22); 6 | static Color mirage = const Color(0xff1d273b); 7 | static Color mediumPurple = const Color(0xff9371ea); 8 | static Color fuchsiaPink = const Color(0xffc549bc); 9 | static Color rawSienna = const Color(0xffd7834f); 10 | static Color blueZodiac = const Color(0xff0c1c3d); 11 | static Color blueZodiacTwo = const Color(0xff122651); 12 | static Color creamColor = const Color(0xfff5f5ff); 13 | static Color darkCreamColor = const Color(0xff18181B); 14 | } 15 | -------------------------------------------------------------------------------- /lib/app/constants/app.fonts.dart: -------------------------------------------------------------------------------- 1 | class AppFonts { 2 | static const String contax = "Contax"; 3 | } 4 | -------------------------------------------------------------------------------- /lib/app/constants/app.keys.dart: -------------------------------------------------------------------------------- 1 | class AppKeys { 2 | static String appMode = 'darkMode'; 3 | static String userData = 'jwt'; 4 | static String razorKey = 'rzp_test_ImLClDOqMc2kc1'; 5 | static String onBoardDone = 'onBoard'; 6 | } 7 | -------------------------------------------------------------------------------- /lib/app/constants/app.theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.fonts.dart'; 3 | import 'app.colors.dart'; 4 | 5 | final darkTheme = ThemeData( 6 | colorScheme: ColorScheme.fromSwatch().copyWith( 7 | secondary: AppColors.creamColor, 8 | brightness: Brightness.dark, 9 | background: AppColors.mirage, 10 | ), 11 | indicatorColor: AppColors.rawSienna, 12 | dividerColor: Colors.white54, 13 | fontFamily: AppFonts.contax, 14 | ); 15 | 16 | final lightTheme = ThemeData( 17 | colorScheme: ColorScheme.fromSwatch().copyWith( 18 | secondary: AppColors.mirage, 19 | brightness: Brightness.light, 20 | background: AppColors.creamColor, 21 | ), 22 | indicatorColor: AppColors.rawSienna, 23 | dividerColor: Colors.black, 24 | fontFamily: AppFonts.contax, 25 | ); 26 | -------------------------------------------------------------------------------- /lib/app/providers/app.provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:provider/provider.dart'; 2 | import 'package:provider/single_child_widget.dart'; 3 | import 'package:scarvs/core/notifiers/authentication.notifer.dart'; 4 | import 'package:scarvs/core/notifiers/cart.notifier.dart'; 5 | import 'package:scarvs/core/notifiers/product.notifier.dart'; 6 | import 'package:scarvs/core/notifiers/size.notifier.dart'; 7 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 8 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 9 | import 'package:scarvs/core/service/payment.service.dart'; 10 | 11 | class AppProvider { 12 | static List providers = [ 13 | ChangeNotifierProvider(create: (_) => ThemeNotifier()), 14 | ChangeNotifierProvider(create: (_) => AuthenticationNotifier()), 15 | ChangeNotifierProvider(create: (_) => UserNotifier()), 16 | ChangeNotifierProvider(create: (_) => ProductNotifier()), 17 | ChangeNotifierProvider(create: (_) => SizeNotifier()), 18 | ChangeNotifierProvider(create: (_) => CartNotifier()), 19 | ChangeNotifierProvider(create: (_) => PaymentService()), 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /lib/app/routes/api.routes.dart: -------------------------------------------------------------------------------- 1 | class ApiRoutes { 2 | static const String baseurl = "http://10.0.2.2:8080"; 3 | } 4 | -------------------------------------------------------------------------------- /lib/app/routes/app.routes.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: body_might_complete_normally_nullable 2 | 3 | import 'package:concentric_transition/concentric_transition.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:scarvs/presentation/screens/cartScreen/cart.screen.dart'; 6 | import 'package:scarvs/presentation/screens/categoryScreen/category.screen.dart'; 7 | import 'package:scarvs/presentation/screens/homeScreen/home.screen.dart'; 8 | import 'package:scarvs/presentation/screens/loginScreen/login.view.dart'; 9 | import 'package:scarvs/presentation/screens/onBoardingScreen/onBoarding.screen.dart'; 10 | import 'package:scarvs/presentation/screens/productDetailScreen/product.detail.screen.dart'; 11 | import 'package:scarvs/presentation/screens/productScreen/product.screen.dart'; 12 | import 'package:scarvs/presentation/screens/profileScreens/accountInformationScreen/account.information.screen.dart'; 13 | import 'package:scarvs/presentation/screens/profileScreens/appSettingsScreen/app.setting.screen.dart'; 14 | import 'package:scarvs/presentation/screens/profileScreens/changePasswordScreen/change.password.screen.dart'; 15 | import 'package:scarvs/presentation/screens/profileScreens/editProfileScreen/edit.profile.screen.dart'; 16 | import 'package:scarvs/presentation/screens/profileScreens/mainProfileScreen/profile.screen.dart'; 17 | import 'package:scarvs/presentation/screens/searchScreen/search.screen.dart'; 18 | import 'package:scarvs/presentation/screens/signUpScreen/signup.screen.dart'; 19 | import 'package:scarvs/presentation/screens/splashScreen/splash.screen.dart'; 20 | 21 | class AppRouter { 22 | static const String splashRoute = "/splash"; 23 | static const String onBoardRoute = "/onBoard"; 24 | static const String productRoute = "/product"; 25 | static const String loginRoute = "/login"; 26 | static const String signUpRoute = "/signup"; 27 | static const String appSettingsRoute = "/appSettings"; 28 | static const String homeRoute = "/home"; 29 | static const String cartRoute = "/cart"; 30 | static const String searchRoute = "/search"; 31 | static const String profileRoute = "/profile"; 32 | static const String accountInfo = "/accountInfo"; 33 | static const String categoryRoute = "/category"; 34 | static const String prodDetailRoute = "/productDetail"; 35 | static const String editProfileRoute = "/editProfile"; 36 | static const String changePassRoute = "/changePassword"; 37 | 38 | static Route? generateRoute(RouteSettings settings) { 39 | switch (settings.name) { 40 | case editProfileRoute: 41 | { 42 | return MaterialPageRoute( 43 | builder: (_) => EditProfileScreen(), 44 | ); 45 | } 46 | case appSettingsRoute: 47 | { 48 | return MaterialPageRoute( 49 | builder: (_) => const AppSettings(), 50 | ); 51 | } 52 | case homeRoute: 53 | { 54 | return MaterialPageRoute( 55 | builder: (_) => const HomeScreen(), 56 | ); 57 | } 58 | case splashRoute: 59 | { 60 | return ConcentricPageRoute( 61 | fullscreenDialog: true, 62 | builder: (_) => const SplashScreen(), 63 | ); 64 | } 65 | case onBoardRoute: 66 | { 67 | return MaterialPageRoute( 68 | builder: (_) => OnBoardingScreen(), 69 | ); 70 | } 71 | case productRoute: 72 | { 73 | return MaterialPageRoute( 74 | builder: (_) => const ProductScreen(), 75 | ); 76 | } 77 | case loginRoute: 78 | { 79 | return MaterialPageRoute( 80 | builder: (_) => LoginScreen(), 81 | ); 82 | } 83 | case signUpRoute: 84 | { 85 | return MaterialPageRoute( 86 | builder: (_) => SignUpScreen(), 87 | ); 88 | } 89 | case prodDetailRoute: 90 | { 91 | return MaterialPageRoute( 92 | builder: (context) => ProductDetail( 93 | productDetailsArguements: ModalRoute.of(context)! 94 | .settings 95 | .arguments as ProductDetailsArgs, 96 | ), 97 | settings: settings, 98 | ); 99 | } 100 | case cartRoute: 101 | { 102 | return MaterialPageRoute( 103 | builder: (_) => const CartScreen(), 104 | ); 105 | } 106 | case searchRoute: 107 | { 108 | return MaterialPageRoute( 109 | builder: (_) => const SearchScreen(), 110 | ); 111 | } 112 | case profileRoute: 113 | { 114 | return MaterialPageRoute( 115 | builder: (_) => const ProfileScreen(), 116 | ); 117 | } 118 | case categoryRoute: 119 | { 120 | return MaterialPageRoute( 121 | builder: (context) => CategoryScreen( 122 | categoryScreenArgs: ModalRoute.of(context)!.settings.arguments 123 | as CategoryScreenArgs, 124 | ), 125 | settings: settings, 126 | ); 127 | } 128 | case accountInfo: 129 | { 130 | return MaterialPageRoute( 131 | builder: (_) => const AccountInformationScreen(), 132 | ); 133 | } 134 | case changePassRoute: 135 | { 136 | return MaterialPageRoute( 137 | builder: (_) => ChangePasswordScreen(), 138 | ); 139 | } 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /lib/core/api/authentication.api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:scarvs/app/routes/api.routes.dart'; 5 | 6 | class AuthenticationAPI { 7 | final client = http.Client(); 8 | final headers = { 9 | 'Content-Type': 'application/json', 10 | 'Accept': 'application/json', 11 | 'Access-Control-Allow-Origin': "*", 12 | }; 13 | 14 | //User Sign Up 15 | Future createAccount( 16 | {required String useremail, 17 | required String username, 18 | required String userpassword}) async { 19 | const subUrl = '/auth/signup'; 20 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 21 | final http.Response response = await client.post(uri, 22 | headers: headers, 23 | body: jsonEncode({ 24 | "useremail": useremail, 25 | "userpassword": userpassword, 26 | "username": username 27 | })); 28 | final dynamic body = response.body; 29 | return body; 30 | } 31 | 32 | Future userLogin( 33 | {required String useremail, required String userpassword}) async { 34 | const subUrl = '/auth/login'; 35 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 36 | final http.Response response = await client.post(uri, 37 | headers: headers, 38 | body: jsonEncode({ 39 | "useremail": useremail, 40 | "userpassword": userpassword, 41 | })); 42 | final dynamic body = response.body; 43 | return body; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/core/api/cart.api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:http/http.dart' as http; 4 | import 'package:scarvs/app/routes/api.routes.dart'; 5 | 6 | class CartAPI { 7 | final client = http.Client(); 8 | final headers = { 9 | 'Content-Type': 'application/json', 10 | 'Accept': 'application/json', 11 | 'Access-Control-Allow-Origin': "*", 12 | }; 13 | 14 | Future addToCart({ 15 | required String useremail, 16 | required String productPrice, 17 | required String productName, 18 | required String productCategory, 19 | required String productImage, 20 | required BuildContext context, 21 | required String productSize, 22 | }) async { 23 | const subUrl = '/cart/add-to-cart'; 24 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 25 | final http.Response response = await client.post(uri, 26 | headers: headers, 27 | body: jsonEncode({ 28 | "useremail": useremail, 29 | "product_price": productPrice, 30 | "product_name": productName, 31 | "product_category": productCategory, 32 | "product_image": productImage, 33 | "product_size": productSize 34 | })); 35 | final dynamic body = response.body; 36 | return body; 37 | } 38 | 39 | Future checkCartData({ 40 | required String useremail, 41 | required BuildContext context, 42 | }) async { 43 | var subUrl = '/cart/$useremail'; 44 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 45 | final http.Response response = await client.get( 46 | uri, 47 | headers: headers, 48 | ); 49 | final dynamic body = response.body; 50 | return body; 51 | } 52 | 53 | Future deleteFromCart({ 54 | required dynamic productId, 55 | required BuildContext context, 56 | }) async { 57 | var subUrl = '/cart/delete/$productId'; 58 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 59 | final http.Response response = await client.delete( 60 | uri, 61 | headers: headers, 62 | ); 63 | final dynamic body = response.body; 64 | return body; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/core/api/product.api.dart: -------------------------------------------------------------------------------- 1 | import 'package:http/http.dart' as http; 2 | import 'package:scarvs/app/routes/api.routes.dart'; 3 | 4 | class ProductAPI { 5 | final client = http.Client(); 6 | final headers = { 7 | 'Content-Type': 'application/json', 8 | 'Accept': 'application/json', 9 | 'Access-Control-Allow-Origin': "*", 10 | }; 11 | 12 | Future fetchProducts() async { 13 | const subUrl = '/product'; 14 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 15 | final http.Response response = await client.get( 16 | uri, 17 | headers: headers, 18 | ); 19 | final body = response.body; 20 | return body; 21 | } 22 | 23 | Future fetchProductDetail({required dynamic id}) async { 24 | var subUrl = '/product/details/$id'; 25 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 26 | 27 | final http.Response response = await client.get( 28 | uri, 29 | headers: headers, 30 | ); 31 | final body = response.body; 32 | return body; 33 | } 34 | 35 | Future fetchProductCategory({required dynamic categoryName}) async { 36 | var subUrl = '/product/category/$categoryName'; 37 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 38 | 39 | final http.Response response = await client.get( 40 | uri, 41 | headers: headers, 42 | ); 43 | final body = response.body; 44 | return body; 45 | } 46 | 47 | Future searchProduct({required dynamic productName}) async { 48 | var subUrl = '/product/search/$productName'; 49 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 50 | 51 | final http.Response response = await client.get( 52 | uri, 53 | headers: headers, 54 | ); 55 | final body = response.body; 56 | return body; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/core/api/user.api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:scarvs/app/routes/api.routes.dart'; 5 | 6 | class UserAPI { 7 | final client = http.Client(); 8 | 9 | Future getUserData({required String token}) async { 10 | const subUrl = '/auth/verify'; 11 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 12 | final http.Response response = await client.get( 13 | uri, 14 | headers: { 15 | 'Content-Type': 'application/json', 16 | 'Accept': 'application/json', 17 | 'Access-Control-Allow-Origin': "*", 18 | "Authorization": token 19 | }, 20 | ); 21 | final dynamic body = response.body; 22 | return body; 23 | } 24 | 25 | Future getUserDetails({required String userEmail}) async { 26 | var subUrl = '/info/$userEmail'; 27 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 28 | final http.Response response = await client.get( 29 | uri, 30 | headers: { 31 | 'Content-Type': 'application/json', 32 | 'Accept': 'application/json', 33 | 'Access-Control-Allow-Origin': "*", 34 | }, 35 | ); 36 | final dynamic body = response.body; 37 | return body; 38 | } 39 | 40 | Future updateUserDetails( 41 | {required String userEmail, 42 | required String userAddress, 43 | required String userPhoneNo}) async { 44 | const subUrl = '/info/add-user-info'; 45 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 46 | final http.Response response = await client.post(uri, 47 | headers: { 48 | 'Content-Type': 'application/json', 49 | 'Accept': 'application/json', 50 | 'Access-Control-Allow-Origin': "*", 51 | }, 52 | body: jsonEncode({ 53 | "useremail": userEmail, 54 | "user_address": userAddress, 55 | "user_phone_no": userPhoneNo, 56 | })); 57 | final dynamic body = response.body; 58 | return body; 59 | } 60 | 61 | Future changePassword( 62 | {required String userEmail, 63 | required String oluserpassword, 64 | required String newuserpassword}) async { 65 | const subUrl = '/auth/change-password'; 66 | final Uri uri = Uri.parse(ApiRoutes.baseurl + subUrl); 67 | final http.Response response = await client.post(uri, 68 | headers: { 69 | 'Content-Type': 'application/json', 70 | 'Accept': 'application/json', 71 | 'Access-Control-Allow-Origin': "*", 72 | }, 73 | body: jsonEncode({ 74 | "oluserpassword": oluserpassword, 75 | "useremail": userEmail, 76 | "newuserpassword": newuserpassword 77 | })); 78 | final dynamic body = response.body; 79 | return body; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/core/models/cart.model.dart: -------------------------------------------------------------------------------- 1 | class CartData { 2 | CartData({ 3 | required this.filled, 4 | required this.received, 5 | required this.data, 6 | }); 7 | late final bool filled; 8 | late final bool received; 9 | late final List? data; 10 | 11 | CartData.fromJson(Map json) { 12 | filled = json['filled']; 13 | received = json['received']; 14 | data = List.from(json['data']).map((e) => CartItems.fromJson(e)).toList(); 15 | } 16 | 17 | Map toJson() { 18 | final _data = {}; 19 | _data['filled'] = filled; 20 | _data['received'] = received; 21 | _data['data'] = data?.map((e) => e.toJson()).toList(); 22 | return _data; 23 | } 24 | } 25 | 26 | class CartItems { 27 | CartItems({ 28 | required this.productId, 29 | required this.productName, 30 | required this.productPrice, 31 | required this.productCategory, 32 | required this.productImage, 33 | required this.productSize, 34 | }); 35 | late final int productId; 36 | late final String productName; 37 | late final String productPrice; 38 | late final String productCategory; 39 | late final String productImage; 40 | late final String productSize; 41 | 42 | CartItems.fromJson(Map json) { 43 | productId = json['product_id']; 44 | productName = json['product_name']; 45 | productPrice = json['product_price']; 46 | productCategory = json['product_category']; 47 | productImage = json['product_image']; 48 | productSize = json['product_size']; 49 | } 50 | 51 | Map toJson() { 52 | final _data = {}; 53 | _data['product_id'] = productId; 54 | _data['product_name'] = productName; 55 | _data['product_price'] = productPrice; 56 | _data['product_category'] = productCategory; 57 | _data['product_image'] = productImage; 58 | _data['product_size'] = productSize; 59 | return _data; 60 | } 61 | } 62 | 63 | class CartDelete { 64 | CartDelete({ 65 | required this.deleted, 66 | required this.data, 67 | }); 68 | late final bool deleted; 69 | late final String data; 70 | 71 | CartDelete.fromJson(Map json) { 72 | deleted = json['deleted']; 73 | data = json['data']; 74 | } 75 | 76 | Map toJson() { 77 | final _data = {}; 78 | _data['deleted'] = deleted; 79 | _data['data'] = data; 80 | return _data; 81 | } 82 | } 83 | 84 | class AddToCartModel { 85 | AddToCartModel({ 86 | required this.added, 87 | required this.data, 88 | }); 89 | late final bool added; 90 | late final String data; 91 | 92 | AddToCartModel.fromJson(Map json) { 93 | added = json['added']; 94 | data = json['data']; 95 | } 96 | 97 | Map toJson() { 98 | final _data = {}; 99 | _data['added'] = added; 100 | _data['data'] = data; 101 | return _data; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /lib/core/models/onBoarding.model.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class OnBoardingModel { 4 | final String? title; 5 | final String? image; 6 | final Color bgColor; 7 | final Color textColor; 8 | 9 | OnBoardingModel({ 10 | this.title, 11 | this.image, 12 | this.bgColor = Colors.white, 13 | this.textColor = Colors.black, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /lib/core/models/product.model.dart: -------------------------------------------------------------------------------- 1 | class ProductModel { 2 | ProductModel({ 3 | required this.filled, 4 | required this.received, 5 | required this.data, 6 | }); 7 | late final bool filled; 8 | late final bool received; 9 | late final List? data; 10 | 11 | ProductModel.fromJson(Map json) { 12 | filled = json['filled']; 13 | received = json['received']; 14 | data = List.from(json['data']).map((e) => ProductData.fromJson(e)).toList(); 15 | } 16 | 17 | Map toJson() { 18 | final _data = {}; 19 | _data['filled'] = filled; 20 | _data['received'] = received; 21 | _data['data'] = data?.map((e) => e.toJson()).toList(); 22 | return _data; 23 | } 24 | } 25 | 26 | class ProductData { 27 | ProductData({ 28 | required this.productId, 29 | required this.productName, 30 | required this.productDescription, 31 | required this.productPrice, 32 | required this.productCategory, 33 | required this.productImage, 34 | }); 35 | late final int productId; 36 | late final String productName; 37 | late final String productDescription; 38 | late final String productPrice; 39 | late final String productCategory; 40 | late final String productImage; 41 | 42 | ProductData.fromJson(Map json) { 43 | productId = json['product_id']; 44 | productName = json['product_name']; 45 | productDescription = json['product_description']; 46 | productPrice = json['product_price']; 47 | productCategory = json['product_category']; 48 | productImage = json['product_image']; 49 | } 50 | 51 | Map toJson() { 52 | final _data = {}; 53 | _data['product_id'] = productId; 54 | _data['product_name'] = productName; 55 | _data['product_description'] = productDescription; 56 | _data['product_price'] = productPrice; 57 | _data['product_category'] = productCategory; 58 | _data['product_image'] = productImage; 59 | return _data; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/core/models/productID.model.dart: -------------------------------------------------------------------------------- 1 | class ProductIdModel { 2 | ProductIdModel({ 3 | required this.filled, 4 | required this.received, 5 | required this.data, 6 | }); 7 | late final bool filled; 8 | late final bool received; 9 | late final SingleProductData data; 10 | 11 | ProductIdModel.fromJson(Map json) { 12 | filled = json['filled']; 13 | received = json['received']; 14 | data = SingleProductData.fromJson(json['data']); 15 | } 16 | 17 | Map toJson() { 18 | final _data = {}; 19 | _data['filled'] = filled; 20 | _data['received'] = received; 21 | _data['data'] = data.toJson(); 22 | return _data; 23 | } 24 | } 25 | 26 | class SingleProductData { 27 | SingleProductData({ 28 | required this.productId, 29 | required this.productName, 30 | required this.productDescription, 31 | required this.productPrice, 32 | required this.productCategory, 33 | required this.productImage, 34 | }); 35 | late final int productId; 36 | late final String productName; 37 | late final String productDescription; 38 | late final String productPrice; 39 | late final String productCategory; 40 | late final String productImage; 41 | 42 | SingleProductData.fromJson(Map json) { 43 | productId = json['product_id']; 44 | productName = json['product_name']; 45 | productDescription = json['product_description']; 46 | productPrice = json['product_price']; 47 | productCategory = json['product_category']; 48 | productImage = json['product_image']; 49 | } 50 | 51 | Map toJson() { 52 | final _data = {}; 53 | _data['product_id'] = productId; 54 | _data['product_name'] = productName; 55 | _data['product_description'] = productDescription; 56 | _data['product_price'] = productPrice; 57 | _data['product_category'] = productCategory; 58 | _data['product_image'] = productImage; 59 | return _data; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/core/models/update.user.model.dart: -------------------------------------------------------------------------------- 1 | class UpdateUser { 2 | UpdateUser({ 3 | required this.added, 4 | required this.updated, 5 | required this.data, 6 | }); 7 | late final bool added; 8 | late final bool updated; 9 | late final UpdatedData data; 10 | 11 | UpdateUser.fromJson(Map json) { 12 | added = json['added']; 13 | updated = json['updated']; 14 | data = UpdatedData.fromJson(json['data']); 15 | } 16 | 17 | Map toJson() { 18 | final _data = {}; 19 | _data['added'] = added; 20 | _data['updated'] = updated; 21 | _data['data'] = data.toJson(); 22 | return _data; 23 | } 24 | } 25 | 26 | class UpdatedData { 27 | UpdatedData({ 28 | required this.generatedMaps, 29 | required this.raw, 30 | required this.affected, 31 | }); 32 | late final List generatedMaps; 33 | late final List raw; 34 | late final int affected; 35 | 36 | UpdatedData.fromJson(Map json) { 37 | generatedMaps = List.castFrom(json['generatedMaps']); 38 | raw = List.castFrom(json['raw']); 39 | affected = json['affected']; 40 | } 41 | 42 | Map toJson() { 43 | final _data = {}; 44 | _data['generatedMaps'] = generatedMaps; 45 | _data['raw'] = raw; 46 | _data['affected'] = affected; 47 | return _data; 48 | } 49 | } 50 | 51 | class ChangeUserPassword { 52 | ChangeUserPassword({ 53 | required this.changed, 54 | required this.updated, 55 | required this.data, 56 | }); 57 | late final bool changed; 58 | late final bool updated; 59 | late final String data; 60 | 61 | ChangeUserPassword.fromJson(Map json) { 62 | changed = json['changed']; 63 | updated = json['updated']; 64 | data = json['data']; 65 | } 66 | 67 | Map toJson() { 68 | final _data = {}; 69 | _data['changed'] = changed; 70 | _data['updated'] = updated; 71 | _data['data'] = data; 72 | return _data; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/core/models/user.model.dart: -------------------------------------------------------------------------------- 1 | class UserModel { 2 | UserModel({ 3 | required this.received, 4 | required this.data, 5 | }); 6 | late final bool received; 7 | late final UserData data; 8 | 9 | UserModel.fromJson(Map json) { 10 | received = json['received']; 11 | data = UserData.fromJson(json['data']); 12 | } 13 | 14 | Map toJson() { 15 | final _data = {}; 16 | _data['received'] = received; 17 | _data['data'] = data.toJson(); 18 | return _data; 19 | } 20 | } 21 | 22 | class UserData { 23 | UserData({ 24 | required this.email, 25 | required this.username, 26 | required this.iat, 27 | required this.exp, 28 | }); 29 | late final String email; 30 | late final String username; 31 | late final int iat; 32 | late final int exp; 33 | 34 | UserData.fromJson(Map json) { 35 | email = json['email']; 36 | username = json['username']; 37 | iat = json['iat']; 38 | exp = json['exp']; 39 | } 40 | 41 | Map toJson() { 42 | final _data = {}; 43 | _data['email'] = email; 44 | _data['username'] = username; 45 | _data['iat'] = iat; 46 | _data['exp'] = exp; 47 | return _data; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/core/models/userDetails.model.dart: -------------------------------------------------------------------------------- 1 | class UserDetails { 2 | UserDetails({ 3 | required this.received, 4 | required this.filled, 5 | required this.data, 6 | }); 7 | late final bool received; 8 | late final bool filled; 9 | late final Data data; 10 | 11 | UserDetails.fromJson(Map json) { 12 | received = json['received']; 13 | filled = json['filled']; 14 | data = Data.fromJson(json['data']); 15 | } 16 | 17 | Map toJson() { 18 | final _data = {}; 19 | _data['received'] = received; 20 | _data['filled'] = filled; 21 | _data['data'] = data.toJson(); 22 | return _data; 23 | } 24 | } 25 | 26 | class Data { 27 | Data({ 28 | required this.id, 29 | required this.userAddress, 30 | required this.userPhoneNo, 31 | required this.user, 32 | }); 33 | late final int id; 34 | late final String userAddress; 35 | late final String userPhoneNo; 36 | late final User user; 37 | 38 | Data.fromJson(Map json) { 39 | id = json['id']; 40 | userAddress = json['user_address']; 41 | userPhoneNo = json['user_phone_no']; 42 | user = User.fromJson(json['user']); 43 | } 44 | 45 | Map toJson() { 46 | final _data = {}; 47 | _data['id'] = id; 48 | _data['user_address'] = userAddress; 49 | _data['user_phone_no'] = userPhoneNo; 50 | _data['user'] = user.toJson(); 51 | return _data; 52 | } 53 | } 54 | 55 | class User { 56 | User({ 57 | required this.id, 58 | required this.username, 59 | required this.useremail, 60 | required this.userpassword, 61 | }); 62 | late final int id; 63 | late final String username; 64 | late final String useremail; 65 | late final String userpassword; 66 | 67 | User.fromJson(Map json) { 68 | id = json['id']; 69 | username = json['username']; 70 | useremail = json['useremail']; 71 | userpassword = json['userpassword']; 72 | } 73 | 74 | Map toJson() { 75 | final _data = {}; 76 | _data['id'] = id; 77 | _data['username'] = username; 78 | _data['useremail'] = useremail; 79 | _data['userpassword'] = userpassword; 80 | return _data; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/core/notifiers/authentication.notifer.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: avoid_print, recursive_getters 2 | 3 | import 'dart:convert'; 4 | import 'dart:io'; 5 | import 'package:cache_manager/cache_manager.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:scarvs/app/constants/app.keys.dart'; 8 | import 'package:scarvs/app/routes/app.routes.dart'; 9 | import 'package:scarvs/core/api/authentication.api.dart'; 10 | import 'package:scarvs/core/utils/snackbar.util.dart'; 11 | 12 | class AuthenticationNotifier with ChangeNotifier { 13 | final AuthenticationAPI _authenticationAPI = AuthenticationAPI(); 14 | 15 | String? _passwordLevel = ""; 16 | String? get passwordLevel => _passwordLevel; 17 | 18 | String? _passwordEmoji = ""; 19 | String? get passwordEmoji => _passwordEmoji; 20 | 21 | void checkPasswordStrength({required String password}) { 22 | String mediumPattern = r'^(?=.*?[!@#\$&*~]).{8,}'; 23 | String strongPattern = 24 | r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$'; 25 | 26 | if (password.contains(RegExp(strongPattern))) { 27 | _passwordEmoji = '🚀'; 28 | _passwordLevel = 'Strong'; 29 | notifyListeners(); 30 | } else if (password.contains(RegExp(mediumPattern))) { 31 | _passwordEmoji = '🔥'; 32 | _passwordLevel = 'Medium'; 33 | notifyListeners(); 34 | } else if (!password.contains(RegExp(strongPattern))) { 35 | _passwordEmoji = '😢'; 36 | _passwordLevel = 'Weak'; 37 | notifyListeners(); 38 | } 39 | } 40 | 41 | Future createAccount( 42 | {required String useremail, 43 | required BuildContext context, 44 | required String username, 45 | required String userpassword}) async { 46 | try { 47 | var userData = await _authenticationAPI.createAccount( 48 | useremail: useremail, username: username, userpassword: userpassword); 49 | print(userData); 50 | 51 | final Map parseData = await jsonDecode(userData); 52 | bool isAuthenticated = parseData['authentication']; 53 | dynamic authData = parseData['data']; 54 | 55 | if (isAuthenticated) { 56 | WriteCache.setString(key: AppKeys.userData, value: authData) 57 | .whenComplete( 58 | () => Navigator.of(context).pushReplacementNamed(AppRouter.homeRoute), 59 | ); 60 | } else { 61 | ScaffoldMessenger.of(context).showSnackBar( 62 | SnackUtil.stylishSnackBar(text: authData, context: context)); 63 | } 64 | } on SocketException catch (_) { 65 | ScaffoldMessenger.of(context).showSnackBar(SnackUtil.stylishSnackBar( 66 | text: 'Oops No You Need A Good Internet Connection', 67 | context: context)); 68 | } catch (e) { 69 | print(e); 70 | } 71 | } 72 | 73 | Future userLogin( 74 | {required String useremail, 75 | required BuildContext context, 76 | required String userpassword}) async { 77 | try { 78 | var userData = await _authenticationAPI.userLogin( 79 | useremail: useremail, userpassword: userpassword); 80 | print(userData); 81 | 82 | final Map parseData = await jsonDecode(userData); 83 | bool isAuthenticated = parseData['authentication']; 84 | dynamic authData = parseData['data']; 85 | 86 | if (isAuthenticated) { 87 | WriteCache.setString(key: AppKeys.userData, value: authData) 88 | .whenComplete( 89 | () => Navigator.of(context).pushReplacementNamed(AppRouter.homeRoute), 90 | ); 91 | } else { 92 | ScaffoldMessenger.of(context).showSnackBar( 93 | SnackUtil.stylishSnackBar(text: authData, context: context)); 94 | } 95 | } on SocketException catch (_) { 96 | ScaffoldMessenger.of(context).showSnackBar(SnackUtil.stylishSnackBar( 97 | text: 'Oops No You Need A Good Internet Connection', 98 | context: context)); 99 | } catch (e) { 100 | print(e); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /lib/core/notifiers/cart.notifier.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:scarvs/core/api/cart.api.dart'; 5 | import 'package:scarvs/core/models/cart.model.dart'; 6 | import 'package:scarvs/core/utils/snackbar.util.dart'; 7 | 8 | class CartNotifier with ChangeNotifier { 9 | final CartAPI _cartAPI = CartAPI(); 10 | 11 | Future checkCartData( 12 | {required BuildContext context, required String useremail}) async { 13 | try { 14 | var products = 15 | await _cartAPI.checkCartData(useremail: useremail, context: context); 16 | var response = CartData.fromJson(jsonDecode(products)); 17 | 18 | final _productBody = response.data; 19 | final _productFilled = response.filled; 20 | final _productReceived = response.received; 21 | 22 | notifyListeners(); 23 | if (_productReceived && _productFilled) { 24 | return _productBody; 25 | } else if (!_productFilled || !_productReceived) { 26 | return null; 27 | } 28 | } on SocketException catch (_) { 29 | ScaffoldMessenger.of(context).showSnackBar(SnackUtil.stylishSnackBar( 30 | text: 'Oops No You Need A Good Internet Connection', 31 | context: context)); 32 | } 33 | } 34 | 35 | Future addToCart({ 36 | required String useremail, 37 | required String productPrice, 38 | required String productName, 39 | required String productCategory, 40 | required String productImage, 41 | required BuildContext context, 42 | required String productSize, 43 | }) async { 44 | try { 45 | var products = await _cartAPI.addToCart( 46 | useremail: useremail, 47 | productPrice: productPrice, 48 | productName: productName, 49 | productCategory: productCategory, 50 | productImage: productImage, 51 | context: context, 52 | productSize: productSize); 53 | var response = AddToCartModel.fromJson( 54 | jsonDecode(products), 55 | ); 56 | 57 | final _productAdded = response.added; 58 | return _productAdded; 59 | } on SocketException catch (_) { 60 | ScaffoldMessenger.of(context).showSnackBar( 61 | SnackUtil.stylishSnackBar( 62 | text: 'Oops No You Need A Good Internet Connection', 63 | context: context, 64 | ), 65 | ); 66 | } 67 | } 68 | 69 | void refresh() { 70 | notifyListeners(); 71 | } 72 | 73 | Future deleteFromCart( 74 | {required BuildContext context, required dynamic productId}) async { 75 | try { 76 | var products = 77 | await _cartAPI.deleteFromCart(productId: productId, context: context); 78 | var response = CartDelete.fromJson(jsonDecode(products)); 79 | 80 | final _productDeleted = response.deleted; 81 | 82 | return _productDeleted; 83 | } on SocketException catch (_) { 84 | ScaffoldMessenger.of(context).showSnackBar( 85 | SnackUtil.stylishSnackBar( 86 | text: 'Oops No You Need A Good Internet Connection', 87 | context: context, 88 | ), 89 | ); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/core/notifiers/product.notifier.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:scarvs/core/api/product.api.dart'; 6 | import 'package:scarvs/core/models/productID.model.dart'; 7 | import 'package:scarvs/core/models/product.model.dart'; 8 | import 'package:scarvs/core/utils/snackbar.util.dart'; 9 | 10 | class ProductNotifier with ChangeNotifier { 11 | final ProductAPI _productAPI = ProductAPI(); 12 | 13 | Future fetchProducts({required BuildContext context}) async { 14 | try { 15 | var products = await _productAPI.fetchProducts(); 16 | var response = ProductModel.fromJson(jsonDecode(products)); 17 | 18 | final _productBody = response.data; 19 | final _productFilled = response.filled; 20 | final _productReceived = response.received; 21 | 22 | if (_productReceived && _productFilled) { 23 | return _productBody; 24 | } else if (!_productFilled && _productReceived) { 25 | return []; 26 | } 27 | } on SocketException catch (_) { 28 | ScaffoldMessenger.of(context).showSnackBar(SnackUtil.stylishSnackBar( 29 | text: 'Oops No You Need A Good Internet Connection', 30 | context: context)); 31 | } 32 | } 33 | 34 | Future fetchProductDetail( 35 | {required BuildContext context, required dynamic id}) async { 36 | try { 37 | var products = await _productAPI.fetchProductDetail(id: id); 38 | var response = ProductIdModel.fromJson(jsonDecode(products)); 39 | 40 | final _productBody = response.data; 41 | final _productFilled = response.filled; 42 | final _productReceived = response.received; 43 | 44 | if (_productReceived && _productFilled) { 45 | return _productBody; 46 | } else if (!_productFilled && _productReceived) { 47 | return []; 48 | } 49 | } on SocketException catch (_) { 50 | ScaffoldMessenger.of(context).showSnackBar( 51 | SnackUtil.stylishSnackBar( 52 | text: 'Oops No You Need A Good Internet Connection', 53 | context: context), 54 | ); 55 | } 56 | } 57 | 58 | Future fetchProductCategory( 59 | {required BuildContext context, required dynamic categoryName}) async { 60 | try { 61 | var products = 62 | await _productAPI.fetchProductCategory(categoryName: categoryName); 63 | var response = ProductModel.fromJson(jsonDecode(products)); 64 | 65 | final _productBody = response.data; 66 | final _productFilled = response.filled; 67 | final _productReceived = response.received; 68 | 69 | if (_productReceived && _productFilled) { 70 | return _productBody; 71 | } else if (!_productFilled && _productReceived) { 72 | return []; 73 | } 74 | } on SocketException catch (_) { 75 | ScaffoldMessenger.of(context).showSnackBar(SnackUtil.stylishSnackBar( 76 | text: 'Oops No You Need A Good Internet Connection', 77 | context: context)); 78 | } 79 | } 80 | 81 | Future searchProduct( 82 | {required BuildContext context, required dynamic productName}) async { 83 | try { 84 | var products = await _productAPI.searchProduct(productName: productName); 85 | var response = ProductModel.fromJson(jsonDecode(products)); 86 | 87 | final _productBody = response.data; 88 | final _productFilled = response.filled; 89 | final _productReceived = response.received; 90 | 91 | if (_productReceived && _productFilled) { 92 | return _productBody; 93 | } else if (!_productFilled && _productReceived) { 94 | return []; 95 | } 96 | } on SocketException catch (_) { 97 | ScaffoldMessenger.of(context).showSnackBar(SnackUtil.stylishSnackBar( 98 | text: 'Oops No You Need A Good Internet Connection', 99 | context: context)); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /lib/core/notifiers/size.notifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SizeNotifier with ChangeNotifier { 4 | String size = '8'; 5 | 6 | bool sizeEight = true; 7 | bool sizeNine = false; 8 | bool sizeTen = false; 9 | bool sizeEleven = false; 10 | 11 | String get getSize => size; 12 | 13 | selectSizeEight() { 14 | sizeEight = true; 15 | sizeNine = false; 16 | sizeTen = false; 17 | sizeEleven = false; 18 | size = '8'; 19 | notifyListeners(); 20 | } 21 | 22 | selectSizeNine() { 23 | sizeNine = true; 24 | sizeEight = false; 25 | sizeTen = false; 26 | sizeEleven = false; 27 | size = '9'; 28 | notifyListeners(); 29 | } 30 | 31 | selectSizeTen() { 32 | sizeTen = true; 33 | sizeEight = false; 34 | sizeNine = false; 35 | sizeEleven = false; 36 | size = '10'; 37 | notifyListeners(); 38 | } 39 | 40 | selectSizeEleven() { 41 | sizeTen = false; 42 | sizeEleven = true; 43 | sizeEight = false; 44 | sizeNine = false; 45 | size = '11'; 46 | notifyListeners(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/core/notifiers/theme.notifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.keys.dart'; 3 | import 'package:shared_preferences/shared_preferences.dart'; 4 | 5 | class ThemeNotifier with ChangeNotifier { 6 | bool _darktheme = false; 7 | bool get darkTheme => _darktheme; 8 | 9 | ThemeNotifier() { 10 | _loadFromPrefs(); 11 | } 12 | 13 | toggleTheme() { 14 | _darktheme = !_darktheme; 15 | _saveToPrefs(); 16 | notifyListeners(); 17 | } 18 | 19 | _loadFromPrefs() async { 20 | var val = await getDarkMode(); 21 | _darktheme = val ?? false; 22 | notifyListeners(); 23 | } 24 | 25 | _saveToPrefs() async { 26 | await saveDarkMode(_darktheme); 27 | } 28 | 29 | static Future saveDarkMode(bool darkMode) async { 30 | SharedPreferences prefs = await SharedPreferences.getInstance(); 31 | return await prefs.setBool(AppKeys.appMode, darkMode); 32 | } 33 | 34 | static Future getDarkMode() async { 35 | SharedPreferences prefs = await SharedPreferences.getInstance(); 36 | return prefs.getBool(AppKeys.appMode); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/core/notifiers/user.notifier.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:cache_manager/cache_manager.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:scarvs/app/constants/app.keys.dart'; 7 | import 'package:scarvs/app/routes/app.routes.dart'; 8 | import 'package:scarvs/core/api/user.api.dart'; 9 | import 'package:scarvs/core/models/update.user.model.dart'; 10 | import 'package:scarvs/core/models/user.model.dart'; 11 | import 'package:scarvs/core/models/userDetails.model.dart'; 12 | import 'package:scarvs/core/utils/snackbar.util.dart'; 13 | 14 | class UserNotifier with ChangeNotifier { 15 | final UserAPI _userAPI = UserAPI(); 16 | 17 | String? userEmail = 'Not Available'; 18 | String? get getUserEmail => userEmail; 19 | 20 | String? userName; 21 | String? get getUserName => userName; 22 | 23 | String userAddress = 'Not Available'; 24 | String get getuserAddress => userAddress; 25 | 26 | String userPhoneNumber = 'Not Available'; 27 | String get getuserPhoneNumber => userPhoneNumber; 28 | 29 | Future getUserData({ 30 | required String token, 31 | required BuildContext context, 32 | }) async { 33 | try { 34 | var userData = await _userAPI.getUserData(token: token); 35 | var response = UserModel.fromJson(jsonDecode(userData)); 36 | 37 | final _data = response.data; 38 | final _received = response.received; 39 | 40 | if (!_received) { 41 | notifyListeners(); 42 | Navigator.of(context) 43 | .pushReplacementNamed(AppRouter.loginRoute) 44 | .whenComplete( 45 | () => DeleteCache.deleteKey(AppKeys.userData).whenComplete(() { 46 | ScaffoldMessenger.of(context).showSnackBar( 47 | SnackUtil.stylishSnackBar( 48 | text: 'Oops Session Timeout', context: context), 49 | ); 50 | }), 51 | ); 52 | } else { 53 | userEmail = _data.email; 54 | userName = _data.username; 55 | notifyListeners(); 56 | } 57 | } on SocketException catch (_) { 58 | ScaffoldMessenger.of(context).showSnackBar( 59 | SnackUtil.stylishSnackBar( 60 | text: 'Oops No You Need A Good Internet Connection', 61 | context: context), 62 | ); 63 | } 64 | } 65 | 66 | Future getUserDetails({ 67 | required String userEmail, 68 | required BuildContext context, 69 | }) async { 70 | try { 71 | var userData = await _userAPI.getUserDetails(userEmail: userEmail); 72 | var response = UserDetails.fromJson(jsonDecode(userData)); 73 | final _data = response.data; 74 | final _filled = response.filled; 75 | final _received = response.received; 76 | 77 | if (_received && _filled) { 78 | userAddress = _data.userAddress; 79 | userPhoneNumber = _data.userPhoneNo; 80 | userEmail = _data.user.useremail; 81 | userName = _data.user.username; 82 | notifyListeners(); 83 | } 84 | } on SocketException catch (_) { 85 | ScaffoldMessenger.of(context).showSnackBar( 86 | SnackUtil.stylishSnackBar( 87 | text: 'Oops No You Need A Good Internet Connection', 88 | context: context), 89 | ); 90 | } 91 | } 92 | 93 | Future updateUserDetails({ 94 | required String userEmail, 95 | required String userAddress, 96 | required String userPhoneNo, 97 | required BuildContext context, 98 | }) async { 99 | try { 100 | var userData = await _userAPI.updateUserDetails( 101 | userEmail: userEmail, 102 | userAddress: userAddress, 103 | userPhoneNo: userPhoneNo); 104 | var response = UpdateUser.fromJson(jsonDecode(userData)); 105 | final _updated = response.updated; 106 | notifyListeners(); 107 | 108 | return _updated; 109 | } on SocketException catch (_) { 110 | ScaffoldMessenger.of(context).showSnackBar( 111 | SnackUtil.stylishSnackBar( 112 | text: 'Oops No You Need A Good Internet Connection', 113 | context: context), 114 | ); 115 | } 116 | } 117 | 118 | Future changePassword({ 119 | required String userEmail, 120 | required String oluserpassword, 121 | required String newuserpassword, 122 | required BuildContext context, 123 | }) async { 124 | try { 125 | var userData = await _userAPI.changePassword( 126 | userEmail: userEmail, 127 | oluserpassword: oluserpassword, 128 | newuserpassword: newuserpassword); 129 | 130 | var response = ChangeUserPassword.fromJson(jsonDecode(userData)); 131 | final _updated = response.updated; 132 | 133 | notifyListeners(); 134 | 135 | return _updated; 136 | } on SocketException catch (_) { 137 | ScaffoldMessenger.of(context).showSnackBar( 138 | SnackUtil.stylishSnackBar( 139 | text: 'Oops No You Need A Good Internet Connection', 140 | context: context), 141 | ); 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /lib/core/service/payment.service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | // ignore: import_of_legacy_library_into_null_safe 3 | import 'package:fluttertoast/fluttertoast.dart'; 4 | import 'package:provider/provider.dart'; 5 | import 'package:razorpay_flutter/razorpay_flutter.dart'; 6 | import 'package:scarvs/app/constants/app.keys.dart'; 7 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 8 | 9 | class PaymentService with ChangeNotifier { 10 | Razorpay razorpay = Razorpay(); 11 | 12 | initializeRazorPay({required BuildContext context}) { 13 | razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess); 14 | razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError); 15 | razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet); 16 | } 17 | 18 | Future checkMeOut( 19 | {required BuildContext context, required int cartPrice}) async { 20 | initializeRazorPay(context: context); 21 | var options = { 22 | 'key': AppKeys.razorKey, 23 | 'amount': cartPrice, 24 | 'name': Provider.of(context, listen: false).getUserName, 25 | 'description': 'Payment', 26 | 'prefill': { 27 | 'contact': '8888888888', 28 | 'email': Provider.of(context, listen: false).getUserEmail, 29 | }, 30 | 'external': { 31 | 'wallet': ['paytm'] 32 | } 33 | }; 34 | try { 35 | razorpay.open(options); 36 | } catch (e) { 37 | debugPrint(e.toString()); 38 | } 39 | } 40 | 41 | disposeRazorPay() { 42 | razorpay.clear(); 43 | } 44 | 45 | void _handlePaymentSuccess(PaymentSuccessResponse response) { 46 | Fluttertoast.showToast(msg: "SUCCESS: " + response.paymentId!); 47 | } 48 | 49 | void _handlePaymentError(PaymentFailureResponse response) { 50 | Fluttertoast.showToast( 51 | msg: "ERROR: " + response.code.toString() + " - " + response.message!, 52 | ); 53 | } 54 | 55 | void _handleExternalWallet(ExternalWalletResponse response) { 56 | Fluttertoast.showToast( 57 | msg: "EXTERNAL_WALLET: " + response.walletName!, 58 | ); 59 | } 60 | 61 | showResponse({required BuildContext context, required String response}) { 62 | return showModalBottomSheet( 63 | context: context, 64 | builder: (context) { 65 | return SizedBox( 66 | height: 100, 67 | width: 400, 68 | child: Text( 69 | 'This Is Response $response', 70 | style: const TextStyle(), 71 | ), 72 | ); 73 | }); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/core/utils/snackbar.util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/app/constants/app.fonts.dart'; 4 | 5 | class SnackUtil { 6 | static stylishSnackBar( 7 | {required String text, required BuildContext context}) { 8 | return SnackBar( 9 | backgroundColor: AppColors.rawSienna, 10 | behavior: SnackBarBehavior.floating, 11 | margin: const EdgeInsets.fromLTRB(40, 0, 40, 100), 12 | content: Text( 13 | text, 14 | style: TextStyle( 15 | color: AppColors.creamColor, 16 | fontFamily: AppFonts.contax, 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.theme.dart'; 4 | import 'package:scarvs/app/providers/app.provider.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 7 | // import 'web_url/configure_nonweb.dart' 8 | // if (dart.library.html) 'web_url/configure_web.dart'; 9 | 10 | void main() { 11 | // configureApp(); 12 | WidgetsFlutterBinding.ensureInitialized(); 13 | runApp(const Lava()); 14 | } 15 | 16 | class Lava extends StatelessWidget { 17 | const Lava({Key? key}) : super(key: key); 18 | @override 19 | Widget build(BuildContext context) { 20 | return MultiProvider( 21 | providers: AppProvider.providers, 22 | child: const Core(), 23 | ); 24 | } 25 | } 26 | 27 | class Core extends StatelessWidget { 28 | const Core({Key? key}) : super(key: key); 29 | @override 30 | Widget build(BuildContext context) { 31 | return Consumer( 32 | builder: (context, notifier, _) { 33 | return MaterialApp( 34 | title: 'Scarvs', 35 | // supportedLocales: AppLocalization.all, 36 | theme: notifier.darkTheme ? darkTheme : lightTheme, 37 | debugShowCheckedModeBanner: false, 38 | onGenerateRoute: AppRouter.generateRoute, 39 | initialRoute: AppRouter.splashRoute, 40 | ); 41 | }, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/presentation/screens/cartScreen/cart.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.assets.dart'; 4 | import 'package:scarvs/app/constants/app.colors.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/core/notifiers/cart.notifier.dart'; 7 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 8 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 9 | import 'package:scarvs/presentation/screens/cartScreen/widgets/show.cart.data.dart'; 10 | import 'package:scarvs/presentation/widgets/custom.back.btn.dart'; 11 | import 'package:scarvs/presentation/widgets/custom.loader.dart'; 12 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 13 | 14 | class CartScreen extends StatefulWidget { 15 | const CartScreen({Key? key}) : super(key: key); 16 | 17 | @override 18 | State createState() => _CartScreenState(); 19 | } 20 | 21 | class _CartScreenState extends State { 22 | @override 23 | void dispose() { 24 | // Provider.of(context, listen: false).disposeRazorPay(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | ThemeNotifier _themeNotifier = Provider.of(context); 31 | var themeFlag = _themeNotifier.darkTheme; 32 | final userNotifier = Provider.of(context, listen: false); 33 | 34 | return SafeArea( 35 | child: Scaffold( 36 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 37 | body: Padding( 38 | padding: const EdgeInsets.fromLTRB(20, 2, 20, 0), 39 | child: Column( 40 | children: [ 41 | Row( 42 | children: [ 43 | CustomBackButton( 44 | route: AppRouter.homeRoute, 45 | themeFlag: themeFlag, 46 | ), 47 | Text( 48 | 'Cart', 49 | style: CustomTextWidget.bodyTextB2( 50 | color: 51 | themeFlag ? AppColors.creamColor : AppColors.mirage, 52 | ), 53 | ), 54 | ], 55 | ), 56 | SizedBox( 57 | height: MediaQuery.of(context).size.height * 0.75, 58 | width: MediaQuery.of(context).size.width, 59 | child: Consumer( 60 | builder: (context, notifier, _) { 61 | return FutureBuilder( 62 | future: notifier.checkCartData( 63 | context: context, 64 | useremail: userNotifier.getUserEmail!), 65 | builder: (context, snapshot) { 66 | if (!snapshot.hasData) { 67 | return customLoader( 68 | context: context, 69 | themeFlag: themeFlag, 70 | text: 'Eww Cart is Empty', 71 | lottieAsset: AppAssets.nodata, 72 | ); 73 | } else { 74 | var _snapshot = snapshot.data as List; 75 | return showCartData( 76 | height: MediaQuery.of(context).size.height * 0.17, 77 | snapshot: _snapshot, 78 | themeFlag: themeFlag, 79 | context: context, 80 | ); 81 | } 82 | }, 83 | ); 84 | }, 85 | ), 86 | ), 87 | ], 88 | ), 89 | ), 90 | ), 91 | ); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/presentation/screens/categoryScreen/category.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.assets.dart'; 4 | import 'package:scarvs/app/constants/app.colors.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/core/notifiers/product.notifier.dart'; 7 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 8 | import 'package:scarvs/presentation/screens/categoryScreen/widgets/category.widget.dart'; 9 | import 'package:scarvs/presentation/widgets/custom.back.btn.dart'; 10 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 11 | import 'package:scarvs/presentation/widgets/custom.loader.dart'; 12 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 13 | import 'package:scarvs/presentation/widgets/shimmer.effects.dart'; 14 | 15 | class CategoryScreen extends StatelessWidget { 16 | final CategoryScreenArgs categoryScreenArgs; 17 | 18 | const CategoryScreen({Key? key, required this.categoryScreenArgs}) 19 | : super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | ThemeNotifier _themeNotifier = Provider.of(context); 24 | var themeFlag = _themeNotifier.darkTheme; 25 | return SafeArea( 26 | child: Scaffold( 27 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 28 | body: Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | SizedBox( 32 | height: MediaQuery.of(context).size.height * 0.05, 33 | child: Row( 34 | children: [ 35 | CustomBackButton( 36 | route: AppRouter.homeRoute, 37 | themeFlag: themeFlag, 38 | ), 39 | Center( 40 | child: Text( 41 | categoryScreenArgs.categoryName, 42 | style: CustomTextWidget.bodyTextB2( 43 | color: 44 | themeFlag ? AppColors.creamColor : AppColors.mirage, 45 | ), 46 | ), 47 | ), 48 | ], 49 | ), 50 | ), 51 | vSizedBox2, 52 | Column( 53 | children: [ 54 | SizedBox( 55 | height: MediaQuery.of(context).size.height * 0.85, 56 | width: MediaQuery.of(context).size.width, 57 | child: Consumer( 58 | builder: (context, notifier, _) { 59 | return FutureBuilder( 60 | future: notifier.fetchProductCategory( 61 | context: context, 62 | categoryName: categoryScreenArgs.categoryName, 63 | ), 64 | builder: (context, snapshot) { 65 | if (snapshot.connectionState == 66 | ConnectionState.waiting) { 67 | return ShimmerEffects.buildCategoryShimmer( 68 | context: context); 69 | } else if (!snapshot.hasData) { 70 | return customLoader( 71 | context: context, 72 | themeFlag: themeFlag, 73 | text: 'No Stock Available', 74 | lottieAsset: AppAssets.error, 75 | ); 76 | } else { 77 | var _snapshot = snapshot.data as List; 78 | return showDataInGrid( 79 | height: 80 | MediaQuery.of(context).size.height * 0.20, 81 | snapshot: _snapshot, 82 | themeFlag: themeFlag, 83 | context: context); 84 | } 85 | }, 86 | ); 87 | }, 88 | ), 89 | ), 90 | ], 91 | ), 92 | ], 93 | ), 94 | ), 95 | ); 96 | } 97 | } 98 | 99 | class CategoryScreenArgs { 100 | final dynamic categoryName; 101 | const CategoryScreenArgs({required this.categoryName}); 102 | } 103 | -------------------------------------------------------------------------------- /lib/presentation/screens/categoryScreen/widgets/category.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/app/routes/app.routes.dart'; 4 | import 'package:scarvs/core/models/product.model.dart'; 5 | import 'package:scarvs/presentation/screens/productDetailScreen/product.detail.screen.dart'; 6 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 7 | 8 | Widget showDataInGrid( 9 | {required snapshot, 10 | required themeFlag, 11 | required BuildContext context, 12 | required double height}) { 13 | return Padding( 14 | padding: const EdgeInsets.fromLTRB(20, 20, 20, 0), 15 | child: GridView.builder( 16 | physics: const ScrollPhysics(), 17 | shrinkWrap: true, 18 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( 19 | crossAxisCount: 2, 20 | mainAxisSpacing: 8, 21 | crossAxisSpacing: 8, 22 | childAspectRatio: 0.700, 23 | ), 24 | itemCount: snapshot.length, 25 | itemBuilder: (context, index) { 26 | ProductData prod = snapshot[index]; 27 | return _showProducts( 28 | context: context, prod: prod, themeFlag: themeFlag, height: height); 29 | }, 30 | ), 31 | ); 32 | } 33 | 34 | Widget _showProducts( 35 | {required BuildContext context, 36 | required ProductData prod, 37 | required bool themeFlag, 38 | required double height}) { 39 | return Card( 40 | shape: RoundedRectangleBorder( 41 | borderRadius: BorderRadius.circular(10), 42 | side: BorderSide( 43 | color: Colors.grey.withOpacity(0.2), 44 | width: 1, 45 | ), 46 | ), 47 | elevation: 6, 48 | color: themeFlag ? AppColors.mirage : AppColors.creamColor, 49 | child: GestureDetector( 50 | behavior: HitTestBehavior.translucent, 51 | onTap: () { 52 | Navigator.of(context).pushNamed( 53 | AppRouter.prodDetailRoute, 54 | arguments: ProductDetailsArgs(id: prod.productId), 55 | ); 56 | }, 57 | child: Column( 58 | mainAxisAlignment: MainAxisAlignment.start, 59 | crossAxisAlignment: CrossAxisAlignment.start, 60 | children: [ 61 | ClipRRect( 62 | borderRadius: const BorderRadius.only( 63 | topLeft: Radius.circular(10), 64 | topRight: Radius.circular(10), 65 | ), 66 | child: Hero( 67 | tag: Key(prod.productId.toString()), 68 | child: SizedBox( 69 | height: height, 70 | child: Image.network(prod.productImage), 71 | ), 72 | ), 73 | ), 74 | Container( 75 | margin: const EdgeInsets.fromLTRB(8, 8, 8, 8), 76 | child: Column( 77 | mainAxisAlignment: MainAxisAlignment.start, 78 | crossAxisAlignment: CrossAxisAlignment.start, 79 | children: [ 80 | Text( 81 | prod.productName, 82 | style: CustomTextWidget.bodyText3( 83 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 84 | ), 85 | maxLines: 2, 86 | overflow: TextOverflow.ellipsis, 87 | ), 88 | Text( 89 | '₹ ${prod.productPrice}', 90 | style: CustomTextWidget.bodyText3( 91 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 92 | ), 93 | maxLines: 2, 94 | overflow: TextOverflow.ellipsis, 95 | ), 96 | ], 97 | ), 98 | ), 99 | ], 100 | ), 101 | ), 102 | ); 103 | } 104 | -------------------------------------------------------------------------------- /lib/presentation/screens/homeScreen/home.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:cache_manager/cache_manager.dart'; 2 | import 'package:eva_icons_flutter/eva_icons_flutter.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | import 'package:salomon_bottom_bar/salomon_bottom_bar.dart'; 6 | import 'package:scarvs/app/constants/app.colors.dart'; 7 | import 'package:scarvs/app/constants/app.keys.dart'; 8 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 9 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 10 | import 'package:scarvs/presentation/screens/cartScreen/cart.screen.dart'; 11 | import 'package:scarvs/presentation/screens/productScreen/product.screen.dart'; 12 | import 'package:scarvs/presentation/screens/profileScreens/mainProfileScreen/profile.screen.dart'; 13 | import 'package:scarvs/presentation/screens/searchScreen/search.screen.dart'; 14 | 15 | final List bottomNavBarIcons = [ 16 | SalomonBottomBarItem( 17 | icon: const Icon(Icons.home), 18 | title: const Text("Home"), 19 | selectedColor: Colors.purple, 20 | ), 21 | 22 | /// Search 23 | SalomonBottomBarItem( 24 | icon: const Icon(Icons.search), 25 | title: const Text("Search"), 26 | selectedColor: Colors.orange, 27 | ), 28 | 29 | SalomonBottomBarItem( 30 | icon: const Icon(EvaIcons.shoppingCart), 31 | title: const Text("Cart"), 32 | selectedColor: Colors.teal, 33 | ), 34 | 35 | SalomonBottomBarItem( 36 | icon: const Icon(EvaIcons.person), 37 | title: const Text("Profile"), 38 | selectedColor: Colors.amber, 39 | ), 40 | ]; 41 | 42 | final screens = [ 43 | const ProductScreen(), 44 | const SearchScreen(), 45 | const CartScreen(), 46 | const ProfileScreen(), 47 | ]; 48 | 49 | class HomeScreen extends StatefulWidget { 50 | const HomeScreen({Key? key}) : super(key: key); 51 | 52 | @override 53 | _HomeScreenState createState() => _HomeScreenState(); 54 | } 55 | 56 | class _HomeScreenState extends State { 57 | @override 58 | void initState() { 59 | final userNotifier = Provider.of(context, listen: false); 60 | ReadCache.getString(key: AppKeys.userData).then( 61 | (token) => { 62 | userNotifier.getUserData(context: context, token: token), 63 | }, 64 | ); 65 | super.initState(); 66 | } 67 | 68 | var _currentIndex = 0; 69 | @override 70 | Widget build(BuildContext context) { 71 | ThemeNotifier _themeNotifier = Provider.of(context); 72 | var themeFlag = _themeNotifier.darkTheme; 73 | return Scaffold( 74 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 75 | body: screens[_currentIndex], 76 | bottomNavigationBar: SalomonBottomBar( 77 | selectedItemColor: 78 | themeFlag ? AppColors.rawSienna : const Color(0xff4B7191), 79 | unselectedItemColor: themeFlag ? Colors.white : const Color(0xff777777), 80 | currentIndex: _currentIndex, 81 | onTap: (i) => setState(() => _currentIndex = i), 82 | items: bottomNavBarIcons, 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/presentation/screens/loginScreen/login.view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.colors.dart'; 4 | import 'package:scarvs/app/routes/app.routes.dart'; 5 | import 'package:scarvs/presentation/screens/loginScreen/widget/welcome.login.widget.dart'; 6 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 7 | import 'package:scarvs/core/notifiers/authentication.notifer.dart'; 8 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 9 | import 'package:scarvs/presentation/widgets/custom.text.field.dart'; 10 | 11 | class LoginScreen extends StatelessWidget { 12 | LoginScreen({Key? key}) : super(key: key); 13 | final TextEditingController userEmailController = TextEditingController(); 14 | final TextEditingController userPassController = TextEditingController(); 15 | final _formKey = GlobalKey(); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | _userLogin() { 20 | if (_formKey.currentState!.validate()) { 21 | var authNotifier = 22 | Provider.of(context, listen: false); 23 | authNotifier.userLogin( 24 | context: context, 25 | useremail: userEmailController.text, 26 | userpassword: userPassController.text); 27 | } 28 | } 29 | 30 | ThemeNotifier _themeNotifier = Provider.of(context); 31 | var themeFlag = _themeNotifier.darkTheme; 32 | return SafeArea( 33 | child: Scaffold( 34 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 35 | resizeToAvoidBottomInset: false, 36 | body: Column( 37 | mainAxisAlignment: MainAxisAlignment.start, 38 | crossAxisAlignment: CrossAxisAlignment.start, 39 | children: [ 40 | welcomeTextLogin(themeFlag: themeFlag), 41 | vSizedBox2, 42 | Center( 43 | child: Column( 44 | mainAxisAlignment: MainAxisAlignment.center, 45 | crossAxisAlignment: CrossAxisAlignment.center, 46 | children: [ 47 | Form( 48 | key: _formKey, 49 | child: Column( 50 | children: [ 51 | Padding( 52 | padding: 53 | const EdgeInsets.fromLTRB(35.0, 0.0, 35.0, 2.0), 54 | child: CustomTextField.customTextField( 55 | textEditingController: userEmailController, 56 | hintText: 'Enter an email', 57 | validator: (val) => 58 | !RegExp(r'^.+@[a-zA-Z]+\.{1}[a-zA-Z]+(\.{0,1}[a-zA-Z]+)$') 59 | .hasMatch(val!) 60 | ? 'Enter an email' 61 | : null, 62 | ), 63 | ), 64 | vSizedBox1, 65 | Padding( 66 | padding: 67 | const EdgeInsets.fromLTRB(35.0, 0.0, 35.0, 2.0), 68 | child: CustomTextField.customTextField( 69 | textEditingController: userPassController, 70 | hintText: 'Enter a password', 71 | validator: (val) => 72 | val!.isEmpty ? 'Enter a password' : null, 73 | ), 74 | ) 75 | ], 76 | ), 77 | ), 78 | vSizedBox2, 79 | MaterialButton( 80 | height: MediaQuery.of(context).size.height * 0.05, 81 | minWidth: MediaQuery.of(context).size.width * 0.8, 82 | shape: RoundedRectangleBorder( 83 | borderRadius: BorderRadius.circular(8), 84 | ), 85 | onPressed: () async { 86 | _userLogin(); 87 | }, 88 | color: AppColors.rawSienna, 89 | child: const Text( 90 | 'LOGIN', 91 | style: TextStyle( 92 | color: Colors.white, 93 | fontSize: 17, 94 | fontWeight: FontWeight.w600, 95 | ), 96 | ), 97 | ) 98 | ], 99 | ), 100 | ), 101 | vSizedBox2, 102 | Row( 103 | mainAxisAlignment: MainAxisAlignment.center, 104 | children: [ 105 | Text( 106 | "Not Having A Account? ", 107 | style: TextStyle( 108 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 109 | fontSize: 14.0, 110 | ), 111 | ), 112 | GestureDetector( 113 | onTap: () => 114 | Navigator.of(context).pushNamed(AppRouter.signUpRoute), 115 | child: Text( 116 | "Sign up", 117 | style: TextStyle( 118 | decoration: TextDecoration.underline, 119 | color: 120 | themeFlag ? AppColors.creamColor : AppColors.mirage, 121 | fontSize: 14.0, 122 | ), 123 | ), 124 | ), 125 | ], 126 | ), 127 | ], 128 | ), 129 | ), 130 | ); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /lib/presentation/screens/loginScreen/widget/welcome.login.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/app/constants/app.fonts.dart'; 4 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 5 | 6 | Widget welcomeTextLogin({required bool themeFlag}) { 7 | return Column( 8 | mainAxisAlignment: MainAxisAlignment.start, 9 | crossAxisAlignment: CrossAxisAlignment.start, 10 | children: [ 11 | vSizedBox5, 12 | vSizedBox1, 13 | Padding( 14 | padding: const EdgeInsets.fromLTRB(35.0, 10.0, 35.0, 2.0), 15 | child: RichText( 16 | text: TextSpan( 17 | text: 'Hey There 😲 ', 18 | style: TextStyle( 19 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 20 | fontWeight: FontWeight.w900, 21 | fontFamily: AppFonts.contax, 22 | fontSize: 40.0, 23 | ), 24 | ), 25 | ), 26 | ), 27 | Padding( 28 | padding: const EdgeInsets.fromLTRB(35.0, 0.0, 35.0, 2.0), 29 | child: RichText( 30 | text: TextSpan( 31 | children: [ 32 | TextSpan( 33 | children: [ 34 | TextSpan( 35 | text: 'Welcome ', 36 | style: TextStyle( 37 | color: 38 | themeFlag ? AppColors.creamColor : AppColors.mirage, 39 | fontWeight: FontWeight.w300, 40 | fontSize: 28.0, 41 | fontFamily: AppFonts.contax, 42 | ), 43 | ), 44 | TextSpan( 45 | text: 'To ', 46 | style: TextStyle( 47 | color: 48 | themeFlag ? AppColors.creamColor : AppColors.mirage, 49 | fontSize: 28.0, 50 | fontFamily: AppFonts.contax, 51 | fontWeight: FontWeight.w300, 52 | ), 53 | ), 54 | TextSpan( 55 | text: 'Scarvs ! 🛒', 56 | style: TextStyle( 57 | color: 58 | themeFlag ? AppColors.creamColor : AppColors.mirage, 59 | fontSize: 28.0, 60 | fontFamily: AppFonts.contax, 61 | fontWeight: FontWeight.w300, 62 | ), 63 | ), 64 | ], 65 | ), 66 | ], 67 | ), 68 | ), 69 | ), 70 | vSizedBox2, 71 | Padding( 72 | padding: const EdgeInsets.fromLTRB(35.0, 0.0, 35.0, 2.0), 73 | child: RichText( 74 | text: TextSpan( 75 | children: [ 76 | TextSpan( 77 | children: [ 78 | TextSpan( 79 | text: 'Log In To ', 80 | style: TextStyle( 81 | color: 82 | themeFlag ? AppColors.creamColor : AppColors.mirage, 83 | fontWeight: FontWeight.w500, 84 | fontSize: 12.0, 85 | ), 86 | ), 87 | TextSpan( 88 | text: 'Your ', 89 | style: TextStyle( 90 | color: 91 | themeFlag ? AppColors.creamColor : AppColors.mirage, 92 | fontSize: 12.0, 93 | fontWeight: FontWeight.w500, 94 | ), 95 | ), 96 | TextSpan( 97 | text: 'Account Right Now ! ', 98 | style: TextStyle( 99 | color: 100 | themeFlag ? AppColors.creamColor : AppColors.mirage, 101 | fontSize: 12.0, 102 | fontWeight: FontWeight.w500, 103 | ), 104 | ), 105 | ], 106 | ), 107 | ], 108 | ), 109 | ), 110 | ), 111 | ], 112 | ); 113 | } 114 | -------------------------------------------------------------------------------- /lib/presentation/screens/onBoardingScreen/onBoarding.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:concentric_transition/concentric_transition.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:scarvs/app/constants/app.assets.dart'; 4 | import 'package:scarvs/app/constants/app.colors.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/presentation/screens/onBoardingScreen/widget/onBoarding.widget.dart'; 7 | import 'package:scarvs/core/models/onBoarding.model.dart'; 8 | 9 | class OnBoardingScreen extends StatefulWidget { 10 | OnBoardingScreen({Key? key}) : super(key: key); 11 | 12 | final List cards = [ 13 | OnBoardingModel( 14 | image: AppAssets.onBoardingOne, 15 | title: "Happily Serving Under Customer's Feet", 16 | textColor: Colors.white, 17 | bgColor: AppColors.mirage, 18 | ), 19 | OnBoardingModel( 20 | image: AppAssets.onBoardingTwo, 21 | title: "World Class Customer Support On Your Fingertips", 22 | bgColor: AppColors.creamColor, 23 | textColor: AppColors.mirage, 24 | ), 25 | OnBoardingModel( 26 | image: AppAssets.onBoardingThree, 27 | title: "Pay Us With Card For Heavy Discount's", 28 | bgColor: AppColors.rawSienna, 29 | textColor: Colors.white, 30 | ), 31 | ]; 32 | 33 | List get colors => cards.map((p) => p.bgColor).toList(); 34 | 35 | @override 36 | State createState() => _OnBoardingScreenState(); 37 | } 38 | 39 | class _OnBoardingScreenState extends State { 40 | @override 41 | Widget build(BuildContext context) { 42 | return Scaffold( 43 | body: ConcentricPageView( 44 | colors: widget.colors, 45 | radius: 30, 46 | itemCount: 3, 47 | curve: Curves.ease, 48 | duration: const Duration(seconds: 2), 49 | itemBuilder: (index) { 50 | OnBoardingModel card = widget.cards[index % widget.cards.length]; 51 | return PageCard(card: card); 52 | }, 53 | onFinish: () { 54 | Navigator.of(context).pushReplacementNamed(AppRouter.splashRoute); 55 | }, 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/presentation/screens/onBoardingScreen/widget/onBoarding.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lottie/lottie.dart'; 3 | import 'package:scarvs/core/models/onBoarding.model.dart'; 4 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 5 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 6 | 7 | class PageCard extends StatelessWidget { 8 | final OnBoardingModel card; 9 | 10 | const PageCard({ 11 | Key? key, 12 | required this.card, 13 | }) : super(key: key); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Container( 18 | margin: const EdgeInsets.symmetric( 19 | horizontal: 30.0, 20 | ), 21 | child: Column( 22 | children: [ 23 | hSizedBox4, 24 | _buildPicture(context), 25 | hSizedBox3, 26 | _buildText(context), 27 | ], 28 | ), 29 | ); 30 | } 31 | 32 | Widget _buildPicture( 33 | BuildContext context, { 34 | double size = 380, 35 | }) { 36 | return Container( 37 | width: size, 38 | height: size, 39 | margin: const EdgeInsets.only( 40 | top: 140, 41 | ), 42 | child: Lottie.asset(card.image!), 43 | ); 44 | } 45 | 46 | Widget _buildText(BuildContext context) { 47 | return Text( 48 | card.title!, 49 | textAlign: TextAlign.center, 50 | style: CustomTextWidget.bodyText1( 51 | color: card.textColor, 52 | ), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/presentation/screens/productDetailScreen/product.detail.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import 'package:scarvs/app/constants/app.assets.dart'; 5 | import 'package:scarvs/app/constants/app.colors.dart'; 6 | import 'package:scarvs/core/models/productID.model.dart'; 7 | import 'package:scarvs/core/notifiers/product.notifier.dart'; 8 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 9 | import 'package:scarvs/presentation/screens/productDetailScreen/widget/ui.detail.dart'; 10 | import 'package:scarvs/presentation/widgets/custom.loader.dart'; 11 | 12 | class ProductDetail extends StatefulWidget { 13 | final ProductDetailsArgs productDetailsArguements; 14 | const ProductDetail({ 15 | Key? key, 16 | required this.productDetailsArguements, 17 | }) : super(key: key); 18 | 19 | @override 20 | State createState() => _ProductDetailState(); 21 | } 22 | 23 | class _ProductDetailState extends State { 24 | @override 25 | Widget build(BuildContext context) { 26 | ThemeNotifier _themeNotifier = Provider.of(context); 27 | var themeFlag = _themeNotifier.darkTheme; 28 | return Scaffold( 29 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 30 | body: SingleChildScrollView( 31 | child: Padding( 32 | padding: const EdgeInsets.fromLTRB(20, 45, 20, 0), 33 | child: Consumer(builder: (context, notifier, _) { 34 | return FutureBuilder( 35 | future: notifier.fetchProductDetail( 36 | context: context, 37 | id: widget.productDetailsArguements.id.toString(), 38 | ), 39 | builder: (context, snapshot) { 40 | if (snapshot.connectionState == ConnectionState.waiting) { 41 | return Center( 42 | child: customLoader( 43 | context: context, 44 | themeFlag: themeFlag, 45 | lottieAsset: AppAssets.onBoardingOne, 46 | text: 'Please Wait Till It Loads'), 47 | ); 48 | } else if (!snapshot.hasData) { 49 | return Center( 50 | child: customLoader( 51 | context: context, 52 | themeFlag: themeFlag, 53 | text: 'Oops Some Error Occurred', 54 | lottieAsset: AppAssets.error, 55 | ), 56 | ); 57 | } else { 58 | var _snapshot = snapshot.data as SingleProductData; 59 | return productUI( 60 | context: context, 61 | themeFlag: themeFlag, 62 | snapshot: _snapshot, 63 | ); 64 | } 65 | }, 66 | ); 67 | }), 68 | ), 69 | ), 70 | ); 71 | } 72 | } 73 | 74 | class ProductDetailsArgs { 75 | final dynamic id; 76 | const ProductDetailsArgs({required this.id}); 77 | } 78 | -------------------------------------------------------------------------------- /lib/presentation/screens/productDetailScreen/widget/select.size.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.colors.dart'; 4 | import 'package:scarvs/core/notifiers/size.notifier.dart'; 5 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 6 | 7 | Widget selectSize({required bool themeFlag, required BuildContext context}) { 8 | SizeNotifier sizeNotifier(bool renderUI) => 9 | Provider.of(context, listen: renderUI); 10 | return ListView(scrollDirection: Axis.horizontal, children: [ 11 | GestureDetector( 12 | onTap: () { 13 | sizeNotifier(false).selectSizeEight(); 14 | }, 15 | child: Padding( 16 | padding: const EdgeInsets.symmetric(horizontal: 10), 17 | child: Container( 18 | width: MediaQuery.of(context).size.width * 0.20, 19 | height: MediaQuery.of(context).size.height * 0.20, 20 | child: Center( 21 | child: Padding( 22 | padding: const EdgeInsets.all(8.0), 23 | child: Text( 24 | "US 8", 25 | style: CustomTextWidget.bodyText2( 26 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 27 | ), 28 | ), 29 | ), 30 | ), 31 | decoration: BoxDecoration( 32 | border: Border.all( 33 | color: sizeNotifier(true).sizeEight 34 | ? AppColors.rawSienna 35 | : themeFlag 36 | ? AppColors.creamColor 37 | : AppColors.mirage, 38 | ), 39 | borderRadius: BorderRadius.circular(10), 40 | ), 41 | ), 42 | ), 43 | ), 44 | GestureDetector( 45 | onTap: () { 46 | sizeNotifier(false).selectSizeNine(); 47 | }, 48 | child: Padding( 49 | padding: const EdgeInsets.symmetric(horizontal: 10), 50 | child: Container( 51 | width: MediaQuery.of(context).size.width * 0.20, 52 | height: MediaQuery.of(context).size.height * 0.20, 53 | child: Center( 54 | child: Padding( 55 | padding: const EdgeInsets.all(8.0), 56 | child: Text( 57 | "US 9", 58 | style: CustomTextWidget.bodyText2( 59 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 60 | ), 61 | ), 62 | ), 63 | ), 64 | decoration: BoxDecoration( 65 | border: Border.all( 66 | color: sizeNotifier(true).sizeNine 67 | ? AppColors.rawSienna 68 | : themeFlag 69 | ? AppColors.creamColor 70 | : AppColors.mirage, 71 | ), 72 | borderRadius: BorderRadius.circular(10), 73 | ), 74 | ), 75 | ), 76 | ), 77 | GestureDetector( 78 | onTap: () { 79 | sizeNotifier(false).selectSizeTen(); 80 | }, 81 | child: Padding( 82 | padding: const EdgeInsets.symmetric(horizontal: 10), 83 | child: Container( 84 | width: MediaQuery.of(context).size.width * 0.20, 85 | height: MediaQuery.of(context).size.height * 0.20, 86 | child: Center( 87 | child: Padding( 88 | padding: const EdgeInsets.all(8.0), 89 | child: Text( 90 | "US 10", 91 | style: CustomTextWidget.bodyText2( 92 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 93 | ), 94 | ), 95 | ), 96 | ), 97 | decoration: BoxDecoration( 98 | border: Border.all( 99 | color: sizeNotifier(true).sizeTen 100 | ? AppColors.rawSienna 101 | : themeFlag 102 | ? AppColors.creamColor 103 | : AppColors.mirage, 104 | ), 105 | borderRadius: BorderRadius.circular(10), 106 | ), 107 | ), 108 | ), 109 | ), 110 | GestureDetector( 111 | onTap: () { 112 | sizeNotifier(false).selectSizeEleven(); 113 | }, 114 | child: Padding( 115 | padding: const EdgeInsets.symmetric(horizontal: 10), 116 | child: Container( 117 | width: MediaQuery.of(context).size.width * 0.20, 118 | height: MediaQuery.of(context).size.height * 0.20, 119 | child: Center( 120 | child: Padding( 121 | padding: const EdgeInsets.all(8.0), 122 | child: Text( 123 | "US 11", 124 | style: CustomTextWidget.bodyText2( 125 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 126 | ), 127 | ), 128 | ), 129 | ), 130 | decoration: BoxDecoration( 131 | border: Border.all( 132 | color: sizeNotifier(true).sizeEleven 133 | ? AppColors.rawSienna 134 | : themeFlag 135 | ? AppColors.creamColor 136 | : AppColors.mirage, 137 | ), 138 | borderRadius: BorderRadius.circular(10), 139 | ), 140 | ), 141 | ), 142 | ), 143 | ]); 144 | } 145 | -------------------------------------------------------------------------------- /lib/presentation/screens/productDetailScreen/widget/ui.detail.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.assets.dart'; 4 | import 'package:scarvs/app/constants/app.colors.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/core/models/productID.model.dart'; 7 | import 'package:scarvs/core/notifiers/cart.notifier.dart'; 8 | import 'package:scarvs/core/notifiers/size.notifier.dart'; 9 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 10 | import 'package:scarvs/core/utils/snackbar.util.dart'; 11 | import 'package:scarvs/presentation/screens/productDetailScreen/widget/select.size.dart'; 12 | import 'package:scarvs/presentation/widgets/custom.back.btn.dart'; 13 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 14 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 15 | 16 | Widget productUI({ 17 | required BuildContext context, 18 | required bool themeFlag, 19 | required SingleProductData snapshot, 20 | }) { 21 | CartNotifier cartNotifier = Provider.of(context, listen: false); 22 | UserNotifier userNotifier = Provider.of(context, listen: false); 23 | SizeNotifier sizeNotifier = Provider.of(context, listen: false); 24 | 25 | return Column( 26 | crossAxisAlignment: CrossAxisAlignment.start, 27 | children: [ 28 | CustomBackPop(themeFlag: themeFlag), 29 | Column( 30 | children: [ 31 | Center( 32 | child: Text( 33 | snapshot.productName, 34 | style: CustomTextWidget.bodyTextB1( 35 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 36 | ), 37 | ), 38 | ), 39 | vSizedBox2, 40 | Stack( 41 | alignment: Alignment.center, 42 | children: [ 43 | SizedBox( 44 | height: MediaQuery.of(context).size.height * 0.3, 45 | width: MediaQuery.of(context).size.width * 0.8, 46 | child: themeFlag 47 | ? Image.asset(AppAssets.diamondWhite) 48 | : Image.asset(AppAssets.diamondBlack), 49 | ), 50 | Hero( 51 | tag: Key(snapshot.productId.toString()), 52 | child: InteractiveViewer( 53 | child: SizedBox( 54 | height: MediaQuery.of(context).size.height * 0.22, 55 | width: MediaQuery.of(context).size.width * 0.7, 56 | child: Image.network(snapshot.productImage), 57 | ), 58 | ), 59 | ), 60 | ], 61 | ), 62 | vSizedBox2, 63 | Text( 64 | snapshot.productDescription, 65 | style: CustomTextWidget.bodyText3( 66 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 67 | ), 68 | textAlign: TextAlign.justify, 69 | ), 70 | ], 71 | ), 72 | vSizedBox2, 73 | Text( 74 | 'Choose Size', 75 | style: CustomTextWidget.bodyTextB4( 76 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 77 | ), 78 | ), 79 | vSizedBox2, 80 | SizedBox( 81 | height: MediaQuery.of(context).size.height * 0.05, 82 | width: MediaQuery.of(context).size.width, 83 | child: selectSize(context: context, themeFlag: themeFlag), 84 | ), 85 | Padding( 86 | padding: const EdgeInsets.fromLTRB(20, 20, 20, 0), 87 | child: Row( 88 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 89 | children: [ 90 | Text( 91 | '₹ ${snapshot.productPrice}', 92 | style: CustomTextWidget.bodyTextUltra( 93 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 94 | ), 95 | ), 96 | ElevatedButton( 97 | style: ElevatedButton.styleFrom( 98 | backgroundColor: themeFlag ? AppColors.creamColor : AppColors.mirage, 99 | enableFeedback: true, 100 | padding: const EdgeInsets.symmetric( 101 | horizontal: 25, 102 | vertical: 8, 103 | ), 104 | shape: RoundedRectangleBorder( 105 | borderRadius: BorderRadius.circular(8.0), 106 | ), 107 | ), 108 | onPressed: () { 109 | cartNotifier 110 | .addToCart( 111 | useremail: userNotifier.getUserEmail!, 112 | productPrice: snapshot.productPrice, 113 | productName: snapshot.productName, 114 | productCategory: snapshot.productCategory, 115 | productImage: snapshot.productImage, 116 | context: context, 117 | productSize: sizeNotifier.getSize, 118 | ) 119 | .then((value) { 120 | if (value) { 121 | ScaffoldMessenger.of(context).showSnackBar( 122 | SnackUtil.stylishSnackBar( 123 | text: 'Added To Cart', 124 | context: context, 125 | ), 126 | ); 127 | Navigator.of(context).pushNamed(AppRouter.homeRoute); 128 | } else { 129 | ScaffoldMessenger.of(context).showSnackBar( 130 | SnackUtil.stylishSnackBar( 131 | text: 'Oops Something Went Wrong', 132 | context: context, 133 | ), 134 | ); 135 | } 136 | }); 137 | }, 138 | child: Text( 139 | 'Add To Cart', 140 | style: CustomTextWidget.bodyTextB2( 141 | color: themeFlag ? AppColors.mirage : AppColors.creamColor, 142 | ), 143 | ), 144 | ), 145 | ], 146 | ), 147 | ) 148 | ], 149 | ); 150 | } 151 | -------------------------------------------------------------------------------- /lib/presentation/screens/productScreen/widgets/brands.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.assets.dart'; 4 | import 'package:scarvs/app/constants/app.colors.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 7 | import 'package:scarvs/presentation/screens/categoryScreen/category.screen.dart'; 8 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 9 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 10 | 11 | class BrandWidget extends StatelessWidget { 12 | const BrandWidget({Key? key}) : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | ThemeNotifier _themeNotifier = Provider.of(context); 17 | var themeFlag = _themeNotifier.darkTheme; 18 | 19 | List _categories = [ 20 | "Jordan's", 21 | "Adidas", 22 | "Puma", 23 | "Reebok", 24 | "Nike", 25 | ]; 26 | List _categoriesImages = [ 27 | AppAssets.brandJordan, 28 | AppAssets.brandAdidas, 29 | AppAssets.brandPuma, 30 | AppAssets.brandReebok, 31 | AppAssets.brandNike 32 | ]; 33 | 34 | showBrands(String text, String images) { 35 | return GestureDetector( 36 | onTap: () { 37 | Navigator.of(context).pushNamed( 38 | AppRouter.categoryRoute, 39 | arguments: CategoryScreenArgs(categoryName: text), 40 | ); 41 | }, 42 | child: Padding( 43 | padding: const EdgeInsets.symmetric(horizontal: 10), 44 | child: Card( 45 | shape: RoundedRectangleBorder( 46 | borderRadius: BorderRadius.circular(10), 47 | side: BorderSide( 48 | color: Colors.grey.withOpacity(0.2), 49 | width: 1, 50 | ), 51 | ), 52 | elevation: 6, 53 | color: themeFlag ? AppColors.mirage : AppColors.creamColor, 54 | child: Column( 55 | children: [ 56 | SizedBox( 57 | height: MediaQuery.of(context).size.height * 0.14, 58 | width: MediaQuery.of(context).size.width * 0.38, 59 | child: Image.network(images), 60 | ), 61 | vSizedBox1, 62 | Text( 63 | text, 64 | style: CustomTextWidget.bodyText2( 65 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 66 | ), 67 | ) 68 | ], 69 | ), 70 | ), 71 | ), 72 | ); 73 | } 74 | 75 | return Column( 76 | mainAxisAlignment: MainAxisAlignment.start, 77 | crossAxisAlignment: CrossAxisAlignment.start, 78 | children: [ 79 | Text( 80 | 'Brands We Have', 81 | style: CustomTextWidget.bodyTextB2( 82 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 83 | ), 84 | ), 85 | vSizedBox2, 86 | SizedBox( 87 | height: MediaQuery.of(context).size.height * 0.20, 88 | width: MediaQuery.of(context).size.width, 89 | child: ListView.builder( 90 | shrinkWrap: false, 91 | scrollDirection: Axis.horizontal, 92 | physics: const ScrollPhysics(), 93 | itemCount: _categories.length, 94 | itemBuilder: (BuildContext context, int index) { 95 | return showBrands( 96 | _categories[index], 97 | _categoriesImages[index], 98 | ); 99 | }, 100 | ), 101 | ) 102 | ], 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/presentation/screens/productScreen/widgets/recommended.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/app/routes/app.routes.dart'; 4 | import 'package:scarvs/core/models/product.model.dart'; 5 | import 'package:scarvs/presentation/screens/productDetailScreen/product.detail.screen.dart'; 6 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 7 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 8 | 9 | Widget productForYou( 10 | {required snapshot, required themeFlag, required BuildContext context}) { 11 | return ListView.builder( 12 | physics: const ScrollPhysics(), 13 | shrinkWrap: true, 14 | itemCount: snapshot.length, 15 | scrollDirection: Axis.horizontal, 16 | itemBuilder: (context, index) { 17 | ProductData prod = snapshot[index]; 18 | return GestureDetector( 19 | onTap: () { 20 | Navigator.of(context).pushNamed( 21 | AppRouter.prodDetailRoute, 22 | arguments: ProductDetailsArgs(id: prod.productId), 23 | ); 24 | }, 25 | child: Padding( 26 | padding: const EdgeInsets.symmetric(horizontal: 10), 27 | child: Card( 28 | shape: RoundedRectangleBorder( 29 | borderRadius: BorderRadius.circular(10), 30 | side: BorderSide( 31 | color: Colors.grey.withOpacity(0.2), 32 | width: 1, 33 | ), 34 | ), 35 | elevation: 6, 36 | color: themeFlag ? AppColors.mirage : AppColors.creamColor, 37 | child: Column( 38 | mainAxisAlignment: MainAxisAlignment.start, 39 | crossAxisAlignment: CrossAxisAlignment.start, 40 | children: [ 41 | Hero( 42 | tag: Key(prod.productId.toString()), 43 | child: SizedBox( 44 | height: MediaQuery.of(context).size.height * 0.15, 45 | width: MediaQuery.of(context).size.height * 0.165, 46 | child: Image.network( 47 | prod.productImage, 48 | fit: BoxFit.scaleDown, 49 | ), 50 | ), 51 | ), 52 | vSizedBox1, 53 | Container( 54 | margin: const EdgeInsets.fromLTRB(8, 8, 8, 8), 55 | child: Column( 56 | mainAxisAlignment: MainAxisAlignment.start, 57 | crossAxisAlignment: CrossAxisAlignment.start, 58 | children: [ 59 | Text( 60 | prod.productName, 61 | style: CustomTextWidget.bodyText3( 62 | color: themeFlag 63 | ? AppColors.creamColor 64 | : AppColors.mirage, 65 | ), 66 | maxLines: 2, 67 | overflow: TextOverflow.ellipsis, 68 | ), 69 | Text( 70 | '₹ ${prod.productPrice}', 71 | style: CustomTextWidget.bodyText3( 72 | color: themeFlag 73 | ? AppColors.creamColor 74 | : AppColors.mirage, 75 | ), 76 | maxLines: 2, 77 | overflow: TextOverflow.ellipsis, 78 | ), 79 | ], 80 | ), 81 | ), 82 | ], 83 | ), 84 | ), 85 | ), 86 | ); 87 | }, 88 | ); 89 | } 90 | -------------------------------------------------------------------------------- /lib/presentation/screens/profileScreens/appSettingsScreen/app.setting.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:scarvs/app/constants/app.colors.dart'; 4 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 5 | import 'package:scarvs/presentation/widgets/custom.back.btn.dart'; 6 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 7 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 8 | 9 | class AppSettings extends StatelessWidget { 10 | const AppSettings({Key? key}) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | ThemeNotifier _themeNotifier = Provider.of(context); 15 | var themeFlag = _themeNotifier.darkTheme; 16 | return SafeArea( 17 | child: Scaffold( 18 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 19 | body: Column( 20 | children: [ 21 | Row( 22 | children: [ 23 | CustomBackPop(themeFlag: themeFlag), 24 | Text( 25 | 'App Settings', 26 | style: CustomTextWidget.bodyTextB2( 27 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 28 | ), 29 | ), 30 | ], 31 | ), 32 | Consumer( 33 | builder: (context, notifier, _) { 34 | return SwitchListTile( 35 | contentPadding: const EdgeInsets.only(left: 16, right: 4), 36 | title: const Text( 37 | 'Dark Mode', 38 | style: TextStyle( 39 | fontSize: 15, 40 | ), 41 | ), 42 | value: themeFlag, 43 | activeColor: 44 | themeFlag ? AppColors.creamColor : AppColors.mirage, 45 | onChanged: (bool value) { 46 | notifier.toggleTheme(); 47 | }, 48 | ); 49 | }, 50 | ), 51 | Divider(height: 0, color: Colors.grey[400]), 52 | vSizedBox2, 53 | Text( 54 | 'App Version', 55 | style: TextStyle( 56 | fontSize: 14, 57 | color: themeFlag ? AppColors.creamColor : AppColors.mirage), 58 | ), 59 | const SizedBox( 60 | height: 5, 61 | ), 62 | Text( 63 | '0.0.1', 64 | style: TextStyle( 65 | fontSize: 14, 66 | color: themeFlag ? AppColors.creamColor : AppColors.mirage), 67 | ), 68 | ], 69 | ), 70 | ), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/presentation/screens/profileScreens/changePasswordScreen/change.password.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:cache_manager/cache_manager.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:scarvs/app/constants/app.colors.dart'; 4 | import 'package:scarvs/app/constants/app.keys.dart'; 5 | import 'package:scarvs/app/routes/app.routes.dart'; 6 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 7 | import 'package:provider/provider.dart'; 8 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 9 | import 'package:scarvs/core/utils/snackbar.util.dart'; 10 | import 'package:scarvs/presentation/widgets/custom.back.btn.dart'; 11 | import 'package:scarvs/presentation/widgets/custom.text.field.dart'; 12 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 13 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 14 | 15 | class ChangePasswordScreen extends StatelessWidget { 16 | final TextEditingController oldPassController = TextEditingController(); 17 | final TextEditingController newPassController = TextEditingController(); 18 | final _formKey = GlobalKey(); 19 | 20 | ChangePasswordScreen({Key? key}) : super(key: key); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | ThemeNotifier _themeNotifier = Provider.of(context); 25 | var themeFlag = _themeNotifier.darkTheme; 26 | UserNotifier userNotifier = 27 | Provider.of(context, listen: false); 28 | return SafeArea( 29 | child: Scaffold( 30 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 31 | body: Column( 32 | children: [ 33 | Row( 34 | children: [ 35 | CustomBackPop(themeFlag: themeFlag), 36 | Text( 37 | 'Change Password', 38 | style: CustomTextWidget.bodyTextB2( 39 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 40 | ), 41 | ), 42 | ], 43 | ), 44 | Form( 45 | key: _formKey, 46 | child: Padding( 47 | padding: const EdgeInsets.fromLTRB(35.0, 45.0, 35.0, 2.0), 48 | child: Column( 49 | children: [ 50 | CustomTextField.customTextField( 51 | textEditingController: oldPassController, 52 | hintText: 'Enter Old Password', 53 | validator: (val) => 54 | val!.isEmpty ? 'Enter Old Password' : null, 55 | ), 56 | vSizedBox3, 57 | CustomTextField.customTextField( 58 | textEditingController: newPassController, 59 | hintText: 'Enter New Password', 60 | validator: (val) => 61 | val!.isEmpty ? 'Enter New Password' : null, 62 | ), 63 | vSizedBox3, 64 | MaterialButton( 65 | height: MediaQuery.of(context).size.height * 0.05, 66 | minWidth: MediaQuery.of(context).size.width * 0.8, 67 | shape: RoundedRectangleBorder( 68 | borderRadius: BorderRadius.circular(8), 69 | ), 70 | onPressed: () async { 71 | if (_formKey.currentState!.validate()) { 72 | userNotifier 73 | .changePassword( 74 | userEmail: userNotifier.getUserEmail!, 75 | oluserpassword: oldPassController.text, 76 | newuserpassword: newPassController.text, 77 | context: context) 78 | .then((value) { 79 | if (value) { 80 | ScaffoldMessenger.of(context).showSnackBar( 81 | SnackUtil.stylishSnackBar( 82 | text: 83 | 'Password Changed , Please Login Again', 84 | context: context), 85 | ); 86 | DeleteCache.deleteKey(AppKeys.userData) 87 | .whenComplete(() { 88 | Navigator.of(context) 89 | .pushReplacementNamed(AppRouter.loginRoute); 90 | }); 91 | } 92 | if (!value) { 93 | ScaffoldMessenger.of(context).showSnackBar( 94 | SnackUtil.stylishSnackBar( 95 | text: 'Ehh Wrong Pass', context: context), 96 | ); 97 | } 98 | }); 99 | } 100 | }, 101 | color: AppColors.rawSienna, 102 | child: const Text( 103 | 'Change', 104 | style: TextStyle( 105 | color: Colors.white, 106 | fontSize: 17, 107 | fontWeight: FontWeight.w600, 108 | ), 109 | ), 110 | ), 111 | ], 112 | ), 113 | ), 114 | ) 115 | ], 116 | ), 117 | ), 118 | ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /lib/presentation/screens/profileScreens/editProfileScreen/edit.profile.screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 4 | import 'package:provider/provider.dart'; 5 | import 'package:scarvs/core/notifiers/user.notifier.dart'; 6 | import 'package:scarvs/core/utils/snackbar.util.dart'; 7 | import 'package:scarvs/presentation/widgets/custom.back.btn.dart'; 8 | import 'package:scarvs/presentation/widgets/custom.text.field.dart'; 9 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 10 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 11 | 12 | class EditProfileScreen extends StatelessWidget { 13 | final TextEditingController addressController = TextEditingController(); 14 | final TextEditingController numberController = TextEditingController(); 15 | final _formKey = GlobalKey(); 16 | 17 | EditProfileScreen({Key? key}) : super(key: key); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | ThemeNotifier _themeNotifier = Provider.of(context); 22 | var themeFlag = _themeNotifier.darkTheme; 23 | UserNotifier userNotifier = 24 | Provider.of(context, listen: false); 25 | String patttern = r'(^(?:[+0]9)?[0-9]{10,15}$)'; 26 | return SafeArea( 27 | child: Scaffold( 28 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 29 | body: Column( 30 | children: [ 31 | Row( 32 | children: [ 33 | CustomBackPop(themeFlag: themeFlag), 34 | Text( 35 | 'Edit Profile', 36 | style: CustomTextWidget.bodyTextB2( 37 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 38 | ), 39 | ), 40 | ], 41 | ), 42 | Form( 43 | key: _formKey, 44 | child: Padding( 45 | padding: const EdgeInsets.fromLTRB(35.0, 45.0, 35.0, 2.0), 46 | child: Column( 47 | children: [ 48 | CustomTextField.customTextField( 49 | textEditingController: addressController, 50 | hintText: 'Enter Address', 51 | validator: (val) => val!.isEmpty ? 'Enter Address' : null, 52 | ), 53 | vSizedBox3, 54 | CustomTextField.customTextField( 55 | textEditingController: numberController, 56 | hintText: 'Enter Phone No', 57 | validator: (val) => !RegExp(patttern).hasMatch(val!) 58 | ? 'Enter Phone No' 59 | : null, 60 | ), 61 | vSizedBox3, 62 | MaterialButton( 63 | height: MediaQuery.of(context).size.height * 0.05, 64 | minWidth: MediaQuery.of(context).size.width * 0.8, 65 | shape: RoundedRectangleBorder( 66 | borderRadius: BorderRadius.circular(8), 67 | ), 68 | onPressed: () async { 69 | if (_formKey.currentState!.validate()) { 70 | userNotifier 71 | .updateUserDetails( 72 | userEmail: userNotifier.getUserEmail!, 73 | userAddress: addressController.text, 74 | userPhoneNo: numberController.text, 75 | context: context) 76 | .then((value) { 77 | if (value) { 78 | ScaffoldMessenger.of(context).showSnackBar( 79 | SnackUtil.stylishSnackBar( 80 | text: 'Info Updated', 81 | context: context, 82 | ), 83 | ); 84 | Navigator.of(context).pop(); 85 | } else { 86 | ScaffoldMessenger.of(context).showSnackBar( 87 | SnackUtil.stylishSnackBar( 88 | text: 89 | 'Error Please Try Again , After a While', 90 | context: context, 91 | ), 92 | ); 93 | Navigator.of(context).pop(); 94 | } 95 | }); 96 | } 97 | }, 98 | color: AppColors.rawSienna, 99 | child: const Text( 100 | 'Update', 101 | style: TextStyle( 102 | color: Colors.white, 103 | fontSize: 17, 104 | fontWeight: FontWeight.w600, 105 | ), 106 | ), 107 | ), 108 | ], 109 | ), 110 | ), 111 | ) 112 | ], 113 | ), 114 | ), 115 | ); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /lib/presentation/screens/signUpScreen/widget/welcome.signup.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/app/constants/app.fonts.dart'; 4 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 5 | import 'package:scarvs/presentation/widgets/dimensions.widget.dart'; 6 | 7 | Widget welcomeTextSignup({required bool themeFlag}) { 8 | return Column( 9 | mainAxisAlignment: MainAxisAlignment.start, 10 | crossAxisAlignment: CrossAxisAlignment.start, 11 | children: [ 12 | vSizedBox4, 13 | vSizedBox1, 14 | Padding( 15 | padding: const EdgeInsets.fromLTRB(35.0, 10.0, 35.0, 2.0), 16 | child: RichText( 17 | text: TextSpan( 18 | text: 'Hey There 😲', 19 | style: TextStyle( 20 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 21 | fontWeight: FontWeight.w900, 22 | fontFamily: AppFonts.contax, 23 | fontSize: 35.0, 24 | ), 25 | ), 26 | ), 27 | ), 28 | Padding( 29 | padding: const EdgeInsets.fromLTRB(35.0, 0.0, 35.0, 2.0), 30 | child: RichText( 31 | text: TextSpan( 32 | children: [ 33 | TextSpan( 34 | children: [ 35 | TextSpan( 36 | text: 'Welcome To ', 37 | style: TextStyle( 38 | color: 39 | themeFlag ? AppColors.creamColor : AppColors.mirage, 40 | fontFamily: AppFonts.contax, 41 | fontSize: 28.0, 42 | fontWeight: FontWeight.w300, 43 | ), 44 | ), 45 | TextSpan( 46 | text: 'Scarvs ! 🛒 ', 47 | style: TextStyle( 48 | color: 49 | themeFlag ? AppColors.creamColor : AppColors.mirage, 50 | fontFamily: AppFonts.contax, 51 | fontSize: 28.0, 52 | ), 53 | ), 54 | ], 55 | ), 56 | ], 57 | ), 58 | ), 59 | ), 60 | vSizedBox2, 61 | Padding( 62 | padding: const EdgeInsets.fromLTRB(35.0, 0.0, 35.0, 2.0), 63 | child: RichText( 64 | text: TextSpan( 65 | children: [ 66 | TextSpan( 67 | children: [ 68 | TextSpan( 69 | text: "Signup ", 70 | style: CustomTextWidget.bodyTextB4( 71 | color: 72 | themeFlag ? AppColors.creamColor : AppColors.mirage, 73 | ), 74 | ), 75 | TextSpan( 76 | text: "& Buy Shoes At Rock Bottom Prices", 77 | style: CustomTextWidget.bodyTextB4( 78 | color: 79 | themeFlag ? AppColors.creamColor : AppColors.mirage, 80 | ), 81 | ), 82 | ], 83 | ), 84 | ], 85 | ), 86 | ), 87 | ), 88 | vSizedBox2, 89 | ], 90 | ); 91 | } 92 | -------------------------------------------------------------------------------- /lib/presentation/screens/splashScreen/splash.screen.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:cache_manager/cache_manager.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | import 'package:scarvs/app/constants/app.colors.dart'; 6 | import 'package:scarvs/app/constants/app.fonts.dart'; 7 | import 'package:scarvs/app/constants/app.keys.dart'; 8 | import 'package:scarvs/app/routes/app.routes.dart'; 9 | import 'package:scarvs/core/notifiers/theme.notifier.dart'; 10 | 11 | class SplashScreen extends StatefulWidget { 12 | const SplashScreen({Key? key}) : super(key: key); 13 | 14 | @override 15 | State createState() => _SplashScreenState(); 16 | } 17 | 18 | class _SplashScreenState extends State { 19 | Future _initiateCache() async { 20 | return CacheManagerUtils.conditionalCache( 21 | key: AppKeys.onBoardDone, 22 | valueType: ValueType.StringValue, 23 | actionIfNull: () { 24 | Navigator.of(context).pushNamed(AppRouter.onBoardRoute).whenComplete( 25 | () => WriteCache.setString( 26 | key: AppKeys.onBoardDone, value: 'Something') 27 | ); 28 | }, 29 | actionIfNotNull: () { 30 | CacheManagerUtils.conditionalCache( 31 | key: AppKeys.userData, 32 | valueType: ValueType.StringValue, 33 | actionIfNull: () { 34 | Navigator.of(context).pushNamed(AppRouter.loginRoute); 35 | }, 36 | actionIfNotNull: () { 37 | Navigator.of(context).pushReplacementNamed(AppRouter.homeRoute); 38 | }); 39 | }, 40 | ); 41 | } 42 | 43 | @override 44 | void initState() { 45 | Timer(const Duration(seconds: 1), _initiateCache); 46 | super.initState(); 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | ThemeNotifier _themeNotifier = Provider.of(context); 52 | var themeFlag = _themeNotifier.darkTheme; 53 | return Scaffold( 54 | backgroundColor: themeFlag ? AppColors.mirage : AppColors.creamColor, 55 | body: Center( 56 | child: Column( 57 | mainAxisAlignment: MainAxisAlignment.center, 58 | crossAxisAlignment: CrossAxisAlignment.center, 59 | children: [ 60 | Text( 61 | 'Scarvs', 62 | style: TextStyle( 63 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 64 | fontFamily: AppFonts.contax, 65 | fontSize: 50.0, 66 | ), 67 | ), 68 | ], 69 | ), 70 | ), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom.animated.container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomAnimatedContainer { 4 | static customAnimatedContainer( 5 | {required double height, 6 | required double width, 7 | required BuildContext context, 8 | required Color color, 9 | required Curve curve}) { 10 | return AnimatedContainer( 11 | duration: const Duration(seconds: 2), 12 | height: height, 13 | width: width, 14 | decoration: BoxDecoration( 15 | color: color, 16 | borderRadius: BorderRadius.circular(15), 17 | ), 18 | curve: curve, 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom.back.btn.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scarvs/app/constants/app.colors.dart'; 4 | 5 | class CustomBackButton extends StatelessWidget { 6 | final String route; 7 | final bool themeFlag; 8 | const CustomBackButton({ 9 | Key? key, 10 | required this.route, 11 | required this.themeFlag, 12 | }) : super(key: key); 13 | @override 14 | Widget build(BuildContext context) { 15 | return IconButton( 16 | onPressed: () { 17 | Navigator.of(context).pushNamed(route); 18 | }, 19 | icon: Icon( 20 | Icons.arrow_back_ios, 21 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class CustomBackPop extends StatelessWidget { 28 | final bool themeFlag; 29 | const CustomBackPop({ 30 | Key? key, 31 | required this.themeFlag, 32 | }) : super(key: key); 33 | @override 34 | Widget build(BuildContext context) { 35 | return IconButton( 36 | onPressed: () { 37 | Navigator.of(context).pop(); 38 | }, 39 | icon: Icon( 40 | Icons.arrow_back_ios, 41 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom.design.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomDesign extends CustomClipper { 4 | @override 5 | Path getClip(Size size) { 6 | var path = Path(); 7 | path.lineTo(0.0, size.height - 20); 8 | path.quadraticBezierTo(0.0, size.height, 20.0, size.height); 9 | path.lineTo(size.width - 20.0, size.height); 10 | path.quadraticBezierTo( 11 | size.width, size.height, size.width, size.height - 20); 12 | path.lineTo(size.width, 50.0); 13 | path.quadraticBezierTo(size.width, 30.0, size.width - 20.0, 30.0); 14 | path.lineTo(20.0, 5.0); 15 | path.quadraticBezierTo(0.0, 0.0, 0.0, 20.0); 16 | return path; 17 | } 18 | 19 | @override 20 | bool shouldReclip(CustomClipper oldClipper) => false; 21 | } 22 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom.loader.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:lottie/lottie.dart'; 3 | import 'package:scarvs/app/constants/app.colors.dart'; 4 | import 'package:scarvs/presentation/widgets/custom.text.style.dart'; 5 | 6 | Widget customLoader( 7 | {required BuildContext context, 8 | required bool themeFlag, 9 | required String lottieAsset, 10 | required String text}) { 11 | return Column( 12 | mainAxisAlignment: MainAxisAlignment.center, 13 | crossAxisAlignment: CrossAxisAlignment.center, 14 | children: [ 15 | SizedBox( 16 | height: MediaQuery.of(context).size.height * 0.4, 17 | width: MediaQuery.of(context).size.width * 0.8, 18 | child: Lottie.asset( 19 | lottieAsset, 20 | ), 21 | ), 22 | Text( 23 | text, 24 | style: CustomTextWidget.bodyTextUltra( 25 | color: themeFlag ? AppColors.creamColor : AppColors.mirage, 26 | ), 27 | ), 28 | ], 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom.text.field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.colors.dart'; 3 | import 'package:scarvs/app/constants/app.fonts.dart'; 4 | 5 | class CustomTextField { 6 | static customTextField( 7 | {required TextEditingController textEditingController, 8 | required String hintText, 9 | String? Function(String?)? validator, 10 | Function(String)? onChanged}) { 11 | return TextFormField( 12 | keyboardType: TextInputType.visiblePassword, 13 | style: const TextStyle( 14 | color: Colors.black, 15 | fontFamily: AppFonts.contax, 16 | ), 17 | onChanged: onChanged, 18 | controller: textEditingController, 19 | validator: validator, 20 | decoration: InputDecoration( 21 | fillColor: Colors.white, 22 | filled: true, 23 | contentPadding: 24 | const EdgeInsets.symmetric(horizontal: 30, vertical: 20), 25 | hintText: hintText, 26 | hintStyle: TextStyle( 27 | color: AppColors.blueZodiac, 28 | ), 29 | enabledBorder: const OutlineInputBorder( 30 | borderRadius: BorderRadius.all( 31 | Radius.circular(12), 32 | ), 33 | borderSide: BorderSide( 34 | width: 1.5, 35 | ), 36 | ), 37 | focusedBorder: OutlineInputBorder( 38 | borderRadius: const BorderRadius.all( 39 | Radius.circular(8), 40 | ), 41 | borderSide: BorderSide(color: AppColors.rawSienna), 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom.text.style.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:scarvs/app/constants/app.fonts.dart'; 3 | 4 | class CustomTextWidget { 5 | static bodyTextB1({required Color color}) { 6 | return TextStyle( 7 | fontFamily: AppFonts.contax, 8 | color: color, 9 | fontWeight: FontWeight.bold, 10 | fontSize: 24.0, 11 | ); 12 | } 13 | 14 | static bodyTextB2({required Color color}) { 15 | return TextStyle( 16 | fontFamily: AppFonts.contax, 17 | color: color, 18 | fontWeight: FontWeight.w900, 19 | fontSize: 20.0, 20 | ); 21 | } 22 | 23 | static bodyTextB3({required Color color}) { 24 | return TextStyle( 25 | fontFamily: AppFonts.contax, 26 | color: color, 27 | fontWeight: FontWeight.w900, 28 | fontSize: 16.0, 29 | ); 30 | } 31 | 32 | static bodyTextB4({required Color color}) { 33 | return TextStyle( 34 | fontFamily: AppFonts.contax, 35 | color: color, 36 | fontWeight: FontWeight.w900, 37 | fontSize: 14.0, 38 | ); 39 | } 40 | 41 | static bodyTextUltra({required Color color}) { 42 | return TextStyle( 43 | fontFamily: AppFonts.contax, 44 | color: color, 45 | fontWeight: FontWeight.bold, 46 | fontSize: 28.0, 47 | ); 48 | } 49 | 50 | static bodyText1({required Color color}) { 51 | return TextStyle( 52 | fontFamily: AppFonts.contax, 53 | color: color, 54 | fontSize: 18.0, 55 | ); 56 | } 57 | 58 | static bodyText2({required Color color}) { 59 | return TextStyle( 60 | fontFamily: AppFonts.contax, 61 | color: color, 62 | fontSize: 16.0, 63 | ); 64 | } 65 | 66 | static bodyText3({required Color color}) { 67 | return TextStyle( 68 | fontFamily: AppFonts.contax, 69 | color: color, 70 | fontSize: 14.0, 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/presentation/widgets/dimensions.widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const double vBox1 = 10.0; 4 | const double vBox2 = 20.0; 5 | const double vBox3 = 40.0; 6 | const double vBox4 = 80.0; 7 | const double vBox5 = 160.0; 8 | 9 | const double hBox1 = 10.0; 10 | const double hBox2 = 20.0; 11 | const double hBox3 = 40.0; 12 | const double hBox4 = 80.0; 13 | const double hBox5 = 160.0; 14 | 15 | const SizedBox vSizedBox1 = SizedBox(height: vBox1); 16 | const SizedBox vSizedBox2 = SizedBox(height: vBox2); 17 | const SizedBox vSizedBox3 = SizedBox(height: vBox3); 18 | const SizedBox vSizedBox4 = SizedBox(height: vBox4); 19 | const SizedBox vSizedBox5 = SizedBox(height: vBox5); 20 | 21 | const SizedBox hSizedBox1 = SizedBox(width: hBox1); 22 | const SizedBox hSizedBox2 = SizedBox(width: hBox2); 23 | const SizedBox hSizedBox3 = SizedBox(width: hBox3); 24 | const SizedBox hSizedBox4 = SizedBox(width: hBox4); 25 | const SizedBox gSizedBox5 = SizedBox(height: hBox5); 26 | -------------------------------------------------------------------------------- /lib/presentation/widgets/shimmer.effects.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shimmer/shimmer.dart'; 3 | 4 | class ShimmerEffects { 5 | static final Color _shimmerColor = Colors.grey[200]!; 6 | static final Color _shimmerColorDark = Colors.grey[500]!; 7 | static const double _spaceHeight = 10; 8 | 9 | static loadShimmer({required BuildContext context}) { 10 | return Shimmer.fromColors( 11 | child: ListView.builder( 12 | physics: const ScrollPhysics(), 13 | shrinkWrap: true, 14 | itemCount: 8, 15 | scrollDirection: Axis.horizontal, 16 | itemBuilder: (BuildContext context, int index) { 17 | return Padding( 18 | padding: const EdgeInsets.only(left: 8.0, right: 16.0), 19 | child: Container( 20 | height: 250, 21 | width: 170, 22 | decoration: BoxDecoration( 23 | borderRadius: const BorderRadius.all( 24 | Radius.circular(20.0), 25 | ), 26 | color: Colors.white, 27 | border: Border.all( 28 | color: Colors.grey.shade400, 29 | width: 3.1, 30 | ), 31 | ), 32 | ), 33 | ); 34 | }, 35 | ), 36 | baseColor: _shimmerColor, 37 | highlightColor: _shimmerColorDark, 38 | ); 39 | } 40 | 41 | static buildCategoryShimmer({required BuildContext context}) { 42 | return GridView.count( 43 | padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), 44 | primary: false, 45 | childAspectRatio: 5 / 8, 46 | shrinkWrap: true, 47 | crossAxisSpacing: 8, 48 | mainAxisSpacing: 8, 49 | crossAxisCount: 2, 50 | children: List.generate(8, (index) { 51 | return Card( 52 | shape: RoundedRectangleBorder( 53 | borderRadius: BorderRadius.circular(10), 54 | ), 55 | elevation: 2, 56 | color: Colors.white, 57 | child: Shimmer.fromColors( 58 | highlightColor: Colors.white, 59 | baseColor: Colors.grey.shade100, 60 | period: const Duration(milliseconds: 1000), 61 | child: Column( 62 | children: [ 63 | ClipRRect( 64 | borderRadius: const BorderRadius.only( 65 | topLeft: Radius.circular(10), 66 | topRight: Radius.circular(10)), 67 | child: Container( 68 | width: 69 | (((MediaQuery.of(context).size.width) - 24) / 2 - 12), 70 | height: 71 | (((MediaQuery.of(context).size.width) - 24) / 2 - 12), 72 | color: _shimmerColor, 73 | ), 74 | ), 75 | Container( 76 | margin: const EdgeInsets.fromLTRB(8, 8, 8, 8), 77 | child: Column( 78 | mainAxisAlignment: MainAxisAlignment.start, 79 | crossAxisAlignment: CrossAxisAlignment.start, 80 | children: [ 81 | Container( 82 | decoration: BoxDecoration( 83 | borderRadius: BorderRadius.circular(10.0), 84 | color: _shimmerColor, 85 | ), 86 | height: 12, 87 | ), 88 | const SizedBox( 89 | height: _spaceHeight, 90 | ), 91 | Container( 92 | decoration: BoxDecoration( 93 | borderRadius: BorderRadius.circular(10.0), 94 | color: _shimmerColor, 95 | ), 96 | height: 12, 97 | ), 98 | const SizedBox( 99 | height: _spaceHeight, 100 | ), 101 | ], 102 | ), 103 | ), 104 | ], 105 | ), 106 | ), 107 | ); 108 | }), 109 | ); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /lib/web_url/configure_nonweb.dart: -------------------------------------------------------------------------------- 1 | void configureApp() {} 2 | -------------------------------------------------------------------------------- /lib/web_url/configure_web.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_web_plugins/flutter_web_plugins.dart'; 2 | 3 | void configureApp() { 4 | setUrlStrategy(PathUrlStrategy()); 5 | } 6 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: scarvs 2 | description: A Ecommerce App :) . 3 | 4 | publish_to: "none" 5 | version: 1.0.0+1 6 | 7 | environment: 8 | sdk: ">=3.0.0 <4.0.0" 9 | 10 | dependencies: 11 | cache_manager: ^1.0.0+3 12 | concentric_transition: ^1.0.1+1 13 | cupertino_icons: ^1.0.2 14 | eva_icons_flutter: ^3.0.2 15 | flutter: 16 | sdk: flutter 17 | flutter_launcher_icons: ^0.9.2 18 | flutter_native_splash: ^1.3.1 19 | flutter_svg: ^0.23.0+1 20 | flutter_web_plugins: 21 | sdk: flutter 22 | fluttertoast: ^8.0.8 23 | font_awesome_flutter: ^9.2.0 24 | http: ^0.13.4 25 | lottie: ^1.2.1 26 | provider: ^6.0.1 27 | razorpay_flutter: ^1.2.7 28 | salomon_bottom_bar: ^3.1.0 29 | shared_preferences: ^2.0.8 30 | shimmer: ^2.0.0 31 | url_strategy: ^0.2.0 32 | 33 | dev_dependencies: 34 | flutter_lints: ^1.0.0 35 | flutter_test: 36 | sdk: flutter 37 | 38 | flutter_native_splash: 39 | color: "#42a5f5" 40 | image: assets/splash.png 41 | android: true 42 | ios: true 43 | web: true 44 | 45 | flutter_icons: 46 | android: true 47 | ios: true 48 | image_path: "assets/images/logo/logo.png" 49 | 50 | flutter: 51 | generate: true 52 | uses-material-design: true 53 | assets: 54 | - assets/animations/ 55 | - assets/images/shoes/ 56 | - assets/images/misc/ 57 | - assets/images/logo/ 58 | 59 | fonts: 60 | - family: Contax 61 | fonts: 62 | - asset: assets/fonts/contax.ttf 63 | -------------------------------------------------------------------------------- /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 that Flutter provides. 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:scarvs/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 Core()); 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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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 | scarvs 30 | 31 | 32 | 33 | 36 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scarvs", 3 | "short_name": "scarvs", 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/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(scarvs LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "scarvs") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /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.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /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 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 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.dev" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "scarvs" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2021 com.dev. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "scarvs.exe" "\0" 98 | VALUE "ProductName", "scarvs" "\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 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /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.CreateAndShow(L"scarvs", 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/Dev-Adnani/Scarvs-Flutter/3a5b5b669139888c9ff202ea0a573480ad98d882/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 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 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 and shows a win32 window with |title| and position and size 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 to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------