diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..24476c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..083a42e --- /dev/null +++ b/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: android + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: ios + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: linux + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: macos + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: web + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: windows + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..73208de --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,71 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.sapaly_shop" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..92322c2 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3feb6a7 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/example/sapaly_shop/MainActivity.kt b/android/app/src/main/kotlin/com/example/sapaly_shop/MainActivity.kt new file mode 100644 index 0000000..73c4b72 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/sapaly_shop/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.sapaly_shop + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..92322c2 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..58a8c74 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.2.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3c472b9 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..44e62bc --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/assets/icons/cart.svg b/assets/icons/cart.svg new file mode 100644 index 0000000..cf44abb --- /dev/null +++ b/assets/icons/cart.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/drawerIcons/car.svg b/assets/icons/drawerIcons/car.svg new file mode 100644 index 0000000..f4617df --- /dev/null +++ b/assets/icons/drawerIcons/car.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/drawerIcons/category.svg b/assets/icons/drawerIcons/category.svg new file mode 100644 index 0000000..924f889 --- /dev/null +++ b/assets/icons/drawerIcons/category.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/drawerIcons/home.svg b/assets/icons/drawerIcons/home.svg new file mode 100644 index 0000000..c620a12 --- /dev/null +++ b/assets/icons/drawerIcons/home.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/icons/drawerIcons/info.svg b/assets/icons/drawerIcons/info.svg new file mode 100644 index 0000000..b4f397c --- /dev/null +++ b/assets/icons/drawerIcons/info.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/drawerIcons/mail.svg b/assets/icons/drawerIcons/mail.svg new file mode 100644 index 0000000..24944da --- /dev/null +++ b/assets/icons/drawerIcons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/drawerIcons/sale.svg b/assets/icons/drawerIcons/sale.svg new file mode 100644 index 0000000..646aedf --- /dev/null +++ b/assets/icons/drawerIcons/sale.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/drawerIcons/shops.svg b/assets/icons/drawerIcons/shops.svg new file mode 100644 index 0000000..43dd889 --- /dev/null +++ b/assets/icons/drawerIcons/shops.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/menu.svg b/assets/icons/menu.svg new file mode 100644 index 0000000..20ea1a8 --- /dev/null +++ b/assets/icons/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/search.svg b/assets/icons/search.svg new file mode 100644 index 0000000..8ed3886 --- /dev/null +++ b/assets/icons/search.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/1.png b/assets/images/1.png new file mode 100644 index 0000000..cdeb718 Binary files /dev/null and b/assets/images/1.png differ diff --git a/assets/images/2.jpg b/assets/images/2.jpg new file mode 100644 index 0000000..bbd6c04 Binary files /dev/null and b/assets/images/2.jpg differ diff --git a/assets/images/3.jpg b/assets/images/3.jpg new file mode 100644 index 0000000..ba02b2c Binary files /dev/null and b/assets/images/3.jpg differ diff --git a/assets/images/banner.jpg b/assets/images/banner.jpg new file mode 100644 index 0000000..27161d8 Binary files /dev/null and b/assets/images/banner.jpg differ diff --git a/assets/images/sapalyLogo.png b/assets/images/sapalyLogo.png new file mode 100644 index 0000000..7d402f3 Binary files /dev/null and b/assets/images/sapalyLogo.png differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..9625e10 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4d9aa76 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,483 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.sapalyShop; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.sapalyShop; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.sapalyShop; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..c87d15a --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +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. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..28a9420 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Sapaly Shop + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + sapaly_shop + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/l10.yaml b/l10.yaml new file mode 100644 index 0000000..4e6692e --- /dev/null +++ b/l10.yaml @@ -0,0 +1,3 @@ +arb-dir: lib/l10n +template-arb-file: app_en.arb +output-localization-file: app_localizations.dart \ No newline at end of file diff --git a/lib/components/custom_button.dart b/lib/components/custom_button.dart new file mode 100644 index 0000000..7335b47 --- /dev/null +++ b/lib/components/custom_button.dart @@ -0,0 +1,37 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +Widget customButton({ + void Function()? tap, + bool? status = false, + String? text = 'Save', + String? statusText, + bool? isValid = false, + BuildContext? context, +}) { + return Container( + height: 48.adaptedPx(), + width: AppConstants.deviceWidth(context!), + margin: EdgeInsets.symmetric( + vertical: 15.adaptedPx(), horizontal: 10.adaptedPx()), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.adaptedPx()), + color: status == false + ? AppTheme.lightPrimaryColor + : AppTheme.blackColor.withOpacity(0.3), + ), + child: TextButton( + onPressed: status == true ? null : tap, + child: Text( + status == false ? text! : statusText!, + style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontSize: 18.adaptedPx(), + color: AppTheme.whiteColor, + ), + ), + ), + ); +} diff --git a/lib/components/dot.dart b/lib/components/dot.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/components/product_card.dart b/lib/components/product_card.dart new file mode 100644 index 0000000..64b5b7c --- /dev/null +++ b/lib/components/product_card.dart @@ -0,0 +1,126 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +class ProductCard extends StatelessWidget { + final String imageUrl, price, discountPrice, description; + final int discountPriceValue; + final VoidCallback onPressed; + + const ProductCard({ + Key? key, + required this.imageUrl, + required this.price, + required this.discountPrice, + required this.description, + required this.onPressed, + required this.discountPriceValue, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.adaptedPx()), + ), + child: TextButton( + onPressed: onPressed, + style: TextButton.styleFrom( + padding: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15.adaptedPx()), + ), + ), + child: Column( + children: [ + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(15.adaptedPx()), + topRight: Radius.circular(15.adaptedPx()), + ), + child: Image.network( + imageUrl, + fit: BoxFit.fitWidth, + alignment: Alignment.center, + height: AppConstants.deviceHeight(context) / 7, + width: double.infinity, + ), + ), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 4.adaptedPx(), + vertical: 5.adaptedPx(), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + price, + maxLines: 2, + softWrap: true, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w600, + color: AppTheme.blackColor, + fontSize: 13.adaptedPx(), + ), + ), + SizedBox(width: 5.adaptedPx()), + discountPriceValue == 0 + ? Container() + : Text( + discountPrice, + maxLines: 2, + softWrap: true, + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.w400, + color: AppTheme.redColor, + decoration: TextDecoration.lineThrough, + fontSize: 10.adaptedPx(), + ), + ), + const Spacer(), + SizedBox( + width: 30.adaptedPx(), + height: 30.adaptedPx(), + child: RawMaterialButton( + shape: const CircleBorder(), + fillColor: AppTheme.lightPrimaryColor, + onPressed: () {}, + child: const Icon( + Icons.add, + color: AppTheme.whiteColor, + ), + ), + ), + ], + ), + ), + Expanded( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.adaptedPx()), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + description, + softWrap: true, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w400, + color: AppTheme.blackColor, + fontSize: 11.adaptedPx(), + ), + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/components/sapaly_app_bar.dart b/lib/components/sapaly_app_bar.dart new file mode 100644 index 0000000..24dfa8f --- /dev/null +++ b/lib/components/sapaly_app_bar.dart @@ -0,0 +1,75 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/components/sapaly_icon.dart'; + +import '../themes/app_theme.dart'; + +class SapalyAppBar extends StatelessWidget with PreferredSizeWidget { + const SapalyAppBar({ + Key? key, + required this.hasActionButton, + required this.title, + required this.actionButton, + required this.leadingButton, + required this.leadingOnTap, + required this.actionOnTap, + required this.badge, + }) : super(key: key); + + final bool hasActionButton; + final String title, badge; + final Widget leadingButton; + final void Function() leadingOnTap; + final void Function() actionOnTap; + final Widget actionButton; + + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.all(10.adaptedPx()), + child: AppBar( + backgroundColor: AppTheme.lightBackgroundColor, + toolbarHeight: 65.adaptedPx(), + centerTitle: true, + elevation: 0, + titleTextStyle: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontWeight: FontWeight.w600, + fontSize: 20.adaptedPx(), + ), + toolbarTextStyle: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontWeight: FontWeight.w600, + fontSize: 20.adaptedPx(), + ), + leading: SapalyIcon( + height: 50.adaptedPx(), + width: 50.adaptedPx(), + onTap: leadingOnTap, + hasBadge: false, + child: leadingButton, + ), + title: Text( + title, + ), + actions: [ + hasActionButton + ? SapalyIcon( + onTap: actionOnTap, + height: 50.adaptedPx(), + width: 50.adaptedPx(), + hasBadge: true, + badge: badge, + child: actionButton, + ) + : Container(), + ], + // ], + ), + ); + } + + @override + Size get preferredSize => Size(0, 75.adaptedPx()); +} diff --git a/lib/components/sapaly_icon.dart b/lib/components/sapaly_icon.dart new file mode 100644 index 0000000..7b95122 --- /dev/null +++ b/lib/components/sapaly_icon.dart @@ -0,0 +1,93 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; + +import '../themes/app_theme.dart'; + +class SapalyIcon extends StatelessWidget { + const SapalyIcon({ + super.key, + required this.child, + required this.onTap, + required this.width, + required this.height, + required this.hasBadge, + this.badge, + }); + final Widget child; + final bool hasBadge; + final String? badge; + final VoidCallback onTap; + final double width, height; + + @override + Widget build(BuildContext context) { + return Builder( + builder: (context) { + return hasBadge + ? Badge( + textStyle: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.whiteColor, + ), + largeSize: 16.adaptedPx(), + alignment: AlignmentDirectional(30.adaptedPx(), 0), + label: Text( + badge!, + ), + child: SizedBox( + width: width, + height: height, + child: RawMaterialButton( + elevation: 0, + focusElevation: 0, + hoverElevation: 0, + highlightElevation: 0, + highlightColor: AppTheme.lightPrimaryColor.withOpacity(0.3), + splashColor: AppTheme.lightPrimaryColor.withOpacity(0.4), + shape: const CircleBorder(), + fillColor: AppTheme.whiteColor, + onPressed: onTap, + child: child, + ), + ), + ) + : SizedBox( + width: width, + height: height, + child: RawMaterialButton( + elevation: 0, + focusElevation: 0, + hoverElevation: 0, + highlightElevation: 0, + focusColor: AppTheme.lightPrimaryColor, + highlightColor: AppTheme.lightPrimaryColor.withOpacity(0.3), + splashColor: AppTheme.lightPrimaryColor.withOpacity(0.4), + shape: const CircleBorder(), + fillColor: AppTheme.whiteColor, + onPressed: onTap, + child: child, + ), + ); + // Container( + // width: width, + // height: height, + // decoration: BoxDecoration( + // color: AppTheme.whiteColor, + // borderRadius: BorderRadius.circular(50.adaptedPx()), + // ), + // child: TextButton( + // onPressed: onTap, + // child: child, + // style: ButtonStyle( + // shape: MaterialStateProperty.all( + // RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(50), + // ), + // ), + // ), + // ), + // ); + }, + ); + } +} diff --git a/lib/components/searchField.dart b/lib/components/searchField.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/components/snack_message.dart b/lib/components/snack_message.dart new file mode 100644 index 0000000..66b85fd --- /dev/null +++ b/lib/components/snack_message.dart @@ -0,0 +1,41 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +// void successMessage({String? message, BuildContext? context}) { +// ScaffoldMessenger.of(context!).showSnackBar( +// SnackBar( +// content: Text( +// message!, +// style: Theme.of(context).primaryTextTheme.bodyMedium, +// ), +// backgroundColor: AppTheme.blackColor, +// ), +// ); +// } + +// void errorMessage({String? message, BuildContext? context}) { +// ScaffoldMessenger.of(context!).showSnackBar( +// SnackBar( +// content: Text( +// message!, +// style: Theme.of(context).primaryTextTheme.bodyMedium, +// ), +// backgroundColor: AppTheme.redColor, +// ), +// ); +// } + +void showMessage({String? message, BuildContext? context}) { + ScaffoldMessenger.of(context!).showSnackBar( + SnackBar( + content: Text( + message!, + style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontSize: 16.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + ); +} diff --git a/lib/components/text_field.dart b/lib/components/text_field.dart new file mode 100644 index 0000000..3a16810 --- /dev/null +++ b/lib/components/text_field.dart @@ -0,0 +1,43 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +Widget customTextField({ + String? title, + String? hint, + TextEditingController? controller, + int? maxLines = 1, + BuildContext? context, +}) { + return Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text( + title!, + style: Theme.of(context!).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w600, + color: AppTheme.blackColor, + ), + ), + ), + TextFormField( + controller: controller, + maxLines: maxLines, + cursorColor: AppTheme.lightPrimaryColor, + decoration: InputDecoration( + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(15.adaptedPx()), + borderSide: const BorderSide( + color: AppTheme.lightPrimaryColor, + ), + ), + focusColor: AppTheme.lightPrimaryColor, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + ), + ], + ); +} diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb new file mode 100644 index 0000000..3c419d2 --- /dev/null +++ b/lib/l10n/app_en.arb @@ -0,0 +1,4 @@ +{ + "categories":"Categories", + "searchHint":"Search" +} \ No newline at end of file diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb new file mode 100644 index 0000000..8ecfaa3 --- /dev/null +++ b/lib/l10n/app_ru.arb @@ -0,0 +1,4 @@ +{ + "categories":"Категории", + "searchHint":"Поиск" +} \ No newline at end of file diff --git a/lib/l10n/app_tk.arb b/lib/l10n/app_tk.arb new file mode 100644 index 0000000..489eb42 --- /dev/null +++ b/lib/l10n/app_tk.arb @@ -0,0 +1,4 @@ +{ + "categories":"Kategoriýalar", + "searchHint":"Gözleg" +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..800fba1 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,59 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:sapaly_shop/onboard.dart'; +import 'package:sapaly_shop/providers/auth_provider/auth_provider.dart'; +import 'package:sapaly_shop/screens/auth/login.dart'; +import 'package:sapaly_shop/screens/category/category_screen.dart'; +import 'package:sapaly_shop/screens/dashboard/dashboard.dart'; +import 'package:sapaly_shop/screens/drawer/sapaly_drawer.dart'; +import 'package:sapaly_shop/screens/home/home_screen.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import 'models/settings_model.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + SharedPreferences prefs = await SharedPreferences.getInstance(); + await SettingsModel.initLocalization( + prefs.getString('language') ?? kDefaultLanguage); + runApp( + MultiProvider( + providers: [ + ChangeNotifierProvider(create: (_) => SettingsModel(prefs)), + ChangeNotifierProvider(create: (_) => AuthenticatonProvider()), + ], + child: const MyApp(), + ), + ); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return SizeInitializer( + builder: (context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + theme: AppTheme.appLightTheme, + title: 'Sapaly Mahabat', + initialRoute: '/login', + routes: { + '/': (context) => const Dashboard(), + '/drawer': (context) => SapalyDrawer(), + '/onboard': (context) => const Onboard(), + '/home': (context) => const HomeScreen(), + '/login': (context) => const LoginScreen(), + '/category': (context) => const CategoryScreen(), + }, + localizationsDelegates: AppConstants.localizationsDelegate, + supportedLocales: AppConstants.supportedLocales, + ); + }, + ); + } +} diff --git a/lib/models/category_model.dart b/lib/models/category_model.dart new file mode 100644 index 0000000..3fc86b8 --- /dev/null +++ b/lib/models/category_model.dart @@ -0,0 +1,80 @@ +import 'dart:convert'; + +class CategoryModel { + CategoryModel({ + required this.id, + required this.name, + required this.translations, + required this.icon, + }); + + final int id; + final String name; + final List translations; + final Iconca icon; + + factory CategoryModel.fromJson( + Map json, String currentLang) { + final List translations = (json['translations'] as List) + .map((e) => Translation.fromJson(e)) + .toList(); + + String language = json['name'] ?? ''; + for (Translation item in translations) { + if (item.locale == currentLang) language = item.attributeData['name']; + } + + return CategoryModel( + id: json["id"] ?? '', + name: language, + translations: (json['translations'] as List) + .map((e) => Translation.fromJson(e)) + .toList(), + icon: Iconca.fromJson(json["icon"] ?? ''), + ); + } +} + +class Iconca { + Iconca({ + required this.id, + required this.path, + }); + + final int id; + final String path; + + factory Iconca.fromJson(Map json) => Iconca( + id: json["id"] ?? 0, + path: json["path"], + ); + + Map toJson() => { + "id": id, + "path": path, + }; +} + +class Translation { + Translation({ + required this.locale, + required this.modelId, + required this.attributeData, + }); + + final String locale; + final String modelId; + final Map attributeData; + + factory Translation.fromJson(Map jsn) => Translation( + locale: jsn["locale"], + modelId: jsn["model_id"], + attributeData: json.decode(jsn["attribute_data"]), + ); + + Map toJson() => { + "locale": locale, + "model_id": modelId, + "attribute_data": attributeData, + }; +} diff --git a/lib/models/details_model.dart b/lib/models/details_model.dart new file mode 100644 index 0000000..df33341 --- /dev/null +++ b/lib/models/details_model.dart @@ -0,0 +1,60 @@ +import 'dart:convert'; + +class DetailsModel { + DetailsModel({ + required this.id, + required this.name, + required this.categoryId, + required this.description, + // required this.translations, + }); + + final int id; + final String name; + final int categoryId; + final String description; + // final List translations; + + factory DetailsModel.fromJson(Map json) { + // final List translations = (json['translations'] as List) + // .map((e) => Translation.fromJson(e)) + // .toList(); + // String language = json['name'] ?? ''; + + // for (Translation item in translations) { + // if (item.locale == currentLang) language = item.attributeData['name']; + // } + return DetailsModel( + id: json["id"] ?? 0, + name: json['name'] ?? '', + description: json["description"] ?? '', + categoryId: json["category_id"] ?? 0, + // translations: List.from( + // json["translations"].map((x) => Translation.fromJson(x))), + ); + } +} + +class Translation { + Translation({ + required this.locale, + required this.modelId, + required this.attributeData, + }); + + final String locale; + final String modelId; + final Map attributeData; + + factory Translation.fromJson(Map jsn) => Translation( + locale: jsn["locale"] ?? '', + modelId: jsn["model_id"] ?? '', + attributeData: json.decode(jsn["attribute_data"]), + ); + + Map toJson() => { + "locale": locale, + "model_id": modelId, + "attribute_data": attributeData, + }; +} diff --git a/lib/models/product_model.dart b/lib/models/product_model.dart new file mode 100644 index 0000000..3e2eb41 --- /dev/null +++ b/lib/models/product_model.dart @@ -0,0 +1,143 @@ +// To parse this JSON data, do +// +// final productModel = productModelFromJson(jsonString); + +import 'dart:convert'; + +class ProductModel { + ProductModel({ + required this.id, + required this.name, + required this.slug, + required this.categoryId, + required this.previewImage, + required this.translations, + required this.offer, + }); + + final int id; + final String name; + final String slug; + final int categoryId; + final PreviewImage previewImage; + final List translations; + final List offer; + + factory ProductModel.fromJson(Map json, String currentLang) { + final List translations = (json['translations'] as List) + .map((e) => Translation.fromJson(e)) + .toList(); + String language = json['name'] ?? ''; + + for (Translation item in translations) { + if (item.locale == currentLang) language = item.attributeData['name']; + } + + return ProductModel( + id: json["id"] ?? '', + name: language, + slug: json["slug"] ?? '', + categoryId: json["category_id"] ?? '', + previewImage: PreviewImage.fromJson(json["preview_image"] ?? ''), + translations: List.from( + json["translations"].map((x) => Translation.fromJson(x))), + offer: List.from(json["offer"].map((x) => Offer.fromJson(x))), + ); + } + + Map toJson() => { + "id": id, + "name": name, + "slug": slug, + "category_id": categoryId, + "preview_image": previewImage.toJson(), + "translations": List.from(translations.map((x) => x.toJson())), + }; +} + +class PreviewImage { + PreviewImage({ + required this.id, + required this.sortOrder, + required this.path, + }); + + final int id; + final int sortOrder; + final String path; + + factory PreviewImage.fromJson(Map json) => PreviewImage( + id: json["id"] ?? '', + sortOrder: json["sort_order"] ?? '', + path: json["path"] ?? '', + ); + + Map toJson() => { + "id": id, + "sort_order": sortOrder, + "path": path, + }; +} + +class Translation { + Translation({ + required this.locale, + required this.modelId, + required this.attributeData, + }); + + final String locale; + final String modelId; + final Map attributeData; + + factory Translation.fromJson(Map jsn) => Translation( + locale: jsn["locale"] ?? '', + modelId: jsn["model_id"] ?? '', + attributeData: json.decode(jsn["attribute_data"]), + ); + + Map toJson() => { + "locale": locale, + "model_id": modelId, + "attribute_data": attributeData, + }; +} + +class Offer { + Offer({ + required this.id, + required this.name, + required this.quantity, + required this.description, + required this.price, + required this.oldPrice, + required this.discountPriceValue, + }); + + final int id; + final String name; + final int quantity; + final String description; + final String price; + final String oldPrice; + final int discountPriceValue; + + factory Offer.fromJson(Map json) => Offer( + id: json["id"] ?? '', + name: json["name"] ?? '', + quantity: json["quantity"] ?? '', + discountPriceValue: json['discount_price_value'] ?? '', + description: json["description"] ?? '', + price: json["price"] ?? '', + oldPrice: json["old_price"] ?? '', + ); + + Map toJson() => { + "id": id, + "name": name, + "quantity": quantity, + "description": description, + "price": price, + "old_price": oldPrice, + }; +} diff --git a/lib/models/settings_model.dart b/lib/models/settings_model.dart new file mode 100644 index 0000000..ffc9e85 --- /dev/null +++ b/lib/models/settings_model.dart @@ -0,0 +1,65 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +const kDefaultLanguage = 'tk'; + +class SettingsModel extends ChangeNotifier { + String _language = kDefaultLanguage; + + static AppLocalizations? _localization; + static Future initLocalization(String l) async { + _localization = + await AppLocalizations.delegate.load(Locale(l, l == 'en' ? 'US' : '')); + await AppLocalizations.delegate.load(Locale(l)); + } + + Future setLanguage(String l) async { + _language = l; + await initLocalization(l); + var prefs = await SharedPreferences.getInstance(); + await prefs.setString('language', _language); + notifyListeners(); + } + + String get currentLanguage => _language; + + Locale get language { + switch (_language) { + case 'ru': + return const Locale('ru', ''); + case 'en': + return const Locale('en', 'US'); + case 'tk': + return const Locale('tk', ''); + default: + return const Locale('tk', ''); + } + } + + void launch(SharedPreferences prefs) { + _language = prefs.getString('language') ?? _language; + notifyListeners(); + } + + SettingsModel(SharedPreferences prefs) { + launch(prefs); + } + + static SettingsModel of(BuildContext context, [bool listen = false]) { + return Provider.of(context, listen: listen); + } +} + +extension LocalMessageExt on String { + String get translation { + return { + "categories": SettingsModel._localization?.categories, + "searchHint": SettingsModel._localization?.searchHint, + }[this] ?? + this; + } +} diff --git a/lib/models/sliders_model.dart b/lib/models/sliders_model.dart new file mode 100644 index 0000000..6af8150 --- /dev/null +++ b/lib/models/sliders_model.dart @@ -0,0 +1,12 @@ +class SlidersModel { + SlidersModel({ + required this.id, + required this.img, + }); + + final int id; + final String img; + + factory SlidersModel.fromJson(Map json) => + SlidersModel(id: json["id"] ?? '', img: json["img"] ?? ''); +} diff --git a/lib/onboard.dart b/lib/onboard.dart new file mode 100644 index 0000000..f84a478 --- /dev/null +++ b/lib/onboard.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/screens/auth/login.dart'; + +class Onboard extends StatefulWidget { + const Onboard({super.key}); + + @override + State createState() => _OnboardState(); +} + +class _OnboardState extends State { + void navigate(BuildContext context) { + Future.delayed(const Duration(seconds: 3), () { + Navigator.of(context).pushAndRemoveUntil( + MaterialPageRoute( + builder: (context) => const LoginScreen(), + ), + (route) => false); + }); + } + + @override + void initState() { + navigate(context); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return const Scaffold( + body: Center( + child: Text('On Board'), + ), + ); + } +} diff --git a/lib/providers/auth_provider/auth_provider.dart b/lib/providers/auth_provider/auth_provider.dart new file mode 100644 index 0000000..d108c28 --- /dev/null +++ b/lib/providers/auth_provider/auth_provider.dart @@ -0,0 +1,107 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:http/http.dart' as http; +import 'package:flutter/widgets.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; + +class AuthenticatonProvider extends ChangeNotifier { + // Base URL + final requestBaseUrl = kBaseUrl; + bool _isLoading = false; + String _resMessage = ''; + + // Getter + bool get isLoading => _isLoading; + String get resMeessage => _resMessage; + + // for sign_up + void register({ + required String email, + required String phoneNumber, + required String password, + required String repeatPassword, + BuildContext? context, + }) async { + _isLoading = true; + notifyListeners(); + + String url = '$requestBaseUrl/api/jwt/register'; + + final body = { + 'email': email, + 'phone': phoneNumber, + 'password': password, + 'password_confirmation': repeatPassword, + }; + + debugPrint('This is SIGNUP BODY ${body.toString()}'); + + try { + final req = await http.post(Uri.parse(url), body: json.encode(body)); + + if (req.statusCode == 200 || req.statusCode == 201) { + debugPrint('SIGNUP success ${req.body}'); + } else { + final res = json.decode(req.body); + debugPrint('SIGNUP error ${res.body}'); + + _isLoading = false; + notifyListeners(); + } + } on SocketException catch (error) { + _isLoading = false; + _resMessage = 'Internet connection is not available'; + notifyListeners(); + } catch (err) { + _isLoading = false; + _resMessage = 'Please try again'; + notifyListeners(); + + debugPrint('::::: ${err.toString()}'); + } + } + + // for sign_in + void login({ + required String email, + required String password, + BuildContext? context, + }) async { + _isLoading = true; + notifyListeners(); + + String url = '$requestBaseUrl/api/jwt/login'; + + final body = { + 'email': email, + 'password': password, + }; + + debugPrint('This is SIGNUP BODY ${body.toString()}'); + + try { + final req = await http.post(Uri.parse(url), body: json.encode(body)); + + if (req.statusCode == 200 || req.statusCode == 201) { + debugPrint('LOGIN success ${req.body}'); + } else { + final res = json.decode(req.body); + debugPrint('LOGIN error ${res.body}'); + + _isLoading = false; + notifyListeners(); + } + } on SocketException catch (error) { + _isLoading = false; + _resMessage = 'Internet connection is not available'; + notifyListeners(); + } catch (err) { + _isLoading = false; + _resMessage = 'Please try again'; + notifyListeners(); + + debugPrint('::::: ${err.toString()}'); + } + } +} diff --git a/lib/screens/auth/login.dart b/lib/screens/auth/login.dart new file mode 100644 index 0000000..9060198 --- /dev/null +++ b/lib/screens/auth/login.dart @@ -0,0 +1,131 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:sapaly_shop/components/custom_button.dart'; +import 'package:sapaly_shop/components/snack_message.dart'; +import 'package:sapaly_shop/components/text_field.dart'; +import 'package:sapaly_shop/providers/auth_provider/auth_provider.dart'; +import 'package:sapaly_shop/screens/auth/register.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +import '../../services/page_navigator.dart'; + +class LoginScreen extends StatefulWidget { + const LoginScreen({super.key}); + + @override + State createState() => _LoginScreenState(); +} + +class _LoginScreenState extends State { + final TextEditingController _email = TextEditingController(); + final TextEditingController _password = TextEditingController(); + + @override + void dispose() { + _email.clear(); + _password.clear(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: AppConstants.horizontalPadding(context), + ), + padding: EdgeInsets.symmetric( + horizontal: AppConstants.horizontalPadding(context), + ), + height: AppConstants.deviceHeight(context) / (1.4), + width: double.infinity, + decoration: BoxDecoration( + border: Border.all( + width: 2.adaptedPx(), + color: AppTheme.blackColor.withOpacity(0.1), + ), + borderRadius: BorderRadius.circular(15.adaptedPx()), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/images/sapalyLogo.png'), + SizedBox(width: 20.adaptedPx()), + Text( + AppConstants.kAppName, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontWeight: FontWeight.w600, + fontSize: 20.adaptedPx(), + ), + ), + ], + ), + SizedBox(height: 20.adaptedPx()), + customTextField( + title: 'Email', + context: context, + hint: 'Enter your valid email address', + controller: _email, + ), + SizedBox(height: 20.adaptedPx()), + customTextField( + title: 'Password', + context: context, + hint: 'Enter your secured password', + controller: _password, + ), + SizedBox(height: 45.adaptedPx()), + Consumer(builder: (context, auth, child) { + return customButton( + text: 'Login', + tap: () { + if (_email.text.isEmpty || _password.text.isEmpty) { + showMessage( + context: context, + message: 'All fields are required', + ); + } else { + auth.login( + email: _email.text.trim(), + password: _password.text.trim()); + } + }, + context: context, + statusText: 'Loggin in...', + status: auth.isLoading, + ); + }), + Text( + 'Or', + textAlign: TextAlign.center, + style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontSize: 18.adaptedPx(), + ), + ), + customButton( + text: 'Register', + tap: () { + PageNavigator(ctx: context).nextPage( + page: const RegisterScreen(), + ); + }, + context: context, + isValid: false, + status: false, + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/auth/register.dart b/lib/screens/auth/register.dart new file mode 100644 index 0000000..7daf23b --- /dev/null +++ b/lib/screens/auth/register.dart @@ -0,0 +1,121 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/components/custom_button.dart'; +import 'package:sapaly_shop/components/text_field.dart'; +import 'package:sapaly_shop/screens/auth/login.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +import '../../services/page_navigator.dart'; + +class RegisterScreen extends StatefulWidget { + const RegisterScreen({super.key}); + + @override + State createState() => _RegisterScreenState(); +} + +class _RegisterScreenState extends State { + final TextEditingController _email = TextEditingController(); + final TextEditingController _password = TextEditingController(); + final TextEditingController _passwordConfirm = TextEditingController(); + final TextEditingController _phone = TextEditingController(); + + @override + void dispose() { + _email.clear(); + _password.clear(); + _passwordConfirm.clear(); + _phone.clear(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: AppConstants.horizontalPadding(context), + ), + padding: EdgeInsets.symmetric( + horizontal: AppConstants.horizontalPadding(context), + ), + height: AppConstants.deviceHeight(context) / (1.13), + width: double.infinity, + decoration: BoxDecoration( + border: Border.all( + width: 2.adaptedPx(), + color: AppTheme.blackColor.withOpacity(0.1), + ), + borderRadius: BorderRadius.circular(15.adaptedPx()), + ), + child: ListView( + physics: const NeverScrollableScrollPhysics(), + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/images/sapalyLogo.png'), + SizedBox(width: 20.adaptedPx()), + Text( + AppConstants.kAppName, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontWeight: FontWeight.w600, + fontSize: 20.adaptedPx(), + ), + ), + ], + ), + SizedBox(height: 20.adaptedPx()), + customTextField( + title: 'Your email', + context: context, + controller: _email, + hint: '', + ), + SizedBox(height: 15.adaptedPx()), + customTextField(title: 'Phone number', context: context), + SizedBox(height: 15.adaptedPx()), + customTextField(title: 'Password', context: context), + SizedBox(height: 15.adaptedPx()), + customTextField(title: 'Password confirmation', context: context), + SizedBox(height: 15.adaptedPx()), + customButton( + text: 'Register', + context: context, + status: false, + statusText: 'Registering...', + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()), + child: Text( + 'Or', + textAlign: TextAlign.center, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontSize: 18.adaptedPx(), + ), + ), + ), + customButton( + text: 'Login', + context: context, + tap: () { + PageNavigator(ctx: context).nextPageOnly( + page: const LoginScreen(), + ); + }, + statusText: 'Loggin in...', + status: true, + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/category/category_screen.dart b/lib/screens/category/category_screen.dart new file mode 100644 index 0000000..201f1a3 --- /dev/null +++ b/lib/screens/category/category_screen.dart @@ -0,0 +1,130 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; +import 'package:sapaly_shop/components/sapaly_app_bar.dart'; +import 'package:sapaly_shop/models/category_model.dart'; +import 'package:sapaly_shop/models/settings_model.dart'; +import 'package:sapaly_shop/services/requests.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +class CategoryScreen extends StatefulWidget { + const CategoryScreen({super.key}); + + @override + State createState() => _CategoryScreenState(); +} + +class _CategoryScreenState extends State { + bool hasError = false; + bool isLoading = true; + List categories = []; + late String currentLang; + + Future getCategories() async { + try { + var list = await API().getCategories(); + if (mounted) { + setState(() { + categories = list; + }); + } + } catch (e) { + debugPrint(e.toString()); + } + } + + @override + void initState() { + getCategories(); + currentLang = SettingsModel.of(context).currentLanguage; + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppTheme.lightBackgroundColor, + appBar: SapalyAppBar( + hasActionButton: true, + title: 'categories'.translation, + badge: '2', + leadingButton: const Icon( + Icons.arrow_back, + color: AppTheme.blackColor, + ), + actionButton: SvgPicture.asset('assets/icons/cart.svg'), + leadingOnTap: () { + Navigator.of(context).pop(); + }, + actionOnTap: () {}, + ), + body: categories.isEmpty + ? const Center(child: CircularProgressIndicator()) + : GridView.builder( + padding: EdgeInsets.symmetric(horizontal: 5.adaptedPx()), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 10.adaptedPx(), + childAspectRatio: 5 / 4, + mainAxisSpacing: 10.adaptedPx(), + ), + itemCount: categories.length, + itemBuilder: (context, index) { + return SizedBox( + width: 15.adaptedPx(), + height: 15.adaptedPx(), + child: RawMaterialButton( + onPressed: () {}, + splashColor: AppTheme.lightPrimaryColor.withOpacity(0.1), + highlightColor: AppTheme.lightPrimaryColor.withOpacity(0.1), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.adaptedPx())), + child: Container( + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + border: Border.all( + color: AppTheme.lightPrimaryColor, + width: 2.adaptedPx()), + borderRadius: BorderRadius.circular(25.adaptedPx()), + ), + child: Column( + children: [ + Expanded( + flex: 3, + child: CachedNetworkImage( + imageUrl: categories[index].icon.path, + width: MediaQuery.of(context).size.width / 7, + fit: BoxFit.contain, + progressIndicatorBuilder: + (context, url, progress) => const Center( + child: CircularProgressIndicator()), + ), + ), + Expanded( + flex: 1, + child: Text( + categories[index].name, + maxLines: 3, + softWrap: true, + textAlign: TextAlign.center, + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontSize: 15.adaptedPx(), + fontWeight: FontWeight.w600, + color: AppTheme.blackColor, + ), + ), + ), + ], + )), + ), + ); + }, + ), + ); + } +} diff --git a/lib/screens/dashboard/dashboard.dart b/lib/screens/dashboard/dashboard.dart new file mode 100644 index 0000000..4f389a3 --- /dev/null +++ b/lib/screens/dashboard/dashboard.dart @@ -0,0 +1,64 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +import '../../services/app_constants.dart'; + +class Dashboard extends StatelessWidget { + const Dashboard({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + alignment: Alignment.center, + color: AppTheme.lightBackgroundColor, + child: Container( + alignment: Alignment.center, + height: AppConstants.deviceHeight(context) / 2, + margin: EdgeInsets.symmetric(horizontal: 15.adaptedPx()), + decoration: BoxDecoration( + color: AppTheme.whiteColor, + borderRadius: BorderRadius.circular(16.adaptedPx())), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/sapalyLogo.png', + width: 60.adaptedPx(), + height: 60.adaptedPx(), + ), + SizedBox(width: 10.adaptedPx()), + Text( + AppConstants.kAppName, + style: GoogleFonts.poppins( + textStyle: + Theme.of(context).primaryTextTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w500, + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + ], + ), + Text( + 'Dil saylan', + style: GoogleFonts.poppins( + textStyle: + Theme.of(context).primaryTextTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w500, + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/details/details.dart b/lib/screens/details/details.dart new file mode 100644 index 0000000..c748339 --- /dev/null +++ b/lib/screens/details/details.dart @@ -0,0 +1,254 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:sapaly_shop/components/sapaly_app_bar.dart'; +import 'package:sapaly_shop/models/details_model.dart'; +import 'package:sapaly_shop/models/settings_model.dart'; +import 'package:sapaly_shop/services/requests.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +class Details extends StatefulWidget { + const Details({ + super.key, + required this.id, + required this.image, + required this.description, + required this.price, + }); + + final int id; + final String image, description, price; + + @override + State
createState() => _DetailsState(); +} + +class _DetailsState extends State
{ + int amount = 1; + DetailsModel? details; + + Future getData() async { + final result = await API().getDetails(widget.id); + if (mounted) { + setState(() { + details = result; + }); + } + } + + late String currentLanguage; + @override + void initState() { + getData(); + currentLanguage = SettingsModel.of(context).currentLanguage; + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppTheme.lightBackgroundColor, + appBar: SapalyAppBar( + hasActionButton: true, + badge: '2', + title: 'Details', + actionButton: SvgPicture.asset('assets/icons/cart.svg'), + leadingButton: const Icon(Icons.arrow_back, color: AppTheme.blackColor), + leadingOnTap: () { + Navigator.of(context).pop(); + }, + actionOnTap: () {}, + ), + body: details == null + ? const Center(child: CircularProgressIndicator()) + : Container( + alignment: Alignment.center, + margin: EdgeInsets.symmetric( + horizontal: 20.adaptedPx(), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()), + child: ClipRRect( + borderRadius: BorderRadius.circular(16.adaptedPx()), + child: Image.network( + widget.image, + width: double.infinity, + ), + ), + ), + Align( + alignment: Alignment.centerLeft, + child: Text( + widget.description, + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.w600, + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 15.adaptedPx()), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + widget.description, + textAlign: TextAlign.left, + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.w500, + fontSize: 13.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + widget.price, + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.w600, + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + const Spacer(), + Container( + decoration: BoxDecoration( + color: AppTheme.whiteColor, + borderRadius: BorderRadius.circular(16.adaptedPx()), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: () { + setState(() { + amount++; + }); + }, + style: TextButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(16.adaptedPx()), + bottomLeft: Radius.circular(16.adaptedPx()), + ), + ), + ), + child: Text( + '+', + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 10.adaptedPx()), + child: Text( + amount.toString(), + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + TextButton( + onPressed: () { + setState(() { + amount--; + }); + }, + style: TextButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topRight: Radius.circular(16.adaptedPx()), + bottomRight: + Radius.circular(16.adaptedPx()), + ), + ), + ), + child: Text( + '-', + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + ], + ), + ), + ], + ), + const Spacer(), + MaterialButton( + onPressed: () { + var snackBar = SnackBar( + content: Text( + 'Added to Card', + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontSize: 15.adaptedPx(), + ), + ), + ); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }, + height: 50.adaptedPx(), + color: AppTheme.lightPrimaryColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16.adaptedPx())), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + Icons.shopping_cart, + color: AppTheme.whiteColor, + ), + SizedBox(width: 10.adaptedPx()), + Text( + 'Add to Cart', + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + color: AppTheme.whiteColor, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + SizedBox(height: 20.adaptedPx()), + ], + ), + ), + ); + } +} diff --git a/lib/screens/drawer/sapaly_drawer.dart b/lib/screens/drawer/sapaly_drawer.dart new file mode 100644 index 0000000..457301e --- /dev/null +++ b/lib/screens/drawer/sapaly_drawer.dart @@ -0,0 +1,204 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:sapaly_shop/screens/auth/login.dart'; +import 'package:sapaly_shop/screens/auth/register.dart'; +import 'package:sapaly_shop/screens/category/category_screen.dart'; +import 'package:url_launcher/url_launcher_string.dart'; + +import '../../services/app_constants.dart'; +import '../../themes/app_theme.dart'; + +class SapalyDrawer extends StatelessWidget { + SapalyDrawer({super.key}); + + List icons = [ + 'assets/icons/drawerIcons/category.svg', + 'assets/icons/drawerIcons/info.svg', + 'assets/icons/drawerIcons/sale.svg', + 'assets/icons/drawerIcons/car.svg', + 'assets/icons/drawerIcons/shops.svg', + 'assets/icons/drawerIcons/mail.svg', + ]; + + List iconNames = [ + 'Categories', + 'About us', + 'Sales', + 'New arrival', + 'Shops', + 'Contacts', + ]; + + List routes = [ + const CategoryScreen(), + const LoginScreen(), + const RegisterScreen(), + Container(), + Container(), + Container(), + ]; + + @override + Widget build(BuildContext context) { + return Drawer( + backgroundColor: AppTheme.whiteColor, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 15.adaptedPx()), + child: Column( + children: [ + DrawerHeader( + padding: EdgeInsets.zero, + child: Row( + children: [ + Image.asset( + 'assets/images/sapalyLogo.png', + width: 60.adaptedPx(), + height: 60.adaptedPx(), + ), + SizedBox(width: 10.adaptedPx()), + Text( + AppConstants.kAppName, + style: GoogleFonts.poppins( + textStyle: Theme.of(context) + .primaryTextTheme + .bodyMedium! + .copyWith( + fontWeight: FontWeight.w600, + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + ), + ), + ), + ], + ), + ), + Expanded( + child: Row( + children: [ + Icon( + Icons.account_circle, + size: 40.adaptedPx(), + color: AppTheme.lightPrimaryColor, + ), + SizedBox(width: 10.adaptedPx()), + Text( + 'Aman Amanow', + softWrap: true, + maxLines: 2, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w600, + color: AppTheme.blackColor, + fontSize: 16.adaptedPx(), + ), + ), + IconButton( + onPressed: () {}, + color: AppTheme.lightPrimaryColor, + icon: const Icon(Icons.sports_baseball_outlined), + ), + Text( + 'En', + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w500, + color: AppTheme.blackColor, + fontSize: 16.adaptedPx(), + ), + ), + ], + ), + ), + ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: icons.length, + scrollDirection: Axis.vertical, + itemBuilder: (context, index) { + return TextButton( + style: TextButton.styleFrom( + padding: EdgeInsets.symmetric( + vertical: AppConstants.verticalPadding(context) / 2, + horizontal: AppConstants.horizontalPadding(context) / 2, + ), + ), + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute(builder: (context) => routes[index])); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SvgPicture.asset( + icons[index], + color: AppTheme.lightPrimaryColor, + ), + SizedBox(width: 10.adaptedPx()), + Text( + iconNames[index], + style: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontWeight: FontWeight.w500, + color: AppTheme.blackColor, + fontSize: 16.adaptedPx(), + ), + ), + ], + ), + ); + }, + ), + const Spacer(), + TextButton( + onPressed: () { + launchUrlString('tel://+99363508564'); + Navigator.of(context).pop(); + }, + child: Row( + children: [ + const Icon(Icons.call_outlined), + SizedBox(width: 15.adaptedPx()), + Text( + '+993 63 508564', + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w500, + color: AppTheme.blackColor, + fontSize: 17.adaptedPx(), + ), + ) + ], + ), + ), + TextButton( + child: Row( + children: [ + const Icon(Icons.call_outlined), + SizedBox(width: 15.adaptedPx()), + Text( + '+993 12 973168', + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontWeight: FontWeight.w500, + color: AppTheme.blackColor, + fontSize: 17.adaptedPx(), + ), + ) + ], + ), + onPressed: () { + launchUrlString('tel://+99312973168'); + Navigator.of(context).pop(); + }, + ), + SizedBox(height: 20.adaptedPx()), + ], + ), + ), + ); + } +} diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart new file mode 100644 index 0000000..82954c7 --- /dev/null +++ b/lib/screens/home/home_screen.dart @@ -0,0 +1,304 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:buttons_tabbar/buttons_tabbar.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:sapaly_shop/models/product_model.dart'; +import 'package:sapaly_shop/models/settings_model.dart'; +import 'package:sapaly_shop/models/sliders_model.dart'; +import 'package:sapaly_shop/screens/drawer/sapaly_drawer.dart'; +import 'package:sapaly_shop/screens/details/details.dart'; +import 'package:sapaly_shop/screens/home/search.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:sapaly_shop/services/requests.dart'; + +import '../../components/product_card.dart'; +import '../../components/sapaly_app_bar.dart'; +import '../../models/category_model.dart'; +import '../../themes/app_theme.dart'; + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State with TickerProviderStateMixin { + final GlobalKey _key = GlobalKey(); + int currentPage = 0; + int categoryId = 0; + bool hasError = false; + late TabController tabController; + List products = []; + List categories = []; + List sliders = []; + + Future getSliders() async { + try { + var list = await API().getSliders(); + if (mounted) { + setState(() { + sliders = list; + }); + } + } catch (e) { + debugPrint(e.toString()); + } + } + + Future getCategories() async { + try { + var list = await API().getCategories(); + + if (mounted) { + setState(() { + categories = list; + hasError = false; + }); + } + + tabController = TabController(length: categories.length, vsync: this); + } catch (e) { + setState(() { + hasError = true; + }); + debugPrint(e.toString()); + } + } + + Future getProductsByCategory(int id) async { + try { + var list = await API().getProductsByCategory(id); + if (mounted) { + setState(() { + products = list; + }); + } + } catch (e) { + debugPrint(e.toString()); + } + } + + @override + void initState() { + getSliders(); + getCategories(); + getProductsByCategory(categoryId); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppTheme.lightBackgroundColor, + key: _key, + drawer: SapalyDrawer(), + appBar: SapalyAppBar( + hasActionButton: true, + title: '', + badge: '2', + leadingButton: SvgPicture.asset('assets/icons/menu.svg'), + actionButton: SvgPicture.asset('assets/icons/cart.svg'), + leadingOnTap: () { + _key.currentState?.openDrawer(); + }, + actionOnTap: () {}, + ), + body: SingleChildScrollView( + padding: EdgeInsets.symmetric( + vertical: AppConstants.verticalPadding(context) / 2, + horizontal: AppConstants.horizontalPadding(context), + ), + physics: const BouncingScrollPhysics(), + child: Column( + children: [ + Container( + height: 50.adaptedPx(), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: AppTheme.whiteColor, + borderRadius: BorderRadius.circular(30.adaptedPx()), + ), + child: TextButton( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const SearchScreen(), + ), + ); + }, + style: TextButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.adaptedPx()), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 15.adaptedPx()), + child: SvgPicture.asset('assets/icons/search.svg'), + ), + Text( + 'searchHint'.translation, + style: GoogleFonts.poppins( + textStyle: Theme.of(context) + .primaryTextTheme + .bodyMedium + ?.copyWith( + fontSize: 16.adaptedPx(), + color: AppTheme.lightTextColor, + ), + ), + ), + ], + ), + ), + ), + CarouselSlider( + items: (sliders != null) + ? [ + for (int i = 0; i < sliders.length; i++) + CachedNetworkImage( + imageUrl: sliders[i].img, + width: AppConstants.deviceWidth(context), + fit: BoxFit.contain, + progressIndicatorBuilder: (context, url, progress) => + const Center( + child: CircularProgressIndicator(), + ), + ), + ] + : [ + const Center(child: CircularProgressIndicator()), + ], + options: CarouselOptions( + initialPage: 0, + padEnds: true, + scrollPhysics: const BouncingScrollPhysics(), + viewportFraction: 1, + autoPlay: true, + onPageChanged: (index, reason) { + setState(() { + currentPage = index; + }); + }, + autoPlayAnimationDuration: const Duration(seconds: 2), + autoPlayInterval: const Duration(seconds: 5), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate( + sliders.length, + (index) => buildDot( + index: index, + ), + ), + ), + Padding( + padding: + EdgeInsets.only(top: 20.adaptedPx(), bottom: 10.adaptedPx()), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + 'categories'.translation, + style: + Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + color: AppTheme.blackColor, + fontSize: 18.adaptedPx(), + fontWeight: FontWeight.w600, + ), + ), + ), + ), + categories.isEmpty + ? Padding( + padding: EdgeInsets.symmetric(vertical: 10.adaptedPx()), + child: const Center(child: CircularProgressIndicator()), + ) + : Padding( + padding: EdgeInsets.symmetric(vertical: 10.adaptedPx()), + child: ButtonsTabBar( + controller: tabController, + contentPadding: + EdgeInsets.symmetric(horizontal: 20.adaptedPx()), + splashColor: AppTheme.lightPrimaryColor, + radius: 10.adaptedPx(), + backgroundColor: AppTheme.lightPrimaryColor, + buttonMargin: EdgeInsets.only( + left: 0, + right: 15.adaptedPx(), + ), + onTap: (value) { + setState(() { + categoryId = categories[value].id; + debugPrint(categoryId.toString()); + }); + }, + unselectedBackgroundColor: AppTheme.whiteColor, + physics: const BouncingScrollPhysics(), + tabs: [ + for (var category in categories) + Tab(text: category.name) + ], + ), + ), + SizedBox(height: 15.adaptedPx()), + products.isEmpty && categories.isEmpty + ? SizedBox( + height: AppConstants.deviceHeight(context) / 1.190, + child: const Center(child: CircularProgressIndicator()), + ) + : SizedBox( + height: AppConstants.deviceHeight(context), + width: double.infinity, + child: TabBarView( + controller: tabController, + children: [ + for (ProductModel product in products) + ProductCard( + imageUrl: product.previewImage.path, + price: '${product.offer.first.price}.M', + discountPrice: '${product.offer.first.oldPrice}.M', + description: product.offer.first.name, + discountPriceValue: + product.offer.first.discountPriceValue, + onPressed: () => Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => Details( + id: product.id, + image: product.previewImage.path, + price: '${product.offer.first.price}.M', + description: product.offer.first.name, + ), + ), + ), + ) + ], + ), + ), + ], + ), + ), + ); + } + + Widget buildDot({int? index}) { + return AnimatedContainer( + duration: const Duration(milliseconds: 350), + margin: EdgeInsets.only(right: 5.adaptedPx()), + height: 8.adaptedPx(), + width: currentPage == index ? 25.adaptedPx() : 8.adaptedPx(), + decoration: BoxDecoration( + color: currentPage == index + ? AppTheme.lightPrimaryColor + : AppTheme.lightTextColor.withOpacity(0.3), + borderRadius: BorderRadius.circular(30.adaptedPx()), + ), + ); + } +} diff --git a/lib/screens/home/search.dart b/lib/screens/home/search.dart new file mode 100644 index 0000000..752b32a --- /dev/null +++ b/lib/screens/home/search.dart @@ -0,0 +1,39 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; + +import '../../components/sapaly_app_bar.dart'; +import '../../services/app_constants.dart'; +import '../../themes/app_theme.dart'; + +class SearchScreen extends StatelessWidget { + const SearchScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppTheme.lightBackgroundColor, + appBar: SapalyAppBar( + hasActionButton: false, + badge: '', + title: 'search', + actionButton: Container(color: AppTheme.lightBackgroundColor), + leadingButton: const Icon(Icons.arrow_back, color: AppTheme.blackColor), + leadingOnTap: () { + Navigator.of(context).pop(); + }, + actionOnTap: () {}, + ), + body: ListView( + padding: EdgeInsets.symmetric( + horizontal: AppConstants.horizontalPadding(context), + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + children: [ + SizedBox(height: AppConstants.verticalPadding(context)), + SizedBox(height: 15.adaptedPx()), + ], + ), + ); + } +} diff --git a/lib/screens/onboarding.dart b/lib/screens/onboarding.dart new file mode 100644 index 0000000..d7ce337 --- /dev/null +++ b/lib/screens/onboarding.dart @@ -0,0 +1,45 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:sapaly_shop/themes/app_theme.dart'; + +import '../services/app_constants.dart'; + +class OnboardingScreen extends StatelessWidget { + OnboardingScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: AppConstants.horizontalPadding(context), + ), + height: AppConstants.deviceHeight(context) / (1.7), + width: double.infinity, + decoration: BoxDecoration( + border: Border.all( + width: 2.adaptedPx(), + color: AppTheme.blackColor.withOpacity(0.2), + ), + borderRadius: BorderRadius.circular(15.adaptedPx()), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Dili saýlaň', + style: Theme.of(context).primaryTextTheme.bodyMedium?.copyWith( + fontSize: 18.adaptedPx(), + color: AppTheme.blackColor, + fontWeight: FontWeight.w600, + ), + ), + SizedBox(height: 25.adaptedPx()), + ], + ), + ), + ), + ); + } +} diff --git a/lib/services/app_constants.dart b/lib/services/app_constants.dart new file mode 100644 index 0000000..423e3fe --- /dev/null +++ b/lib/services/app_constants.dart @@ -0,0 +1,32 @@ +import 'package:adaptix/adaptix.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; +// import 'package:flutter_localizations/flutter_localizations.dart'; + +String kBaseUrl = 'http://sapalymahabat.com.tm'; + +abstract class AppConstants { + static const kAppName = 'Sapaly Mahabat'; + + static double deviceHeight(BuildContext context) => + MediaQuery.of(context).size.height; + + static double deviceWidth(BuildContext context) => + MediaQuery.of(context).size.width; + static const localizationsDelegate = [ + // AppLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ]; + static const supportedLocales = [ + Locale('en'), + Locale('ru'), + Locale('tk'), + ]; + + static double horizontalPadding(BuildContext context) => + MediaQuery.of(context).size.width * 0.04; + + static double verticalPadding(BuildContext context) => 20.adaptedPx(); +} diff --git a/lib/services/page_navigator.dart b/lib/services/page_navigator.dart new file mode 100644 index 0000000..2c32b2a --- /dev/null +++ b/lib/services/page_navigator.dart @@ -0,0 +1,17 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PageNavigator { + PageNavigator({this.ctx}); + BuildContext? ctx; + + Future nextPage({Widget? page}) { + return Navigator.push( + ctx!, CupertinoPageRoute(builder: (context) => page!)); + } + + void nextPageOnly({Widget? page}) { + Navigator.pushAndRemoveUntil( + ctx!, MaterialPageRoute(builder: (context) => page!), (route) => false); + } +} diff --git a/lib/services/requests.dart b/lib/services/requests.dart new file mode 100644 index 0000000..4e6a618 --- /dev/null +++ b/lib/services/requests.dart @@ -0,0 +1,83 @@ +// ignore_for_file: prefer_interpolation_to_compose_strings + +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:sapaly_shop/models/category_model.dart'; +import 'package:sapaly_shop/models/details_model.dart'; +import 'package:sapaly_shop/models/sliders_model.dart'; +import 'package:sapaly_shop/services/app_constants.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../models/product_model.dart'; + +class API { + static Future _getData(String path) async { + try { + final response = await http.get( + Uri.parse('$kBaseUrl/api/$path'), + headers: { + "Accept": "application/json", + "Content-Type": "application/json", + }, + ); + + if (response.statusCode == 200) { + return jsonDecode(response.body); + } + } catch (e) { + debugPrint(e.toString()); + rethrow; + } + } + + Future> getProductsByCategory(int id) async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + String currentLang = prefs.getString('language') ?? 'ru'; + try { + final products = await _getData('v1/products/category/$id'); + return (products['data']['data'] as List) + .map((e) => ProductModel.fromJson(e, currentLang)) + .toList(); + } catch (e) { + debugPrint(e.toString()); + rethrow; + } + } + + Future getDetails(int id) async { + try { + final details = await _getData("v1/products/$id"); + return DetailsModel.fromJson(details); + } catch (e) { + debugPrint(e.toString()); + rethrow; + } + } + + Future> getCategories() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + String currentLanguage = prefs.getString('language') ?? 'ru'; + try { + final categories = await _getData("v1/categories"); + return (categories["data"] as List) + .map((item) => CategoryModel.fromJson(item, currentLanguage)) + .toList(); + } catch (e) { + debugPrint(e.toString()); + rethrow; + } + } + + Future> getSliders() async { + try { + final categories = await _getData("v1/sliders"); + return (categories["data"] as List) + .map((item) => SlidersModel.fromJson(item)) + .toList(); + } catch (e) { + debugPrint(e.toString()); + rethrow; + } + } +} diff --git a/lib/themes/app_theme.dart b/lib/themes/app_theme.dart new file mode 100644 index 0000000..9b9da02 --- /dev/null +++ b/lib/themes/app_theme.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +abstract class AppTheme { + const AppTheme._(); + + static final _lightTheme = ThemeData.light(); + static get appLightTheme => _lightTheme.copyWith( + scaffoldBackgroundColor: whiteColor, + brightness: Brightness.light, + primaryColor: lightPrimaryColor, + primaryTextTheme: _lightTheme.primaryTextTheme.copyWith( + bodyMedium: GoogleFonts.poppins(), + ), + visualDensity: VisualDensity.adaptivePlatformDensity, + appBarTheme: const AppBarTheme( + backgroundColor: whiteColor, + elevation: 0, + iconTheme: IconThemeData(color: lightTextColor)), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom( + foregroundColor: lightPrimaryColor, + ), + ), + ); + + static const Color lightBackgroundColor = Color(0xfff5f5f5); + static const Color lightPrimaryColor = Color(0xFF5677FC); + static const Color lightTextColor = Color(0xFF4B4B4B); + static const Color whiteColor = Color(0xFFFFFFFF); + static const Color redColor = Color(0xFFEE2F3D); + static const Color blackColor = Color(0xFF151515); +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..137e858 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,856 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + adaptix: + dependency: "direct main" + description: + path: "." + ref: HEAD + resolved-ref: "56d89145bd1d73cc675737382e8bd1984cd5812e" + url: "https://github.com/mcfugger/adaptix.git" + source: git + version: "0.1.0" + archive: + dependency: transitive + description: + name: archive + sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d + url: "https://pub.dev" + source: hosted + version: "3.3.6" + args: + dependency: transitive + description: + name: args + sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + async: + dependency: transitive + description: + name: async + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" + source: hosted + version: "2.10.0" + badges: + dependency: "direct main" + description: + name: badges + sha256: "461031a60efbb95276f52107f63d5d45008b5ca1eb7f8ca440cadda9ec2143b0" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + buttons_flutter: + dependency: "direct main" + description: + name: buttons_flutter + sha256: "0a8446f30fc5210187e876b030feaa66465a0cfac17f27f6dad3c70c62853e79" + url: "https://pub.dev" + source: hosted + version: "0.0.2+1" + buttons_tabbar: + dependency: "direct main" + description: + name: buttons_tabbar + sha256: d8a53cd3be0ce5b662d01378b1cd842eb44ee68da5abeeff3c081ee3bf614160 + url: "https://pub.dev" + source: hosted + version: "1.3.6" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 + url: "https://pub.dev" + source: hosted + version: "3.2.3" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 + url: "https://pub.dev" + source: hosted + version: "1.0.2" + carousel_slider: + dependency: "direct main" + description: + name: carousel_slider + sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42" + url: "https://pub.dev" + source: hosted + version: "4.2.1" + characters: + dependency: transitive + description: + name: characters + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" + source: hosted + version: "1.2.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + url: "https://pub.dev" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" + source: hosted + version: "1.17.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" + source: hosted + version: "3.0.2" + csslib: + dependency: transitive + description: + name: csslib + sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + url: "https://pub.dev" + source: hosted + version: "0.17.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + device_info_plus: + dependency: transitive + description: + name: device_info_plus + sha256: "1d6e5a61674ba3a68fb048a7c7b4ff4bebfed8d7379dbe8f2b718231be9a7c95" + url: "https://pub.dev" + source: hosted + version: "8.1.0" + device_info_plus_platform_interface: + dependency: transitive + description: + name: device_info_plus_platform_interface + sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 + url: "https://pub.dev" + source: hosted + version: "7.0.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3" + url: "https://pub.dev" + source: hosted + version: "3.3.0" + flutter_launcher_icons: + dependency: "direct main" + description: + name: flutter_launcher_icons + sha256: a9de6706cd844668beac27c0aed5910fa0534832b3c2cad61a5fd977fce82a5d + url: "https://pub.dev" + source: hosted + version: "0.10.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" + source: hosted + version: "2.0.1" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_native_splash: + dependency: "direct main" + description: + name: flutter_native_splash + sha256: "6777a3abb974021a39b5fdd2d46a03ca390e03903b6351f21d10e7ecc969f12d" + url: "https://pub.dev" + source: hosted + version: "2.2.16" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: b9be7260c1fdbe0090a11d9d356fc2c88e14cf33407fc0c1829d76ab13808035 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: "927573f2e8a8d65c17931e21918ad0ab0666b1b636537de7c4932bdb487b190f" + url: "https://pub.dev" + source: hosted + version: "4.0.3" + html: + dependency: transitive + description: + name: html + sha256: d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 + url: "https://pub.dev" + source: hosted + version: "0.15.1" + http: + dependency: "direct main" + description: + name: http + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" + source: hosted + version: "0.13.5" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6" + url: "https://pub.dev" + source: hosted + version: "3.3.0" + intl: + dependency: "direct main" + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + lints: + dependency: transitive + description: + name: lints + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" + source: hosted + version: "0.12.13" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" + source: hosted + version: "1.8.0" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + os_detect: + dependency: transitive + description: + name: os_detect + sha256: faf3bcf39515e64da8ff76b2f2805b20a6ff47ae515393e535f8579ff91d6b7f + url: "https://pub.dev" + source: hosted + version: "2.0.1" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "8df5ab0a481d7dc20c0e63809e90a588e496d276ba53358afc4c4443d0a00697" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + path: + dependency: transitive + description: + name: path + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" + source: hosted + version: "1.8.2" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95 + url: "https://pub.dev" + source: hosted + version: "2.0.12" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e + url: "https://pub.dev" + source: hosted + version: "2.0.22" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: "2e32f1640f07caef0d3cb993680f181c79e54a3827b997d5ee221490d131fbd9" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 + url: "https://pub.dev" + source: hosted + version: "2.0.5" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c + url: "https://pub.dev" + source: hosted + version: "2.1.3" + pedantic: + dependency: transitive + description: + name: pedantic + sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + url: "https://pub.dev" + source: hosted + version: "2.1.3" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + url: "https://pub.dev" + source: hosted + version: "3.6.2" + process: + dependency: transitive + description: + name: process + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" + source: hosted + version: "4.2.4" + provider: + dependency: "direct main" + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" + source: hosted + version: "0.27.7" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "5949029e70abe87f75cfe59d17bf5c397619c4b74a099b10116baeb34786fad9" + url: "https://pub.dev" + source: hosted + version: "2.0.17" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "955e9736a12ba776bdd261cf030232b30eadfcd9c79b32a3250dd4a494e8c8f7" + url: "https://pub.dev" + source: hosted + version: "2.0.15" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "2b55c18636a4edc529fa5cd44c03d3f3100c00513f518c5127c951978efcccd0" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: f8ea038aa6da37090093974ebdcf4397010605fd2ff65c37a66f9d28394cb874 + url: "https://pub.dev" + source: hosted + version: "2.1.3" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3 + url: "https://pub.dev" + source: hosted + version: "2.1.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 + url: "https://pub.dev" + source: hosted + version: "2.0.4" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "5eaf05ae77658d3521d0e993ede1af962d4b326cd2153d312df716dc250f00c9" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + shimmer: + dependency: "direct main" + description: + name: shimmer + sha256: "1f1009b5845a1f88f1c5630212279540486f97409e9fc3f63883e71070d107bf" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + sqflite: + dependency: transitive + description: + name: sqflite + sha256: "78324387dc81df14f78df06019175a86a2ee0437624166c382e145d0a7fd9a4f" + url: "https://pub.dev" + source: hosted + version: "2.2.4+1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: bfd6973aaeeb93475bc0d875ac9aefddf7965ef22ce09790eb963992ffc5183f + url: "https://pub.dev" + source: hosted + version: "2.4.2+2" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" + source: hosted + version: "0.4.16" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + universal_io: + dependency: transitive + description: + name: universal_io + sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + upgrader: + dependency: "direct main" + description: + name: upgrader + sha256: "600eec301fd27b985a7cf223c0d8f70f1bca6290b959fa970e399bb4da6e8c8e" + url: "https://pub.dev" + source: hosted + version: "6.0.1" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: e8f2efc804810c0f2f5b485f49e7942179f56eabcfe81dce3387fec4bb55876b + url: "https://pub.dev" + source: hosted + version: "6.1.9" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" + url: "https://pub.dev" + source: hosted + version: "6.0.23" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "0a5af0aefdd8cf820dd739886efb1637f1f24489900204f50984634c07a54815" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" + url: "https://pub.dev" + source: hosted + version: "2.0.14" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + uuid: + dependency: transitive + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "09562ef5f47aa84f6567495adb6b9cb2a3192b82c352623b8bd00b300d62603b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "886e57742644ebed024dc3ade29712e37eea1b03d294fb314c0a3386243fe5a6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "5d9010c4a292766c55395b2288532579a85673f8148460d1e233d98ffe10d24e" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + version: + dependency: transitive + description: + name: version + sha256: "3d4140128e6ea10d83da32fef2fa4003fccbf6852217bb854845802f04191f94" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + win32: + dependency: transitive + description: + name: win32 + sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 + url: "https://pub.dev" + source: hosted + version: "3.1.3" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + xml: + dependency: transitive + description: + name: xml + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" + source: hosted + version: "6.2.2" + yaml: + dependency: transitive + description: + name: yaml + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" + source: hosted + version: "3.1.1" +sdks: + dart: ">=2.19.0 <4.0.0" + flutter: ">=3.7.0-0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..547ebe6 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,108 @@ +name: sapaly_shop +description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=2.19.0 <3.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.2 + flutter_localizations: + sdk: flutter + intl: ^0.17.0 + google_fonts: ^4.0.3 + flutter_svg: ^2.0.0+1 + carousel_slider: ^4.2.1 + adaptix: + git: + url: https://github.com/mcfugger/adaptix.git + http: ^0.13.5 + cached_network_image: ^3.2.3 + flutter_native_splash: ^2.2.0+1 + flutter_launcher_icons: ^0.10.0 + upgrader: ^6.0.1 + badges: ^3.0.2 + buttons_flutter: ^0.0.2+1 + buttons_tabbar: ^1.3.6 + shimmer: ^2.0.0 + url_launcher: ^6.1.9 + shared_preferences: ^2.0.17 + provider: ^6.0.5 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + generate: true + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/icons/ + - assets/icons/drawerIcons/ + - assets/images/ + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..df270bb --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:sapaly_shop/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}