├── .gitignore ├── .metadata ├── .vscode └── launch.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── manusiacoding │ │ │ │ └── saldah_shop │ │ │ │ └── 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 ├── pictures │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── background_vector.jpg │ ├── clothes_shop.jpg │ ├── flower.jpg │ ├── login_bottom2.png │ ├── logo.png │ ├── main_bottom2.png │ ├── main_top2.png │ ├── popular1.jpg │ ├── popular2.jpg │ ├── popular3.jpg │ ├── popular4.jpg │ ├── signup_top2.png │ └── unnamed.jpg └── svg │ ├── Error.svg │ ├── Lock.svg │ ├── Mail.svg │ ├── User.svg │ ├── category.svg │ ├── drawer_menu.svg │ ├── dress.svg │ ├── facebook.svg │ ├── filter.svg │ ├── google-plus.svg │ ├── hat.svg │ ├── home.svg │ ├── image1.svg │ ├── image2.svg │ ├── image3.svg │ ├── jeans.svg │ ├── message.svg │ ├── notification.svg │ ├── profile.svg │ ├── search.svg │ ├── shirt.svg │ ├── shoes.svg │ ├── shop.svg │ ├── twitter.svg │ └── verified.svg ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-50x50@1x.png │ │ ├── Icon-App-50x50@2x.png │ │ ├── Icon-App-57x57@1x.png │ │ ├── Icon-App-57x57@2x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-72x72@1x.png │ │ ├── Icon-App-72x72@2x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── app │ └── app_consts.dart ├── components │ ├── already_have_an_account_acheck.dart │ ├── app_buttons.dart │ ├── custom_surfix_icon.dart │ ├── default_button.dart │ ├── form_error.dart │ ├── no_account_text.dart │ ├── rounded_button.dart │ ├── rounded_input_field.dart │ ├── rounded_password_field.dart │ └── text_field_container.dart ├── dummy_data.dart ├── helper │ └── keyboard.dart ├── main.dart ├── models │ ├── api_response.dart │ ├── category_model.dart │ ├── popular_model.dart │ ├── product.dart │ └── user_model.dart ├── screens │ ├── cart_screen │ │ ├── cart_screen.dart │ │ └── components │ │ │ └── body.dart │ ├── category_screen │ │ └── category_screen.dart │ ├── detail_screen │ │ ├── components │ │ │ ├── clipper.dart │ │ │ └── select_size.dart │ │ └── detail_screen.dart │ ├── home_screen │ │ ├── components │ │ │ ├── body.dart │ │ │ ├── category_list.dart │ │ │ ├── category_title.dart │ │ │ ├── drawer.dart │ │ │ ├── feed_news.dart │ │ │ ├── home_bottom_menu_icon.dart │ │ │ ├── popular_list.dart │ │ │ └── search_bar.dart │ │ └── home_screen.dart │ ├── loading_screen │ │ └── loading.dart │ ├── message_screen │ │ ├── components │ │ │ └── body.dart │ │ └── message_screen.dart │ ├── notification_screen │ │ └── notification_screen.dart │ ├── product_screen │ │ ├── add_product.dart │ │ └── list_product.dart │ ├── profile_screen │ │ ├── components │ │ │ └── body.dart │ │ └── profile_screen.dart │ ├── signin_screen │ │ ├── components │ │ │ ├── body.dart │ │ │ └── signin_form.dart │ │ └── signin_screen.dart │ └── signup_screen │ │ ├── components │ │ ├── body.dart │ │ └── signup_form.dart │ │ └── signup_screen.dart ├── services │ ├── product_services.dart │ └── user_services.dart └── size_config.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── 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 └── logo.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 17 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 18 | - platform: android 19 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 20 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 21 | - platform: ios 22 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 23 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 24 | - platform: linux 25 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 26 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 27 | - platform: macos 28 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 29 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 30 | - platform: web 31 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 32 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 33 | - platform: windows 34 | create_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 35 | base_revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "saldah_shop", 9 | "request": "launch", 10 | "type": "dart" 11 | }, 12 | { 13 | "name": "saldah_shop (profile mode)", 14 | "request": "launch", 15 | "type": "dart", 16 | "flutterMode": "profile" 17 | }, 18 | { 19 | "name": "saldah_shop (release mode)", 20 | "request": "launch", 21 | "type": "dart", 22 | "flutterMode": "release" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## E-COMMERCE APPLICATION 2 | 3 | This is e-commerce application being built using Flutter Framework (Front-End) & Laravel Framework (Back-End). 4 | 5 | Link for back-end application : https://manusiacoding/backend_e_commerce_app -------------------------------------------------------------------------------- /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 flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.manusiacoding.saldah_shop" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 50 | minSdkVersion 19 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | shrinkResources false 62 | minifyEnabled false 63 | } 64 | } 65 | } 66 | 67 | flutter { 68 | source '../..' 69 | } 70 | 71 | dependencies { 72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 73 | } 74 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 17 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/manusiacoding/saldah_shop/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.manusiacoding.saldah_shop 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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 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 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/pictures/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/1.png -------------------------------------------------------------------------------- /assets/pictures/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/2.png -------------------------------------------------------------------------------- /assets/pictures/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/3.png -------------------------------------------------------------------------------- /assets/pictures/background_vector.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/background_vector.jpg -------------------------------------------------------------------------------- /assets/pictures/clothes_shop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/clothes_shop.jpg -------------------------------------------------------------------------------- /assets/pictures/flower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/flower.jpg -------------------------------------------------------------------------------- /assets/pictures/login_bottom2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/login_bottom2.png -------------------------------------------------------------------------------- /assets/pictures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/logo.png -------------------------------------------------------------------------------- /assets/pictures/main_bottom2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/main_bottom2.png -------------------------------------------------------------------------------- /assets/pictures/main_top2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/main_top2.png -------------------------------------------------------------------------------- /assets/pictures/popular1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/popular1.jpg -------------------------------------------------------------------------------- /assets/pictures/popular2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/popular2.jpg -------------------------------------------------------------------------------- /assets/pictures/popular3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/popular3.jpg -------------------------------------------------------------------------------- /assets/pictures/popular4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/popular4.jpg -------------------------------------------------------------------------------- /assets/pictures/signup_top2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/signup_top2.png -------------------------------------------------------------------------------- /assets/pictures/unnamed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/assets/pictures/unnamed.jpg -------------------------------------------------------------------------------- /assets/svg/Error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/svg/Lock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/svg/Mail.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/svg/User.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/svg/category.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/svg/drawer_menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svg/dress.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /assets/svg/facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svg/filter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/svg/google-plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /assets/svg/hat.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /assets/svg/home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svg/jeans.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /assets/svg/message.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svg/notification.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/svg/profile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/svg/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 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 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/svg/shirt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 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 | -------------------------------------------------------------------------------- /assets/svg/shoes.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /assets/svg/shop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 | 33 | 35 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /assets/svg/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /assets/svg/verified.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Saldah Shop 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | saldah_shop 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/app/app_consts.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/size_config.dart'; 3 | 4 | class AppColors { 5 | static const Color darkGrey = Color.fromRGBO(64, 64, 64, 1); 6 | static const Color lightGrey = Color.fromRGBO(176, 176, 176, 1); 7 | static const Color grey = Color.fromRGBO(97, 97, 97, 1); 8 | static const Color darkWhite = Color.fromRGBO(246, 246, 246, 1); 9 | static const kPrimaryColor = Color(0xFFD95284); 10 | static const kPrimaryLightColor = Color(0xFF2E2E2E); 11 | } 12 | 13 | // Form Error 14 | final RegExp emailValidatorRegExp = 15 | RegExp(r"^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+"); 16 | const String kNameNullError = "Please Enter your name"; 17 | const String kEmailNullError = "Please Enter your email"; 18 | const String kInvalidEmailError = "Please Enter Valid Email"; 19 | const String kPassNullError = "Please Enter your password"; 20 | const String kShortPassError = "Password is too short"; 21 | const String kMatchPassError = "Passwords don't match"; 22 | const String kNamelNullError = "Please Enter your name"; 23 | const String kPhoneNumberNullError = "Please Enter your phone number"; 24 | const String kAddressNullError = "Please Enter your address"; 25 | 26 | final headingStyle = TextStyle( 27 | fontSize: getProportionateScreenWidth(28), 28 | fontWeight: FontWeight.bold, 29 | color: Colors.black, 30 | height: 1.5, 31 | ); 32 | 33 | // API 34 | const baseURL = 'https://crosamo.com/api'; 35 | // const baseURL = 'http://192.168.253.144:8000/api'; 36 | const loginURL = '$baseURL/login'; 37 | const registerURL = '$baseURL/register'; 38 | const logoutURL = '$baseURL/logout'; 39 | const userURL = '$baseURL/user'; 40 | const productURL = '$baseURL/products'; 41 | const commentURL = '$baseURL/comments'; 42 | 43 | const serverError = 'Server Error'; 44 | const unauthorized = 'Unauthrorized'; 45 | const somethingWentWrong = 'Something Went Wrong, Try Again!'; 46 | -------------------------------------------------------------------------------- /lib/components/already_have_an_account_acheck.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | 4 | class AlreadyHaveAnAccountCheck extends StatelessWidget { 5 | final bool login; 6 | final Function press; 7 | const AlreadyHaveAnAccountCheck( 8 | {super.key, required this.login, required this.press}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Row( 13 | mainAxisAlignment: MainAxisAlignment.center, 14 | children: [ 15 | Text( 16 | login ? "Don’t have an Account ? " : "Already have an Account ? ", 17 | style: TextStyle(color: Colors.black), 18 | ), 19 | GestureDetector( 20 | onTap: () {}, 21 | child: Text( 22 | login ? "Sign Up" : "Sign In", 23 | style: TextStyle( 24 | color: AppColors.kPrimaryColor, 25 | fontWeight: FontWeight.bold, 26 | ), 27 | ), 28 | ) 29 | ], 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/components/app_buttons.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/app/app_consts.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppButton { 5 | static normalButton({ 6 | required String title, 7 | VoidCallback? onPress, 8 | Color? backgroundColor = AppColors.darkGrey, 9 | Color? titleColor = Colors.white, 10 | bool shadow = true, 11 | double height = 50, 12 | double width = double.infinity, 13 | }) { 14 | return GestureDetector( 15 | onTap: onPress, 16 | child: Container( 17 | height: height, 18 | width: width, 19 | alignment: Alignment.center, 20 | decoration: BoxDecoration( 21 | color: backgroundColor, 22 | borderRadius: BorderRadius.circular(10), 23 | boxShadow: shadow 24 | ? const [ 25 | BoxShadow(color: AppColors.lightGrey, blurRadius: 5), 26 | ] 27 | : null, 28 | ), 29 | child: Text( 30 | title, 31 | style: TextStyle( 32 | color: titleColor, 33 | fontWeight: FontWeight.bold, 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/components/custom_surfix_icon.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | 4 | import 'package:saldah_shop/size_config.dart'; 5 | 6 | class CustomSurfixIcon extends StatelessWidget { 7 | const CustomSurfixIcon({ 8 | Key? key, 9 | required this.svgIcon, 10 | }) : super(key: key); 11 | 12 | final String svgIcon; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Padding( 17 | padding: EdgeInsets.fromLTRB( 18 | 0, 19 | getProportionateScreenWidth(20), 20 | getProportionateScreenWidth(20), 21 | getProportionateScreenWidth(20), 22 | ), 23 | child: SvgPicture.asset( 24 | svgIcon, 25 | height: getProportionateScreenWidth(18), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/components/default_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:saldah_shop/app/app_consts.dart'; 4 | import 'package:saldah_shop/size_config.dart'; 5 | 6 | class DefaultButton extends StatelessWidget { 7 | const DefaultButton({ 8 | Key? key, 9 | this.text, 10 | this.press, 11 | }) : super(key: key); 12 | final String? text; 13 | final Function? press; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return SizedBox( 18 | width: double.infinity, 19 | height: getProportionateScreenHeight(56), 20 | child: TextButton( 21 | style: TextButton.styleFrom( 22 | foregroundColor: Colors.white, 23 | shape: RoundedRectangleBorder( 24 | borderRadius: BorderRadius.circular(20), 25 | ), 26 | backgroundColor: AppColors.darkGrey, 27 | ), 28 | onPressed: press as void Function()?, 29 | child: Text( 30 | text!, 31 | style: TextStyle( 32 | fontSize: getProportionateScreenWidth(18), 33 | color: Colors.white, 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/components/form_error.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | 4 | import 'package:saldah_shop/size_config.dart'; 5 | 6 | class FormError extends StatelessWidget { 7 | const FormError({ 8 | Key? key, 9 | required this.errors, 10 | }) : super(key: key); 11 | 12 | final List errors; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Column( 17 | children: List.generate( 18 | errors.length, (index) => formErrorText(error: errors[index]!)), 19 | ); 20 | } 21 | 22 | Row formErrorText({required String error}) { 23 | return Row( 24 | children: [ 25 | SvgPicture.asset( 26 | "assets/svg/Error.svg", 27 | height: getProportionateScreenWidth(14), 28 | width: getProportionateScreenWidth(14), 29 | ), 30 | SizedBox( 31 | width: getProportionateScreenWidth(10), 32 | ), 33 | Text(error), 34 | ], 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/components/no_account_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | import 'package:saldah_shop/screens/signup_screen/signup_screen.dart'; 4 | 5 | import '../size_config.dart'; 6 | 7 | class NoAccountText extends StatelessWidget { 8 | const NoAccountText({ 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Row( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | children: [ 17 | Text( 18 | "Don’t have an account? ", 19 | style: TextStyle(fontSize: getProportionateScreenWidth(16)), 20 | ), 21 | GestureDetector( 22 | onTap: () => Navigator.push( 23 | context, 24 | MaterialPageRoute(builder: (context) => SignUpScreen()), 25 | ), 26 | child: Text( 27 | "Sign Up", 28 | style: TextStyle( 29 | fontSize: getProportionateScreenWidth(16), 30 | color: AppColors.darkGrey), 31 | ), 32 | ), 33 | ], 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/components/rounded_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | // import 'package:saldah_shop/app/app_consts.dart'; 3 | 4 | class RoundedButton extends StatelessWidget { 5 | final String text; 6 | final Function press; 7 | final Color color, textColor; 8 | const RoundedButton( 9 | {super.key, 10 | required this.text, 11 | required this.press, 12 | required this.color, 13 | required this.textColor}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | Size size = MediaQuery.of(context).size; 18 | return Container( 19 | margin: EdgeInsets.symmetric(vertical: 5), 20 | width: size.width * 0.8, 21 | // height: 50, 22 | child: ClipRRect( 23 | borderRadius: BorderRadius.circular(29), 24 | child: TextButton( 25 | style: TextButton.styleFrom( 26 | padding: EdgeInsets.symmetric(vertical: 20, horizontal: 40), 27 | backgroundColor: color), 28 | onPressed: () { 29 | press; 30 | }, 31 | child: Text( 32 | text, 33 | style: TextStyle(color: textColor), 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/components/rounded_input_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/components/text_field_container.dart'; 3 | import 'package:saldah_shop/app/app_consts.dart'; 4 | 5 | class RoundedInputField extends StatelessWidget { 6 | final String hintText; 7 | final IconData icon; 8 | final ValueChanged onChanged; 9 | const RoundedInputField( 10 | {super.key, 11 | required this.hintText, 12 | required this.icon, 13 | required this.onChanged}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return TextFieldContainer( 18 | child: TextField( 19 | onChanged: onChanged, 20 | cursorColor: AppColors.darkGrey, 21 | decoration: InputDecoration( 22 | icon: Icon( 23 | icon, 24 | color: AppColors.darkGrey, 25 | ), 26 | hintText: hintText, 27 | border: InputBorder.none, 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/components/rounded_password_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/components/text_field_container.dart'; 3 | import 'package:saldah_shop/app/app_consts.dart'; 4 | 5 | class RoundedPasswordField extends StatelessWidget { 6 | final ValueChanged onChanged; 7 | const RoundedPasswordField({super.key, required this.onChanged}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return TextFieldContainer( 12 | child: TextField( 13 | obscureText: true, 14 | onChanged: onChanged, 15 | cursorColor: AppColors.darkGrey, 16 | decoration: InputDecoration( 17 | hintText: "Password", 18 | icon: Icon( 19 | Icons.lock, 20 | color: AppColors.darkGrey, 21 | ), 22 | // suffixIcon: Icon( 23 | // Icons.visibility, 24 | // color: AppColors.kPrimaryColor, 25 | // ), 26 | border: InputBorder.none, 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/components/text_field_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | // import 'package:saldah_shop/app/app_consts.dart'; 3 | 4 | class TextFieldContainer extends StatelessWidget { 5 | final Widget child; 6 | const TextFieldContainer({super.key, required this.child}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | Size size = MediaQuery.of(context).size; 11 | 12 | return Container( 13 | height: 50, 14 | margin: EdgeInsets.symmetric(vertical: 10), 15 | padding: EdgeInsets.symmetric(horizontal: 20, vertical: 5), 16 | width: size.width * 0.8, 17 | decoration: BoxDecoration( 18 | color: Color(0xDDF2F2F2), 19 | borderRadius: BorderRadius.circular(29), 20 | ), 21 | child: child, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/dummy_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/models/category_model.dart'; 2 | import 'package:saldah_shop/models/popular_model.dart'; 3 | 4 | List categoryList = [ 5 | CategoryModel(icon: 'assets/svg/shirt.svg', name: 'Shirt'), 6 | CategoryModel(icon: 'assets/svg/dress.svg', name: 'Dress'), 7 | CategoryModel(icon: 'assets/svg/jeans.svg', name: 'Jeans'), 8 | CategoryModel(icon: 'assets/svg/shoes.svg', name: 'Shoes'), 9 | CategoryModel(icon: 'assets/svg/hat.svg', name: 'Hat'), 10 | ]; 11 | 12 | List popularList = [ 13 | PopularModel( 14 | picture: 'assets/pictures/popular2.jpg', 15 | price: 35, 16 | title: 'Second shirt', 17 | ), 18 | PopularModel( 19 | picture: 'assets/pictures/popular3.jpg', 20 | price: 50, 21 | title: 'Some other', 22 | ), 23 | PopularModel( 24 | picture: 'assets/pictures/popular4.jpg', 25 | price: 92, 26 | title: 'Last shirt', 27 | ), 28 | PopularModel( 29 | picture: 'assets/pictures/popular1.jpg', 30 | price: 75, 31 | title: 'First shirt', 32 | ), 33 | PopularModel( 34 | picture: 'assets/pictures/popular2.jpg', 35 | price: 35, 36 | title: 'Second shirt', 37 | ), 38 | PopularModel( 39 | picture: 'assets/pictures/popular3.jpg', 40 | price: 50, 41 | title: 'Some other', 42 | ), 43 | PopularModel( 44 | picture: 'assets/pictures/popular4.jpg', 45 | price: 92, 46 | title: 'Last shirt', 47 | ), 48 | PopularModel( 49 | picture: 'assets/pictures/popular1.jpg', 50 | price: 75, 51 | title: 'First shirt', 52 | ), 53 | ]; 54 | -------------------------------------------------------------------------------- /lib/helper/keyboard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | 3 | class KeyboardUtil { 4 | static void hideKeyboard(BuildContext context) { 5 | FocusScopeNode currentFocus = FocusScope.of(context); 6 | if (!currentFocus.hasPrimaryFocus) { 7 | currentFocus.unfocus(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | import 'package:saldah_shop/screens/loading_screen/loading.dart'; 4 | // import 'package:saldah_shop/screens/signin_screen/signin_screen.dart'; 5 | // import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 6 | 7 | void main() { 8 | runApp(const MyApp()); 9 | } 10 | 11 | class MyApp extends StatelessWidget { 12 | const MyApp({Key? key}) : super(key: key); 13 | 14 | // This widget is the root of your application. 15 | @override 16 | Widget build(BuildContext context) { 17 | return MaterialApp( 18 | debugShowCheckedModeBanner: false, 19 | title: 'Saldah Shop', 20 | theme: ThemeData( 21 | textTheme: GoogleFonts.poppinsTextTheme(), 22 | primarySwatch: Colors.blue, 23 | scaffoldBackgroundColor: Colors.white, 24 | ), 25 | home: const LoadingScreen(), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/models/api_response.dart: -------------------------------------------------------------------------------- 1 | class ApiResponse { 2 | Object? data; 3 | String? error; 4 | } 5 | -------------------------------------------------------------------------------- /lib/models/category_model.dart: -------------------------------------------------------------------------------- 1 | class CategoryModel { 2 | final String icon; 3 | final String name; 4 | 5 | CategoryModel({ 6 | required this.icon, 7 | required this.name, 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /lib/models/popular_model.dart: -------------------------------------------------------------------------------- 1 | class PopularModel { 2 | final String picture; 3 | final String title; 4 | final String desc; 5 | final int price; 6 | bool favorite; 7 | 8 | PopularModel({ 9 | required this.picture, 10 | this.desc = 11 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras convallis nisl dolor. Donec venenatis tellus est, eu tincidunt quam faucibus et. Pellentesque dapibus, lorem non euismod euismod, ex nisi efficitur orci, sit amet posuere tellus lacus molestie justo. Aliquam nisi ligula, venenatis vel ex luctus, aliquam tristique nibh. Nullam eu pellentesque orci, vitae mollis neque. Duis ut purus vel dui aliquet tempor ac sed lacus. Proin sed ante vel ligula cursus rhoncus.', 12 | required this.price, 13 | required this.title, 14 | this.favorite = false, 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /lib/models/product.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/models/user_model.dart'; 2 | 3 | class Product { 4 | int? id; 5 | String? name; 6 | String? price; 7 | String? stock; 8 | String? type; 9 | String? description; 10 | String? image; 11 | String? likesCount; 12 | String? commentsCount; 13 | User? user; 14 | bool? selfLiked; 15 | 16 | Product({ 17 | this.id, 18 | this.name, 19 | this.price, 20 | this.stock, 21 | this.type, 22 | this.description, 23 | this.image, 24 | this.likesCount, 25 | this.commentsCount, 26 | this.user, 27 | this.selfLiked, 28 | }); 29 | 30 | factory Product.fromJson(Map json) { 31 | return Product( 32 | id: json['id'], 33 | name: json['name'], 34 | price: json['price'], 35 | stock: json['stock'], 36 | type: json['type'], 37 | description: json['description'], 38 | image: json['image'], 39 | likesCount: json['likes_count'], 40 | commentsCount: json['comments_count'], 41 | selfLiked: json['likes'].length > 0, 42 | user: User( 43 | id: json['user']['id'], 44 | name: json['user']['name'], 45 | image: json['user']['image'], 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/models/user_model.dart: -------------------------------------------------------------------------------- 1 | class User { 2 | int? id; 3 | String? name; 4 | String? email; 5 | String? token; 6 | String? image; 7 | 8 | User({this.id, this.name, this.email, this.image, this.token}); 9 | 10 | factory User.fromJson(Map json) { 11 | return User( 12 | id: json['user']['id'], 13 | name: json['user']['name'], 14 | email: json['user']['email'], 15 | image: json['user']['email'], 16 | token: json['token'] 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/screens/cart_screen/cart_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/cart_screen/components/body.dart'; 3 | 4 | class CartScreen extends StatefulWidget { 5 | const CartScreen({super.key}); 6 | 7 | @override 8 | State createState() => _CartScreenState(); 9 | } 10 | 11 | class _CartScreenState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | body: Body(), 16 | ); 17 | } 18 | } -------------------------------------------------------------------------------- /lib/screens/cart_screen/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 3 | 4 | class Body extends StatelessWidget { 5 | const Body({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | elevation: 0, 12 | backgroundColor: Colors.white, 13 | centerTitle: true, 14 | leading: IconButton( 15 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 16 | MaterialPageRoute(builder: (context) => HomeScreen()), 17 | (route) => false), 18 | icon: Icon(Icons.arrow_back), 19 | color: Colors.black), 20 | ), 21 | body: Center( 22 | child: Text('Cart Screen'), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/screens/category_screen/category_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CategoryScreen extends StatefulWidget { 4 | const CategoryScreen({super.key}); 5 | 6 | @override 7 | State createState() => _CategoryScreenState(); 8 | } 9 | 10 | class _CategoryScreenState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | body: Center( 15 | child: Text('Category Screen'), 16 | ), 17 | ); 18 | } 19 | } -------------------------------------------------------------------------------- /lib/screens/detail_screen/components/clipper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MyClipper extends CustomClipper { 4 | @override 5 | Path getClip(Size size) { 6 | Path path = Path()..moveTo(0, 0); 7 | 8 | path.lineTo(0, size.height - 65); 9 | path.quadraticBezierTo(5, size.height - 45, 30, size.height - 40); 10 | 11 | path.lineTo(size.width - 20, size.height); 12 | path.quadraticBezierTo( 13 | size.width, size.height, size.width, size.height - 30); 14 | 15 | path.lineTo(size.width, 0); 16 | path.lineTo(0, 0); 17 | 18 | return path; 19 | } 20 | 21 | @override 22 | bool shouldReclip(covariant CustomClipper oldClipper) { 23 | return true; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/screens/detail_screen/components/select_size.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/app/app_consts.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SizeModel { 5 | String title; 6 | 7 | SizeModel({required this.title}); 8 | } 9 | 10 | class DetailScreenSelectSize extends StatefulWidget { 11 | const DetailScreenSelectSize({Key? key}) : super(key: key); 12 | 13 | @override 14 | State createState() => _DetailScreenSelectSizeState(); 15 | } 16 | 17 | class _DetailScreenSelectSizeState extends State { 18 | int currentSelected = 2; 19 | 20 | List sizesList = [ 21 | SizeModel(title: 'S'), 22 | SizeModel(title: 'M'), 23 | SizeModel(title: 'L'), 24 | SizeModel(title: 'XL'), 25 | ]; 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return SizedBox( 30 | height: 50, 31 | child: ListView.builder( 32 | scrollDirection: Axis.horizontal, 33 | itemCount: sizesList.length, 34 | itemBuilder: (ctx, i) { 35 | return GestureDetector( 36 | onTap: () { 37 | setState(() { 38 | currentSelected = i; 39 | }); 40 | }, 41 | child: Container( 42 | margin: const EdgeInsets.only(left: 10), 43 | height: 50, 44 | width: 50, 45 | decoration: BoxDecoration( 46 | borderRadius: BorderRadius.circular(10), 47 | color: currentSelected == i 48 | ? AppColors.darkGrey 49 | : AppColors.darkWhite, 50 | boxShadow: [ 51 | BoxShadow( 52 | color: AppColors.lightGrey.withOpacity(.7), 53 | blurRadius: 5, 54 | ), 55 | ], 56 | ), 57 | alignment: Alignment.center, 58 | child: Text( 59 | sizesList[i].title, 60 | style: TextStyle( 61 | fontSize: 20, 62 | fontWeight: FontWeight.w900, 63 | color: currentSelected == i ? Colors.white : Colors.black, 64 | ), 65 | ), 66 | ), 67 | ); 68 | }, 69 | ), 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/svg.dart'; 3 | import 'package:saldah_shop/app/app_consts.dart'; 4 | import 'package:saldah_shop/screens/cart_screen/cart_screen.dart'; 5 | import 'package:saldah_shop/screens/home_screen/components/category_list.dart'; 6 | import 'package:saldah_shop/screens/home_screen/components/category_title.dart'; 7 | import 'package:saldah_shop/screens/home_screen/components/drawer.dart'; 8 | import 'package:saldah_shop/screens/home_screen/components/feed_news.dart'; 9 | import 'package:saldah_shop/screens/home_screen/components/popular_list.dart'; 10 | import 'package:saldah_shop/screens/home_screen/components/search_bar.dart'; 11 | import 'package:saldah_shop/screens/message_screen/message_screen.dart'; 12 | import 'package:saldah_shop/screens/product_screen/list_product.dart'; 13 | import 'package:saldah_shop/screens/profile_screen/profile_screen.dart'; 14 | import 'package:saldah_shop/screens/signin_screen/signin_screen.dart'; 15 | import 'package:saldah_shop/services/user_services.dart'; 16 | 17 | class Body extends StatefulWidget { 18 | const Body({super.key}); 19 | 20 | @override 21 | State createState() => _BodyState(); 22 | } 23 | 24 | class _BodyState extends State { 25 | final GlobalKey scaffoldKey = GlobalKey(); 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return SafeArea( 30 | child: Scaffold( 31 | key: scaffoldKey, 32 | drawer: BuildDrawer(), 33 | appBar: appBar(), 34 | body: const CustomScrollView( 35 | physics: BouncingScrollPhysics(), 36 | slivers: [ 37 | SliverToBoxAdapter( 38 | child: SizedBox(height: 15), 39 | ), 40 | SearchBar(), 41 | SliverToBoxAdapter( 42 | child: SizedBox(height: 20), 43 | ), 44 | FeedNews(), 45 | SliverToBoxAdapter( 46 | child: SizedBox(height: 15), 47 | ), 48 | CategoryTitle(title: 'Category', trailingTitle: 'View All'), 49 | HomeCategoryList(), 50 | CategoryTitle(title: 'Popular', trailingTitle: 'View All'), 51 | HomePopularList(), 52 | ], 53 | ), 54 | ), 55 | ); 56 | } 57 | 58 | AppBar appBar() { 59 | return AppBar( 60 | elevation: 0, 61 | backgroundColor: Colors.white, 62 | centerTitle: true, 63 | leading: IconButton( 64 | icon: SvgPicture.asset( 65 | 'assets/svg/drawer_menu.svg', 66 | fit: BoxFit.fill, 67 | ), 68 | onPressed: () { 69 | scaffoldKey.currentState?.openDrawer(); 70 | }, 71 | ), 72 | // leading: Padding( 73 | // padding: const EdgeInsets.all(12.0), 74 | // child: SvgPicture.asset('assets/svg/drawer_menu.svg'), 75 | // ), 76 | title: const Text( 77 | 'Saldah shop', 78 | style: TextStyle( 79 | fontSize: 16, 80 | color: Colors.black, 81 | fontWeight: FontWeight.bold, 82 | ), 83 | ), 84 | actions: [ 85 | Stack( 86 | clipBehavior: Clip.none, 87 | alignment: Alignment.center, 88 | children: [ 89 | IconButton( 90 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 91 | MaterialPageRoute(builder: (context) => MessageScreen()), 92 | (route) => false), 93 | icon: SvgPicture.asset( 94 | 'assets/svg/message.svg', 95 | height: 17, 96 | width: 17, 97 | color: Colors.black, 98 | ), 99 | ), 100 | const Positioned( 101 | bottom: 32, 102 | right: -3, 103 | child: CircleAvatar( 104 | radius: 4, 105 | backgroundColor: Colors.red, 106 | ), 107 | ), 108 | ], 109 | ), 110 | const SizedBox(width: 8 ), 111 | Stack( 112 | clipBehavior: Clip.none, 113 | alignment: Alignment.center, 114 | children: [ 115 | IconButton( 116 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 117 | MaterialPageRoute(builder: (context) => CartScreen()), 118 | (route) => false), 119 | icon: SvgPicture.asset( 120 | 'assets/svg/shop.svg', 121 | height: 17, 122 | width: 17, 123 | color: Colors.black, 124 | ), 125 | ), 126 | const Positioned( 127 | bottom: 32, 128 | right: -5, 129 | child: CircleAvatar( 130 | radius: 4, 131 | backgroundColor: Colors.red, 132 | ), 133 | ), 134 | ], 135 | ), 136 | const SizedBox(width: 15), 137 | ], 138 | ); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/category_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/app/app_consts.dart'; 2 | import 'package:saldah_shop/dummy_data.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_svg/flutter_svg.dart'; 5 | 6 | class HomeCategoryList extends StatefulWidget { 7 | const HomeCategoryList({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _HomeCategoryListState(); 11 | } 12 | 13 | class _HomeCategoryListState extends State { 14 | int currentSelected = 0; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return SliverToBoxAdapter( 19 | child: SizedBox( 20 | height: 90, 21 | child: ListView.builder( 22 | scrollDirection: Axis.horizontal, 23 | physics: const BouncingScrollPhysics(), 24 | itemCount: categoryList.length, 25 | itemBuilder: (ctx, i) { 26 | return Padding( 27 | padding: const EdgeInsets.only(left: 10), 28 | child: GestureDetector( 29 | onTap: () { 30 | setState(() { 31 | currentSelected = i; 32 | }); 33 | }, 34 | child: Column( 35 | crossAxisAlignment: CrossAxisAlignment.center, 36 | children: [ 37 | Container( 38 | height: 60, 39 | width: 70, 40 | decoration: BoxDecoration( 41 | color: currentSelected == i 42 | ? AppColors.darkGrey 43 | : AppColors.lightGrey, 44 | borderRadius: BorderRadius.circular(15), 45 | image: DecorationImage( 46 | image: const AssetImage( 47 | 'assets/pictures/clothes_shop.jpg', 48 | ), 49 | fit: BoxFit.cover, 50 | colorFilter: ColorFilter.mode( 51 | currentSelected == i 52 | ? Colors.black.withOpacity(.5) 53 | : Colors.black.withOpacity(.85), 54 | BlendMode.darken, 55 | ), 56 | ), 57 | ), 58 | alignment: Alignment.center, 59 | child: SvgPicture.asset( 60 | categoryList[i].icon, 61 | height: 24, 62 | width: 24, 63 | color: currentSelected == i 64 | ? Colors.white 65 | : AppColors.grey, 66 | ), 67 | ), 68 | const SizedBox(height: 5), 69 | Text( 70 | categoryList[i].name, 71 | style: TextStyle( 72 | fontWeight: currentSelected == i 73 | ? FontWeight.bold 74 | : FontWeight.normal, 75 | ), 76 | ), 77 | ], 78 | ), 79 | ), 80 | ); 81 | }, 82 | ), 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/category_title.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/app/app_consts.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class CategoryTitle extends StatelessWidget { 5 | final String title; 6 | final String trailingTitle; 7 | final VoidCallback? onPressMore; 8 | 9 | const CategoryTitle({ 10 | Key? key, 11 | required this.title, 12 | required this.trailingTitle, 13 | this.onPressMore, 14 | }) : super(key: key); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return SliverPadding( 19 | padding: const EdgeInsets.symmetric(horizontal: 10), 20 | sliver: SliverToBoxAdapter( 21 | child: Row( 22 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 23 | children: [ 24 | Text( 25 | title, 26 | style: const TextStyle( 27 | fontWeight: FontWeight.bold, 28 | ), 29 | ), 30 | TextButton( 31 | onPressed: onPressMore, 32 | child: Text( 33 | trailingTitle, 34 | style: const TextStyle( 35 | fontSize: 14, 36 | color: AppColors.lightGrey, 37 | ), 38 | ), 39 | ), 40 | ], 41 | ), 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/drawer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | import 'package:saldah_shop/screens/product_screen/list_product.dart'; 4 | import 'package:saldah_shop/screens/profile_screen/profile_screen.dart'; 5 | import 'package:saldah_shop/screens/signin_screen/signin_screen.dart'; 6 | import 'package:saldah_shop/services/user_services.dart'; 7 | 8 | class BuildDrawer extends StatefulWidget { 9 | const BuildDrawer({super.key}); 10 | 11 | @override 12 | State createState() => _BuildDrawerState(); 13 | } 14 | 15 | class _BuildDrawerState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return SizedBox( 19 | child: Drawer( 20 | child: ListView( 21 | padding: EdgeInsets.zero, 22 | children: [ 23 | UserAccountsDrawerHeader( 24 | //membuat gambar profil 25 | currentAccountPicture: CircleAvatar( 26 | backgroundImage: AssetImage('assets/pictures/unnamed.jpg'), 27 | ), 28 | //membuat nama akun 29 | accountName: Text("Fawwaz Hudzalfah Saputra"), 30 | //membuat nama email 31 | accountEmail: Text("manusiacoding29@gmail.com"), 32 | //memberikan background 33 | decoration: BoxDecoration(color: AppColors.grey), 34 | ), 35 | ListTile( 36 | leading: Icon(Icons.person), 37 | title: Text("Profile"), 38 | onTap: () => Navigator.of(context).pushAndRemoveUntil( 39 | MaterialPageRoute(builder: (context) => ProfileScreen()), 40 | (route) => false), 41 | ), 42 | ListTile( 43 | leading: Icon(Icons.inventory), 44 | title: Text("My Products"), 45 | onTap: () => Navigator.of(context).pushAndRemoveUntil( 46 | MaterialPageRoute(builder: (context) => ListProductScreen()), 47 | (route) => false), 48 | ), 49 | ListTile( 50 | leading: Icon(Icons.list_alt), 51 | title: Text("My Orders"), 52 | onTap: () {}, 53 | ), 54 | ListTile( 55 | leading: Icon(Icons.checklist), 56 | title: Text("My Wishlist"), 57 | onTap: () {}, 58 | ), 59 | Divider(), 60 | ListTile( 61 | leading: Icon(Icons.info), 62 | title: Text("About"), 63 | onTap: () {}, 64 | ), 65 | ListTile( 66 | leading: Icon(Icons.logout_outlined), 67 | title: Text("Logout"), 68 | onTap: () { 69 | logout().then((value) => { 70 | Navigator.of(context).pushAndRemoveUntil( 71 | MaterialPageRoute( 72 | builder: (context) => SignInScreen()), 73 | (route) => false) 74 | }); 75 | }, 76 | ), 77 | ], 78 | ), 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/feed_news.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/app/app_consts.dart'; 2 | import 'package:saldah_shop/components/app_buttons.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class FeedNews extends StatefulWidget { 6 | const FeedNews({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _FeedNewsState(); 10 | } 11 | 12 | class _FeedNewsState extends State { 13 | int currentIndex = 0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return SliverToBoxAdapter( 18 | child: Stack( 19 | children: [ 20 | SizedBox( 21 | height: 180, 22 | child: PageView.builder( 23 | physics: const BouncingScrollPhysics(), 24 | onPageChanged: (i) { 25 | setState(() => currentIndex = i); 26 | }, 27 | itemCount: 5, 28 | itemBuilder: (ctx, i) => Container( 29 | margin: const EdgeInsets.symmetric(horizontal: 10), 30 | width: double.infinity, 31 | decoration: BoxDecoration( 32 | color: Colors.black, 33 | borderRadius: BorderRadius.circular(15), 34 | image: DecorationImage( 35 | image: const AssetImage('assets/pictures/clothes_shop.jpg'), 36 | fit: BoxFit.cover, 37 | colorFilter: ColorFilter.mode( 38 | Colors.black.withOpacity(.6), 39 | BlendMode.darken, 40 | ), 41 | ), 42 | ), 43 | child: Column( 44 | crossAxisAlignment: CrossAxisAlignment.start, 45 | children: [ 46 | const SizedBox(height: 20), 47 | Container( 48 | height: 35, 49 | width: 130, 50 | alignment: Alignment.center, 51 | decoration: const BoxDecoration( 52 | borderRadius: BorderRadius.only( 53 | bottomRight: Radius.circular(15), 54 | topRight: Radius.circular(15), 55 | ), 56 | color: Colors.white24, 57 | ), 58 | child: const Text( 59 | 'Special Promo', 60 | style: TextStyle( 61 | color: Colors.white, 62 | fontWeight: FontWeight.bold, 63 | ), 64 | ), 65 | ), 66 | const SizedBox(height: 15), 67 | Row( 68 | children: [ 69 | const SizedBox(width: 20), 70 | Expanded( 71 | child: Column( 72 | crossAxisAlignment: CrossAxisAlignment.start, 73 | children: [ 74 | const Text( 75 | 'All menswear', 76 | style: TextStyle(color: Colors.white), 77 | ), 78 | const Text( 79 | '50% Discount', 80 | style: TextStyle( 81 | color: Colors.white, 82 | fontSize: 18, 83 | fontWeight: FontWeight.bold, 84 | ), 85 | ), 86 | const SizedBox(height: 20), 87 | AppButton.normalButton( 88 | height: 35, 89 | width: 100, 90 | title: 'Buy Now', 91 | backgroundColor: Colors.white, 92 | shadow: false, 93 | titleColor: Colors.black, 94 | ), 95 | ], 96 | ), 97 | ), 98 | ], 99 | ), 100 | ], 101 | ), 102 | ), 103 | ), 104 | ), 105 | Positioned( 106 | right: 30, 107 | bottom: 10, 108 | child: SizedBox( 109 | height: 16, 110 | child: Row( 111 | children: List.generate( 112 | 5, 113 | (index) => AnimatedContainer( 114 | duration: const Duration(milliseconds: 300), 115 | margin: const EdgeInsets.only(right: 3), 116 | height: index == currentIndex ? 16 : 8, 117 | width: 5, 118 | decoration: BoxDecoration( 119 | color: 120 | index == currentIndex ? Colors.white : AppColors.grey, 121 | borderRadius: BorderRadius.circular(2), 122 | ), 123 | ), 124 | ), 125 | ), 126 | ), 127 | ), 128 | ], 129 | ), 130 | ); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/home_bottom_menu_icon.dart: -------------------------------------------------------------------------------- 1 | import 'package:saldah_shop/app/app_consts.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter_svg/svg.dart'; 4 | 5 | BottomNavigationBarItem homeBottomMenuIcon({ 6 | required final int itemIndex, 7 | required final int currentIndex, 8 | required final String title, 9 | required final String svgPic, 10 | }) { 11 | return BottomNavigationBarItem( 12 | label: title, 13 | icon: Padding( 14 | padding: const EdgeInsets.only(top: 8), 15 | child: SvgPicture.asset( 16 | svgPic, 17 | height: 22, 18 | width: 22, 19 | color: currentIndex == itemIndex 20 | ? AppColors.darkGrey 21 | : AppColors.lightGrey, 22 | ), 23 | ), 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /lib/screens/home_screen/components/search_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/svg.dart'; 3 | 4 | import '../../../app/app_consts.dart'; 5 | 6 | class SearchBar extends StatelessWidget { 7 | const SearchBar({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return SliverToBoxAdapter( 12 | child: Padding( 13 | padding: const EdgeInsets.symmetric(horizontal: 10), 14 | child: SizedBox( 15 | height: 45, 16 | child: TextFormField( 17 | decoration: InputDecoration( 18 | border: OutlineInputBorder( 19 | borderSide: BorderSide.none, 20 | borderRadius: BorderRadius.circular(10), 21 | ), 22 | fillColor: AppColors.darkWhite, 23 | filled: true, 24 | contentPadding: const EdgeInsets.all(10), 25 | hintText: 'Search', 26 | prefixIcon: Padding( 27 | padding: const EdgeInsets.all(15.0), 28 | child: SvgPicture.asset( 29 | 'assets/svg/search.svg', 30 | height: 20, 31 | width: 20, 32 | color: Colors.grey, 33 | ), 34 | ), 35 | suffixIcon: Padding( 36 | padding: const EdgeInsets.all(12.0), 37 | child: SvgPicture.asset( 38 | 'assets/svg/filter.svg', 39 | height: 20, 40 | width: 20, 41 | color: Colors.grey, 42 | ), 43 | ), 44 | ), 45 | maxLines: 1, 46 | ), 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/screens/home_screen/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | import 'package:saldah_shop/screens/category_screen/category_screen.dart'; 4 | import 'package:saldah_shop/screens/home_screen/components/body.dart'; 5 | import 'package:saldah_shop/screens/home_screen/components/home_bottom_menu_icon.dart'; 6 | import 'package:saldah_shop/screens/notification_screen/notification_screen.dart'; 7 | 8 | class HomeScreen extends StatefulWidget { 9 | // const HomeScreen({super.key}); 10 | 11 | @override 12 | State createState() => _HomeScreenState(); 13 | } 14 | 15 | class _HomeScreenState extends State { 16 | int bottomNavBarSelectedIndex = 0; 17 | 18 | final _pageOptions = [Body(), CategoryScreen(), NotificationScreen()]; 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | body: _pageOptions[bottomNavBarSelectedIndex], 23 | bottomNavigationBar: bottomMenu(), 24 | ); 25 | } 26 | 27 | BottomNavigationBar bottomMenu() { 28 | return BottomNavigationBar( 29 | type: BottomNavigationBarType.fixed, 30 | elevation: 8, 31 | currentIndex: bottomNavBarSelectedIndex, 32 | backgroundColor: Colors.white, 33 | selectedItemColor: AppColors.darkGrey, 34 | onTap: (index) { 35 | setState(() { 36 | bottomNavBarSelectedIndex = index; 37 | }); 38 | }, 39 | items: [ 40 | homeBottomMenuIcon( 41 | currentIndex: bottomNavBarSelectedIndex, 42 | itemIndex: 0, 43 | svgPic: 'assets/svg/home.svg', 44 | title: '', 45 | ), 46 | homeBottomMenuIcon( 47 | itemIndex: bottomNavBarSelectedIndex, 48 | currentIndex: 1, 49 | svgPic: 'assets/svg/category.svg', 50 | title: '', 51 | ), 52 | homeBottomMenuIcon( 53 | currentIndex: bottomNavBarSelectedIndex, 54 | itemIndex: 2, 55 | svgPic: 'assets/svg/notification.svg', 56 | title: '', 57 | ), 58 | // homeBottomMenuIcon( 59 | // currentIndex: bottomNavBarSelectedIndex, 60 | // itemIndex: 3, 61 | // svgPic: 'assets/svg/profile.svg', 62 | // title: '', 63 | // ), 64 | ], 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/screens/loading_screen/loading.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | import 'package:saldah_shop/models/api_response.dart'; 4 | import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 5 | import 'package:saldah_shop/screens/signin_screen/signin_screen.dart'; 6 | import 'package:saldah_shop/services/user_services.dart'; 7 | 8 | class LoadingScreen extends StatefulWidget { 9 | const LoadingScreen({super.key}); 10 | 11 | @override 12 | State createState() => _LoadingScreenState(); 13 | } 14 | 15 | class _LoadingScreenState extends State { 16 | void _loadUserInfo() async { 17 | String token = await getToken(); 18 | if (token == '') { 19 | Navigator.of(context).pushAndRemoveUntil( 20 | MaterialPageRoute(builder: (context) => SignInScreen()), 21 | (route) => false); 22 | } else { 23 | ApiResponse response = await getUserDetails(); 24 | if (response.error == null) { 25 | Navigator.of(context).pushAndRemoveUntil( 26 | MaterialPageRoute(builder: (context) => HomeScreen()), 27 | (route) => false); 28 | } else if (response.error == unauthorized) { 29 | Navigator.of(context).pushAndRemoveUntil( 30 | MaterialPageRoute(builder: (context) => SignInScreen()), 31 | (route) => false); 32 | } else { 33 | ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('${response.error}'))); 34 | } 35 | } 36 | } 37 | 38 | @override 39 | void initState() { 40 | _loadUserInfo(); 41 | super.initState(); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return Container( 47 | height: MediaQuery.of(context).size.height, 48 | color: Colors.white, 49 | child: Center( 50 | // child: Image.network('https://media.giphy.com/media/LP01OPcV97bomkxOAk/giphy.gif'), 51 | child: CircularProgressIndicator(color: AppColors.darkGrey), 52 | ), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/screens/message_screen/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 3 | 4 | class Body extends StatelessWidget { 5 | const Body({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | elevation: 0, 12 | backgroundColor: Colors.white, 13 | centerTitle: true, 14 | leading: IconButton( 15 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 16 | MaterialPageRoute(builder: (context) => HomeScreen()), 17 | (route) => false), 18 | icon: Icon(Icons.arrow_back), 19 | color: Colors.black), 20 | ), 21 | body: Center( 22 | child: Text('Message Screen'), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/screens/message_screen/message_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/message_screen/components/body.dart'; 3 | 4 | class MessageScreen extends StatefulWidget { 5 | const MessageScreen({super.key}); 6 | 7 | @override 8 | State createState() => _MessageScreenState(); 9 | } 10 | 11 | class _MessageScreenState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | body: Body(), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/screens/notification_screen/notification_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NotificationScreen extends StatefulWidget { 4 | const NotificationScreen({super.key}); 5 | 6 | @override 7 | State createState() => _NotificationScreenState(); 8 | } 9 | 10 | class _NotificationScreenState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | body: Center( 15 | child: Text('Notification Screen'), 16 | ), 17 | ); 18 | } 19 | } -------------------------------------------------------------------------------- /lib/screens/product_screen/list_product.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | import 'package:saldah_shop/models/api_response.dart'; 4 | import 'package:saldah_shop/models/product.dart'; 5 | import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 6 | import 'package:saldah_shop/screens/product_screen/add_product.dart'; 7 | import 'package:saldah_shop/screens/signin_screen/signin_screen.dart'; 8 | import 'package:saldah_shop/services/product_services.dart'; 9 | import 'package:saldah_shop/services/user_services.dart'; 10 | 11 | class ListProductScreen extends StatefulWidget { 12 | const ListProductScreen({super.key}); 13 | 14 | @override 15 | State createState() => _ListProductScreenState(); 16 | } 17 | 18 | class _ListProductScreenState extends State { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: AppBar( 23 | elevation: 0, 24 | backgroundColor: Colors.white, 25 | centerTitle: true, 26 | leading: IconButton( 27 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 28 | MaterialPageRoute(builder: (context) => HomeScreen()), 29 | (route) => false), 30 | icon: Icon(Icons.arrow_back), 31 | color: Colors.black, 32 | ), 33 | ), 34 | body: Center( 35 | child: Text('List Product Screen'), 36 | ), 37 | floatingActionButton: FloatingActionButton( 38 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 39 | MaterialPageRoute(builder: (context) => AddProductScreen()), 40 | (route) => false), 41 | child: Icon(Icons.add), 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/screens/profile_screen/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 3 | 4 | class Body extends StatefulWidget { 5 | const Body({super.key}); 6 | 7 | @override 8 | State createState() => _BodyState(); 9 | } 10 | 11 | class _BodyState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar( 16 | elevation: 0, 17 | backgroundColor: Colors.white, 18 | centerTitle: true, 19 | leading: IconButton( 20 | onPressed: () => Navigator.of(context).pushAndRemoveUntil( 21 | MaterialPageRoute(builder: (context) => HomeScreen()), 22 | (route) => false), 23 | icon: Icon(Icons.arrow_back), 24 | color: Colors.black), 25 | ), 26 | body: Center( 27 | child: Text('Profile Screen'), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/screens/profile_screen/profile_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/home_screen/home_screen.dart'; 3 | import 'package:saldah_shop/screens/profile_screen/components/body.dart'; 4 | 5 | class ProfileScreen extends StatefulWidget { 6 | const ProfileScreen({super.key}); 7 | 8 | @override 9 | State createState() => _ProfileScreenState(); 10 | } 11 | 12 | class _ProfileScreenState extends State { 13 | int bottomNavBarSelectedIndex = 0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | body: Body(), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/screens/signin_screen/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/components/no_account_text.dart'; 3 | import 'package:saldah_shop/screens/signin_screen/components/signin_form.dart'; 4 | import 'package:saldah_shop/size_config.dart'; 5 | 6 | class Body extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | SizeConfig().init(context); 10 | return SafeArea( 11 | child: SizedBox( 12 | width: double.infinity, 13 | child: Padding( 14 | padding: 15 | EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(20)), 16 | child: SingleChildScrollView( 17 | child: Column( 18 | children: [ 19 | SizedBox(height: SizeConfig.screenHeight * 0.04), 20 | Text( 21 | "Welcome", 22 | style: TextStyle( 23 | color: Colors.black, 24 | fontSize: getProportionateScreenWidth(28), 25 | fontWeight: FontWeight.bold, 26 | ), 27 | ), 28 | Text( 29 | "Sign in with your email and password", 30 | textAlign: TextAlign.center, 31 | ), 32 | SizedBox(height: SizeConfig.screenHeight * 0.08), 33 | SignForm(), 34 | SizedBox(height: getProportionateScreenHeight(20)), 35 | NoAccountText(), 36 | ], 37 | ), 38 | ), 39 | ), 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/screens/signin_screen/signin_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/signin_screen/components/body.dart'; 3 | 4 | class SignInScreen extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | body: Body(), 9 | ); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/screens/signup_screen/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/app/app_consts.dart'; 3 | import 'package:saldah_shop/screens/signup_screen/components/signup_form.dart'; 4 | import 'package:saldah_shop/size_config.dart'; 5 | 6 | class Body extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return SafeArea( 10 | child: SizedBox( 11 | width: double.infinity, 12 | child: Padding( 13 | padding: 14 | EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(20)), 15 | child: SingleChildScrollView( 16 | child: Column( 17 | children: [ 18 | SizedBox(height: SizeConfig.screenHeight * 0.04), // 4% 19 | Text("Register Account", style: headingStyle), 20 | Text( 21 | "Complete your details account", 22 | textAlign: TextAlign.center, 23 | ), 24 | SizedBox(height: SizeConfig.screenHeight * 0.08), 25 | SignUpForm(), 26 | SizedBox(height: getProportionateScreenHeight(20)), 27 | Text( 28 | 'By continuing your confirm that you agree \nwith our Term and Condition', 29 | textAlign: TextAlign.center, 30 | style: Theme.of(context).textTheme.caption, 31 | ) 32 | ], 33 | ), 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/screens/signup_screen/signup_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:saldah_shop/screens/signup_screen/components/body.dart'; 3 | 4 | class SignUpScreen extends StatelessWidget { 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | body: Body(), 10 | ); 11 | } 12 | } -------------------------------------------------------------------------------- /lib/services/product_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:saldah_shop/app/app_consts.dart'; 4 | import 'package:saldah_shop/models/api_response.dart'; 5 | import 'package:saldah_shop/models/product.dart'; 6 | import 'package:saldah_shop/services/user_services.dart'; 7 | import 'package:http/http.dart' as http; 8 | 9 | Future getProducts() async { 10 | ApiResponse apiResponse = ApiResponse(); 11 | try { 12 | String token = await getToken(); 13 | final response = await http.get(Uri.parse(productURL), 14 | headers: { 15 | 'Accept': 'application/json', 16 | 'Authorization': 'Bearer $token' 17 | }); 18 | 19 | switch(response.statusCode){ 20 | case 200: 21 | apiResponse.data = jsonDecode(response.body)['product'].map((p) => Product.fromJson(p)).toList(); 22 | apiResponse.data as List; 23 | // print(jsonDecode(response.body)); 24 | break; 25 | case 401: 26 | apiResponse.error = unauthorized; 27 | break; 28 | default: 29 | apiResponse.error = somethingWentWrong; 30 | break; 31 | } 32 | } 33 | catch (e){ 34 | apiResponse.error = e.toString(); 35 | } 36 | return apiResponse; 37 | } 38 | 39 | Future createProduct(String name, String price, String stock, 40 | String type, String description, String? image) async { 41 | ApiResponse apiResponse = ApiResponse(); 42 | try { 43 | String token = await getToken(); 44 | final response = await http.post( 45 | Uri.parse(productURL), 46 | headers: { 47 | 'Accept': 'application/json', 48 | 'Authorization': 'Bearer $token', 49 | }, 50 | body: image != null 51 | ? { 52 | 'name': name, 53 | 'price': price, 54 | 'stock': stock, 55 | 'type': type, 56 | 'description': description, 57 | 'image': image, 58 | } 59 | : { 60 | 'name': name, 61 | 'price': price, 62 | 'stock': stock, 63 | 'type': type, 64 | 'description': description, 65 | }, 66 | ); 67 | 68 | switch (response.statusCode) { 69 | case 200: 70 | apiResponse.data = jsonDecode(response.body); 71 | break; 72 | case 422: 73 | final errors = jsonDecode(response.body)['errors']; 74 | apiResponse.error = errors[errors.keys.elementAt[0]][0]; 75 | break; 76 | case 401: 77 | apiResponse.error = unauthorized; 78 | break; 79 | default: 80 | apiResponse.error = somethingWentWrong; 81 | break; 82 | } 83 | } catch (e) { 84 | apiResponse.error = serverError; 85 | } 86 | return apiResponse; 87 | } 88 | 89 | Future editProduct(int productId, String name, String price, 90 | String stock, String type, String description) async { 91 | ApiResponse apiResponse = ApiResponse(); 92 | try { 93 | String token = await getToken(); 94 | final response = await http.put( 95 | Uri.parse('$productURL/$productId'), 96 | headers: { 97 | 'Accept': 'application/json', 98 | 'Authorization': 'Bearer $token', 99 | }, 100 | body: { 101 | 'name': name, 102 | 'price': price, 103 | 'stock': stock, 104 | 'type': type, 105 | 'description': description, 106 | }, 107 | ); 108 | 109 | switch (response.statusCode) { 110 | case 200: 111 | apiResponse.data = jsonDecode(response.body)['message']; 112 | break; 113 | case 403: 114 | apiResponse.error = jsonDecode(response.body)['message']; 115 | break; 116 | case 401: 117 | apiResponse.error = unauthorized; 118 | break; 119 | default: 120 | apiResponse.error = somethingWentWrong; 121 | break; 122 | } 123 | } catch (e) { 124 | apiResponse.error = serverError; 125 | } 126 | 127 | return apiResponse; 128 | } 129 | 130 | Future deleteProduct(int productId) async { 131 | ApiResponse apiResponse = ApiResponse(); 132 | try { 133 | String token = await getToken(); 134 | final response = await http.delete( 135 | Uri.parse('$productURL/$productId'), 136 | headers: { 137 | 'Accept': 'application/json', 138 | 'Authorization': 'Bearer $token', 139 | }, 140 | ); 141 | 142 | switch (response.statusCode) { 143 | case 200: 144 | apiResponse.data = jsonDecode(response.body)['message']; 145 | break; 146 | case 403: 147 | apiResponse.error = jsonDecode(response.body)['message']; 148 | break; 149 | case 401: 150 | apiResponse.error = unauthorized; 151 | break; 152 | default: 153 | apiResponse.error = somethingWentWrong; 154 | break; 155 | } 156 | } catch (e) { 157 | apiResponse.error = serverError; 158 | } 159 | return apiResponse; 160 | } 161 | -------------------------------------------------------------------------------- /lib/services/user_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:saldah_shop/app/app_consts.dart'; 5 | import 'package:saldah_shop/models/api_response.dart'; 6 | import 'package:http/http.dart' as http; 7 | import 'package:saldah_shop/models/user_model.dart'; 8 | import 'package:shared_preferences/shared_preferences.dart'; 9 | 10 | Future login(String email, String password) async { 11 | ApiResponse apiResponse = ApiResponse(); 12 | 13 | try { 14 | final response = await http.post(Uri.parse(loginURL), 15 | headers: {'Accept': 'application/json'}, 16 | body: {'email': email, 'password': password}); 17 | 18 | switch (response.statusCode) { 19 | case 200: 20 | apiResponse.data = User.fromJson(jsonDecode(response.body)); 21 | break; 22 | case 422: 23 | final errors = jsonDecode(response.body)['errors']; 24 | apiResponse.error = errors[errors.keys.elementAt(0)][0]; 25 | break; 26 | case 403: 27 | apiResponse.error = jsonDecode(response.body)['message']; 28 | break; 29 | default: 30 | apiResponse.error = somethingWentWrong; 31 | break; 32 | } 33 | } catch (e) { 34 | apiResponse.error = serverError; 35 | } 36 | return apiResponse; 37 | } 38 | 39 | Future register(String name, String email, String password) async { 40 | ApiResponse apiResponse = ApiResponse(); 41 | 42 | try { 43 | final response = await http.post(Uri.parse(registerURL), headers: { 44 | 'Accept': 'application/json' 45 | }, body: { 46 | 'name': name, 47 | 'email': email, 48 | 'password': password, 49 | 'password_confirmation': password 50 | }); 51 | 52 | switch (response.statusCode) { 53 | case 200: 54 | apiResponse.data = User.fromJson(jsonDecode(response.body)); 55 | break; 56 | case 422: 57 | final errors = jsonDecode(response.body)['errors']; 58 | apiResponse.error = errors[errors.keys.elementAt(0)][0]; 59 | break; 60 | case 403: 61 | apiResponse.error = jsonDecode(response.body)['message']; 62 | break; 63 | default: 64 | apiResponse.error = somethingWentWrong; 65 | break; 66 | } 67 | } catch (e) { 68 | apiResponse.error = serverError; 69 | } 70 | return apiResponse; 71 | } 72 | 73 | Future getUserDetails() async { 74 | ApiResponse apiResponse = ApiResponse(); 75 | try { 76 | String token = await getToken(); 77 | final response = await http.get( 78 | Uri.parse(userURL), 79 | headers: {'Accept': 'Application/json', 'Authorization': 'Bearer $token'}, 80 | ); 81 | 82 | switch (response.statusCode) { 83 | case 200: 84 | apiResponse.data = User.fromJson(jsonDecode(response.body)); 85 | break; 86 | case 401: 87 | apiResponse.error = unauthorized; 88 | break; 89 | default: 90 | apiResponse.error = somethingWentWrong; 91 | break; 92 | } 93 | } catch (e) { 94 | apiResponse.error = serverError; 95 | } 96 | return apiResponse; 97 | } 98 | 99 | Future getToken() async { 100 | SharedPreferences pref = await SharedPreferences.getInstance(); 101 | return pref.getString('token') ?? ''; 102 | } 103 | 104 | Future getUserId() async { 105 | SharedPreferences pref = await SharedPreferences.getInstance(); 106 | return pref.getInt('userId') ?? 0; 107 | } 108 | 109 | Future logout() async { 110 | SharedPreferences pref = await SharedPreferences.getInstance(); 111 | return pref.remove('token'); 112 | } 113 | 114 | String? getStringImage(File? file) { 115 | if (file == null) return null; 116 | return base64Encode(file.readAsBytesSync()); 117 | } 118 | -------------------------------------------------------------------------------- /lib/size_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SizeConfig { 4 | static late MediaQueryData _mediaQueryData; 5 | static late double screenWidth; 6 | static late double screenHeight; 7 | static double? defaultSize; 8 | static Orientation? orientation; 9 | 10 | void init(BuildContext context) { 11 | _mediaQueryData = MediaQuery.of(context); 12 | screenWidth = _mediaQueryData.size.width; 13 | screenHeight = _mediaQueryData.size.height; 14 | orientation = _mediaQueryData.orientation; 15 | } 16 | } 17 | 18 | // Get the proportionate height as per screen size 19 | double getProportionateScreenHeight(double inputHeight) { 20 | double screenHeight = SizeConfig.screenHeight; 21 | // 812 is the layout height that designer use 22 | return (inputHeight / 812.0) * screenHeight; 23 | } 24 | 25 | // Get the proportionate height as per screen size 26 | double getProportionateScreenWidth(double inputWidth) { 27 | double screenWidth = SizeConfig.screenWidth; 28 | // 375 is the layout width that designer use 29 | return (inputWidth / 375.0) * screenWidth; 30 | } 31 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "saldah_shop") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.manusiacoding.saldah_shop") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "saldah_shop"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "saldah_shop"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import path_provider_macos 9 | import shared_preferences_macos 10 | 11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 12 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 13 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 14 | } 15 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = saldah_shop 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.manusiacoding.saldahShop 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.manusiacoding. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: saldah_shop 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | # In Windows, build-name is used as the major, minor, and patch parts 19 | # of the product and file versions while build-number is used as the build suffix. 20 | version: 1.0.0+1 21 | 22 | environment: 23 | sdk: '>=2.18.0 <3.0.0' 24 | 25 | # Dependencies specify other packages that your package needs in order to work. 26 | # To automatically upgrade your package dependencies to the latest versions 27 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 28 | # dependencies can be manually updated by changing the version numbers below to 29 | # the latest version available on pub.dev. To see which dependencies have newer 30 | # versions available, run `flutter pub outdated`. 31 | dependencies: 32 | flutter: 33 | sdk: flutter 34 | 35 | 36 | # The following adds the Cupertino Icons font to your application. 37 | # Use with the CupertinoIcons class for iOS style icons. 38 | cupertino_icons: ^1.0.2 39 | google_fonts: ^3.0.1 40 | flutter_svg: ^1.1.5 41 | http: ^0.13.5 42 | shared_preferences: ^2.0.15 43 | dropdown_search: ^5.0.2 44 | image_picker: ^0.8.5+3 45 | 46 | flutter_icons: 47 | android: true 48 | ios: true 49 | image_path: "assets/pictures/logo.png" 50 | min_sdk_android: 21 51 | remove_alpha_ios: true 52 | windows: 53 | generate: true 54 | image_path: "assets/images/icon-1024x1024.png" 55 | icon_size: 48 56 | 57 | dev_dependencies: 58 | flutter_test: 59 | sdk: flutter 60 | 61 | # The "flutter_lints" package below contains a set of recommended lints to 62 | # encourage good coding practices. The lint set provided by the package is 63 | # activated in the `analysis_options.yaml` file located at the root of your 64 | # package. See that file for information about deactivating specific lint 65 | # rules and activating additional ones. 66 | flutter_lints: ^2.0.0 67 | flutter_launcher_icons: ^0.10.0 68 | 69 | # For information on the generic Dart part of this file, see the 70 | # following page: https://dart.dev/tools/pub/pubspec 71 | 72 | # The following section is specific to Flutter packages. 73 | flutter: 74 | 75 | # The following line ensures that the Material Icons font is 76 | # included with your application, so that you can use the icons in 77 | # the material Icons class. 78 | uses-material-design: true 79 | 80 | # To add assets to your application, add an assets section, like this: 81 | assets: 82 | - assets/pictures/ 83 | - assets/svg/ 84 | 85 | # An image asset can refer to one or more resolution-specific "variants", see 86 | # https://flutter.dev/assets-and-images/#resolution-aware 87 | 88 | # For details regarding adding assets from package dependencies, see 89 | # https://flutter.dev/assets-and-images/#from-packages 90 | 91 | # To add custom fonts to your application, add a fonts section here, 92 | # in this "flutter" section. Each entry in this list should have a 93 | # "family" key with the font family name, and a "fonts" key with a 94 | # list giving the asset and other descriptors for the font. For 95 | # example: 96 | # fonts: 97 | # - family: Schyler 98 | # fonts: 99 | # - asset: fonts/Schyler-Regular.ttf 100 | # - asset: fonts/Schyler-Italic.ttf 101 | # style: italic 102 | # - family: Trajan Pro 103 | # fonts: 104 | # - asset: fonts/TrajanPro.ttf 105 | # - asset: fonts/TrajanPro_Bold.ttf 106 | # weight: 700 107 | # 108 | # For details regarding fonts from package dependencies, 109 | # see https://flutter.dev/custom-fonts/#from-packages 110 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:saldah_shop/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | saldah_shop 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "saldah_shop", 3 | "short_name": "saldah_shop", 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 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(saldah_shop LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "saldah_shop") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 37 | 38 | # Run the Flutter tool portions of the build. This must not be removed. 39 | add_dependencies(${BINARY_NAME} flutter_assemble) 40 | -------------------------------------------------------------------------------- /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\\logo.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.manusiacoding" "\0" 93 | VALUE "FileDescription", "Saldah Shop" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "Saldah Shop" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.manusiacoding. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "Saldah Shop.exe" "\0" 98 | VALUE "ProductName", "Saldah Shop" "\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"Saldah Shop", 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/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/resources/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manusiacoding/e_commerce_app/4eed1cf35a06758af290768e6602a76c5d754f1c/windows/runner/resources/logo.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates 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 | --------------------------------------------------------------------------------