diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0fa6b67 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# 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/ + +# Web related +lib/generated_plugin_registrant.dart + +# 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..a5584fc --- /dev/null +++ b/.metadata @@ -0,0 +1,10 @@ +# 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 and should not be manually edited. + +version: + revision: 18116933e77adc82f80866c928266a5b4f1ed645 + channel: stable + +project_type: app 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..6ac2704 --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,68 @@ +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 33 + + 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.car_customer_app" + minSdkVersion 20 + targetSdkVersion 31 + 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..c73ec18 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..685204c --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/example/car_customer_app/MainActivity.kt b/android/app/src/main/kotlin/com/example/car_customer_app/MainActivity.kt new file mode 100644 index 0000000..9860bc3 --- /dev/null +++ b/android/app/src/main/kotlin/com/example/car_customer_app/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.car_customer_app + +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..449a9f9 --- /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..d74aa35 --- /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..c73ec18 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..09fbd64 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,29 @@ +buildscript { + ext.kotlin_version = '1.6.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" + 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..bc6a58a --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-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/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..8d4492f --- /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 + 9.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..899dfbb --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,539 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + 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 */; }; + F385BE1E015F5F197DDC457E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9CA04DE821BC910C56C29F5B /* Pods_Runner.framework */; }; +/* 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 = ""; }; + 3643750A79F4A25346F39B6F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4F0574D3DCBBF0F35A33896D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; 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 = ""; }; + 9CA04DE821BC910C56C29F5B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C74C73D850C4D4FC94940060 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F385BE1E015F5F197DDC457E /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 83F33F395D7AA87F2A896F35 /* Pods */ = { + isa = PBXGroup; + children = ( + 4F0574D3DCBBF0F35A33896D /* Pods-Runner.debug.xcconfig */, + C74C73D850C4D4FC94940060 /* Pods-Runner.release.xcconfig */, + 3643750A79F4A25346F39B6F /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 96061B8FD0BBF121A96FFCF3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 9CA04DE821BC910C56C29F5B /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 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 */, + 83F33F395D7AA87F2A896F35 /* Pods */, + 96061B8FD0BBF121A96FFCF3 /* Frameworks */, + ); + 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 = ( + F3B998BE4409F6FFB76727BB /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 9A2045E27F192C87BCD2FA50 /* [CP] Embed Pods Frameworks */, + ); + 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 = 1020; + 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; + 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; + 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"; + }; + 9A2045E27F192C87BCD2FA50 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + F3B998BE4409F6FFB76727BB /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* 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 = 9.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.carCustomerApp; + 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 = 9.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 = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + 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.carCustomerApp; + 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.carCustomerApp; + 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..a28140c --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + 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..28c6bf0 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..2ccbfd9 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..f091b6b 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..4cde121 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..d0ef06e 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..dcdc230 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..2ccbfd9 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..c8f9ed8 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..a6d6b86 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..a6d6b86 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..75b2d16 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..c4df70d 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..6a84f41 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..d0e1f58 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..f242d7a --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + car_customer_app + 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 + + + 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/lib/config/customer_dependencies.dart b/lib/config/customer_dependencies.dart new file mode 100644 index 0000000..53792ef --- /dev/null +++ b/lib/config/customer_dependencies.dart @@ -0,0 +1,8 @@ +import 'package:mc_common_app/config/dependencies.dart'; + +class CustomerDependencies { + static void addDependencies() { + AppDependencies.addDependencies(); + + } +} diff --git a/lib/config/customer_routes.dart b/lib/config/customer_routes.dart new file mode 100644 index 0000000..3345264 --- /dev/null +++ b/lib/config/customer_routes.dart @@ -0,0 +1,23 @@ +import 'package:car_customer_app/views/appointments/appointment_detail_view.dart'; +import 'package:car_customer_app/views/appointments/book_appointment_services_view.dart'; +import 'package:car_customer_app/views/appointments/pick_items_view.dart'; +import 'package:car_customer_app/views/dashboard/dashboard_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart'; +import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart'; +import 'package:mc_common_app/views/advertisement/ads_detail_view.dart'; +import 'package:mc_common_app/views/advertisement/create_ad_view.dart'; +import 'package:mc_common_app/views/payments/payment_methods_view.dart'; + +class CustomerAppRoutes { + static final Map routes = { + AppRoutes.dashboard: (context) => DashboardPage(), + AppRoutes.bookProviderAppView: (context) => BookProviderAppView(), + AppRoutes.appointmentDetailView: (context) => AppointmentDetailView(appointmentListModel: ModalRoute.of(context)!.settings.arguments as AppointmentListModel), + AppRoutes.adsDetailView: (context) => AdsDetailView(adDetails: ModalRoute.of(context)!.settings.arguments as AdDetailsModel), + AppRoutes.createAdView: (context) => CreateAdView(), + AppRoutes.bookAppointmenServicesView: (context) => BookAppointmentServicesView(), + AppRoutes.paymentMethodsView: (context) => PaymentMethodsView(), + }; +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..f518977 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,109 @@ +import 'package:car_customer_app/config/customer_dependencies.dart'; +import 'package:car_customer_app/config/customer_routes.dart'; +import 'package:car_customer_app/view_models/appointments_view_model.dart'; +import 'package:car_customer_app/view_models/dashboard_view_model.dart'; +import 'package:car_customer_app/view_models/providers_view_model.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/app_state.dart'; +import 'package:mc_common_app/config/dependencies.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/models/post_params_model.dart'; +import 'package:mc_common_app/repositories/ads_repo.dart'; +import 'package:mc_common_app/repositories/common_repo.dart'; +import 'package:mc_common_app/repositories/payments_repo.dart'; +import 'package:mc_common_app/repositories/user_repo.dart'; +import 'package:mc_common_app/services/common_services.dart'; +import 'package:mc_common_app/services/payments_service.dart'; +import 'package:mc_common_app/theme/app_theme.dart'; +import 'package:mc_common_app/utils/enums.dart'; +import 'package:mc_common_app/view_models/ad_view_model.dart'; +import 'package:mc_common_app/view_models/base_view_model.dart'; +import 'package:mc_common_app/view_models/payment_view_model.dart'; +import 'package:mc_common_app/view_models/user_view_model.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:provider/provider.dart'; +import 'package:provider/single_child_widget.dart'; +import 'package:sizer/sizer.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + CustomerDependencies.addDependencies(); + await EasyLocalization.ensureInitialized(); + CustomerAppRoutes.routes.addAll(AppRoutes.routes); + + runApp( + MultiProvider( + providers: [ + ChangeNotifierProvider(create: (_) => BaseVM()), + ChangeNotifierProvider( + create: (_) => DashboardVM( + commonServices: injector.get(), + userRepo: injector.get(), + ), + ), + ChangeNotifierProvider( + create: (_) => UserVM(userRepo: injector.get()), + ), + ChangeNotifierProvider( + create: (_) => AdVM( + commonServices: injector.get(), + commonRepo: injector.get(), + adsRepo: injector.get(), + ), + ), + ChangeNotifierProvider( + create: (_) => ProvidersVM( + commonServices: injector.get(), + commonRepo: injector.get(), + ), + ), + ChangeNotifierProvider( + create: (_) => AppointmentsVM( + commonServices: injector.get(), + commonRepo: injector.get(), + ), + ), + ChangeNotifierProvider( + create: (_) => PaymentVM(paymentService: injector.get(), paymentRepo: injector.get()), + ), + ], + child: const MyApp(), + ).setupLocale(), + ); +} + +// todo terminal command to generate translation files +// flutter pub run easy_localization:generate --source-dir ./assets/langs +// todo terminal command to generate translation keys +// flutter pub run easy_localization:generate --source-dir ./assets/langs -f keys -o locale_keys.g.dart +// command to generate languages data from json + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Sizer( + builder: (context, orientation, deviceType) { + injector.get().setAppType(AppType.customer); + AppState().setPostParamsModel( + PostParamsModel( + languageID: EasyLocalization.of(context)?.locale.languageCode == "ar" ? 1 : 2, + ), + ); + return MaterialApp( + theme: AppTheme.getTheme( + isArabic: EasyLocalization.of(context)?.locale.languageCode == "ar", + ), + debugShowCheckedModeBanner: false, + localizationsDelegates: context.localizationDelegates, + supportedLocales: context.supportedLocales, + locale: context.locale, + initialRoute: AppRoutes.initialRoute, + routes: CustomerAppRoutes.routes, + ); + }, + ); + } +} diff --git a/lib/view_models/appointments_view_model.dart b/lib/view_models/appointments_view_model.dart new file mode 100644 index 0000000..2fb9aa2 --- /dev/null +++ b/lib/view_models/appointments_view_model.dart @@ -0,0 +1,102 @@ +import 'package:flutter/cupertino.dart'; +import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart'; +import 'package:mc_common_app/models/provider_category_model.dart'; +import 'package:mc_common_app/models/provider_service_model.dart'; +import 'package:mc_common_app/models/widgets_models.dart'; +import 'package:mc_common_app/repositories/common_repo.dart'; +import 'package:mc_common_app/services/common_services.dart'; + +class AppointmentsVM extends ChangeNotifier { + final CommonRepo commonRepo; + final CommonAppServices commonServices; + + AppointmentsVM({required this.commonServices, required this.commonRepo}); + + bool isFetchingLists = false; + + List myAppointments = []; + List appointmentsFilterOptions = []; + + bool isFetchingServices = false; + + List providerCategories = []; + + bool isHomeTapped = false; + + void updateIsHomeTapped(bool value) { + isHomeTapped = value; + notifyListeners(); + } + + String pickedHomeLocation = ""; + + void updatePickedHomeLocation(String value) { + pickedHomeLocation = value; + notifyListeners(); + } + + SelectionModel providerCategoryId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); + + void updateProviderCategoryId(SelectionModel id) async { + providerCategoryId = id; + await getProviderServices(id.selectedId); + notifyListeners(); + } + + List providerServices = []; + + SelectionModel providerServiceId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); + + void updateProviderServiceId(SelectionModel id) async { + providerServiceId = id; + notifyListeners(); + } + + void getProviderCategories() async { + notifyListeners(); + providerCategories = await commonRepo.getProviderServiceCategories(); + notifyListeners(); + } + + getProviderServices(int categoryId) async { + providerServiceId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); + isHomeTapped = false; + pickedHomeLocation = ""; + if (categoryId != -1) { + isFetchingServices = true; + notifyListeners(); + providerServices = await commonRepo.getProviderServices(categoryId: categoryId); + isFetchingServices = false; + + notifyListeners(); + } + } + + populateAppointmentsFilterList() { + appointmentsFilterOptions.clear(); + appointmentsFilterOptions = [ + FilterListModel(title: "All Appointments", isSelected: true, id: -1), + FilterListModel(title: "Booked", isSelected: false, id: 1), + FilterListModel(title: "Confirmed", isSelected: false, id: 2), + FilterListModel(title: "Arrived", isSelected: false, id: 3), + FilterListModel(title: "Cancelled", isSelected: false, id: 4), + ]; + notifyListeners(); + } + + applyFilterOnAppointmentsVM({required int index}) { + if (appointmentsFilterOptions.isEmpty) return; + for (var value in appointmentsFilterOptions) { + value.isSelected = false; + } + appointmentsFilterOptions[index].isSelected = true; + notifyListeners(); + } + + Future getMyAppointments() async { + isFetchingLists = true; + myAppointments = await commonRepo.getMyAppointments(); + isFetchingLists = false; + notifyListeners(); + } +} diff --git a/lib/view_models/dashboard_view_model.dart b/lib/view_models/dashboard_view_model.dart new file mode 100644 index 0000000..21dca0b --- /dev/null +++ b/lib/view_models/dashboard_view_model.dart @@ -0,0 +1,55 @@ +import 'dart:io'; +import 'package:mc_common_app/classes/app_state.dart'; +import 'package:mc_common_app/generated/locale_keys.g.dart'; +import 'package:mc_common_app/models/user/image_response.dart'; +import 'package:mc_common_app/repositories/user_repo.dart'; +import 'package:mc_common_app/services/common_services.dart'; +import 'package:mc_common_app/utils/utils.dart'; +import 'package:mc_common_app/view_models/base_view_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:easy_localization/easy_localization.dart'; + +class DashboardVM extends BaseVM { + final CommonAppServices commonServices; + final UserRepo userRepo; + + DashboardVM({required this.commonServices, required this.userRepo}); + + String pickedImage = ""; + + int selectedNavbarBarIndex = 2; + + void onNavbarTapped(int index) { + selectedNavbarBarIndex = index; + notifyListeners(); + } + + void pickImageFromPhone(BuildContext context, int sourceFlag) async { + final File? pickedImageFile = await commonServices.pickImageFromPhone(sourceFlag); + if (pickedImageFile == null) { + return; + } + int sizeInBytes = pickedImageFile.lengthSync(); + if (sizeInBytes > 1000) { + Utils.showToast(LocaleKeys.fileLarger.tr()); + return; + } else { + String image64 = Utils.convertFileToBase64(pickedImageFile); + + Utils.showLoading(context); + ImageResponse response = await userRepo.updateUserImage(image64); + Utils.hideLoading(context); + Navigator.pop(context); + if (response.messageStatus == 1) { + Utils.showToast(LocaleKeys.imageUploaded.tr()); + AppState().getUser.data!.userInfo!.userImageUrl = response.data; + } else { + Utils.showToast(response.message ?? ""); + } + } + } + + Future updateUserImage(String image) async { + return await userRepo.updateUserImage(image); + } +} diff --git a/lib/view_models/providers_view_model.dart b/lib/view_models/providers_view_model.dart new file mode 100644 index 0000000..bc65880 --- /dev/null +++ b/lib/view_models/providers_view_model.dart @@ -0,0 +1,35 @@ +import 'package:flutter/cupertino.dart'; +import 'package:mc_common_app/models/widgets_models.dart'; +import 'package:mc_common_app/repositories/common_repo.dart'; +import 'package:mc_common_app/services/common_services.dart'; + +class ProvidersVM extends ChangeNotifier { + final CommonRepo commonRepo; + final CommonAppServices commonServices; + + ProvidersVM({required this.commonServices, required this.commonRepo}); + + List providersFilterOptions = []; + + populateProvidersFilterList() { + providersFilterOptions.clear(); + providersFilterOptions = [ + FilterListModel(title: "All Providers", isSelected: true, id: -1), + FilterListModel(title: "Maintenance", isSelected: false, id: 0), + FilterListModel(title: "Oil Service", isSelected: false, id: 1), + FilterListModel(title: "Accessories", isSelected: false, id: 2), + FilterListModel(title: "Tire Service", isSelected: false, id: 3), + FilterListModel(title: "Dent and Paint", isSelected: false, id: 4), + ]; + notifyListeners(); + } + + applyFilterOnProviders({required int index}) { + if (providersFilterOptions.isEmpty) return; + for (var value in providersFilterOptions) { + value.isSelected = false; + } + providersFilterOptions[index].isSelected = true; + notifyListeners(); + } +} diff --git a/lib/views/appointments/appointment_detail_view.dart b/lib/views/appointments/appointment_detail_view.dart new file mode 100644 index 0000000..86e2dec --- /dev/null +++ b/lib/views/appointments/appointment_detail_view.dart @@ -0,0 +1,128 @@ +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/widgets/button/show_fill_button.dart'; +import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; +import 'package:mc_common_app/widgets/common_widgets/card_button_with_icon.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; + +class AppointmentDetailView extends StatelessWidget { + AppointmentListModel appointmentListModel; + + AppointmentDetailView({Key? key, required this.appointmentListModel}) : super(key: key); + + final List servicesList = [ + "Mechanic", + "Electrician", + " Car Denting", + "Oil Change", + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: CustomAppBar( + title: "Appointment", + profileImageUrl: MyAssets.bnCar, + isRemoveBackButton: false, + isDrawerEnabled: false, + ), + body: Container( + padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21), + child: Stack( + children: [ + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + appointmentListModel.providerName!.toText(fontSize: 18, isBold: true), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + MyAssets.miniClockDark.buildSvg( + height: 10, + width: 10, + fit: BoxFit.fill, + ), + 10.width, + "${appointmentListModel.duration ?? ""} ${appointmentListModel.appointmentDate!.toFormattedDateWithoutTime()}".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor), + ], + ), + 13.height, + Row( + children: [ + MyAssets.maintenanceIcon.buildSvg( + height: 10, + width: 10, + fit: BoxFit.fill, + ), + 10.width, + "Maintenance".toText(fontSize: 18, isBold: true), + ], + ), + Column( + children: servicesList + .map((e) => e + .toText( + textAlign: TextAlign.start, + fontSize: 13, + isBold: true, + color: MyColors.lightTextColor, + ) + .paddingOnly(bottom: 5)) + .toList(), + ).paddingOnly(left: 15), + 15.height, + Row( + children: [ + CardButtonWithIcon( + title: "Reschedule Appointment", + onCardTapped: () {}, + icon: MyAssets.scheduleAppointmentIcon.buildSvg(), + ), + 10.width, + CardButtonWithIcon( + title: "Pay for Appointment", + onCardTapped: () {}, + icon: MyAssets.creditCardIcon.buildSvg(), + ), + ], + ), + 15.height, + ], + ).toWhiteContainer(width: double.infinity, allPading: 12), + Align( + alignment: Alignment.bottomCenter, + child: Row( + children: [ + Expanded( + child: ShowFillButton( + maxHeight: 55, + title: "Cancel", + onPressed: () {}, + backgroundColor: MyColors.redColor, + ), + ), + if (appointmentListModel.appointmentStatusID == 1) ...[ + 12.width, + Expanded( + child: ShowFillButton( + maxHeight: 55, + title: "Confirm", + onPressed: () {}, + backgroundColor: MyColors.greenColor, + ), + ), + ], + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/views/appointments/book_appointment_services_view.dart b/lib/views/appointments/book_appointment_services_view.dart new file mode 100644 index 0000000..71f4bb3 --- /dev/null +++ b/lib/views/appointments/book_appointment_services_view.dart @@ -0,0 +1,325 @@ +import 'package:car_customer_app/view_models/appointments_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/models/widgets_models.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/views/advertisement/custom_add_button.dart'; +import 'package:mc_common_app/widgets/button/show_fill_button.dart'; +import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; +import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:mc_common_app/widgets/txt_field.dart'; +import 'package:provider/provider.dart'; + +class BookAppointmentServicesView extends StatelessWidget { + const BookAppointmentServicesView({Key? key}) : super(key: key); + + void openTheAddServiceBottomSheet(BuildContext context) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + enableDrag: true, + builder: (BuildContext context) { + AppointmentsVM appointmentsVM = context.watch(); + return SizedBox( + height: MediaQuery.of(context).size.height * 0.85, + child: Column( + children: [ + Container( + margin: const EdgeInsets.all(8), + height: 8, + width: 60, + decoration: const BoxDecoration(color: MyColors.lightTextColor, borderRadius: BorderRadius.all(Radius.circular(20))), + ), + 12.height, + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + "Select Category".toText(fontSize: 24, isBold: true), + ], + ), + 30.height, + Expanded( + child: ListView( + children: [ + Builder( + builder: (context) { + List serviceCategories = []; + for (var element in appointmentsVM.providerCategories) { + if (!element.isSelected!) { + serviceCategories.add(DropValue(element.id?.toInt() ?? 0, element.categoryName ?? "", "")); + } + } + return DropdownField( + (DropValue value) => appointmentsVM.updateProviderCategoryId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)), + list: serviceCategories, + hint: "Select Category", + dropdownValue: appointmentsVM.providerCategoryId.selectedId != -1 + ? DropValue(appointmentsVM.providerCategoryId.selectedId, appointmentsVM.providerCategoryId.selectedOption, "") + : null, + ); + }, + ), + if (appointmentsVM.isFetchingServices) ...[ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [const CircularProgressIndicator().paddingAll(10)], + ), + ] else if (appointmentsVM.providerServices.isNotEmpty) ...[ + 8.height, + Builder( + builder: (context) { + List serviceCategories = []; + for (var element in appointmentsVM.providerServices) { + if (!element.isSelected!) { + serviceCategories.add(DropValue(element.id?.toInt() ?? 0, element.id.toString(), "")); + } + } + return DropdownField( + (DropValue value) => appointmentsVM.updateProviderServiceId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)), + list: serviceCategories, + hint: "Select Services", + dropdownValue: appointmentsVM.providerServiceId.selectedId != -1 + ? DropValue(appointmentsVM.providerServiceId.selectedId, appointmentsVM.providerServiceId.selectedOption, "") + : null, + ); + }, + ), + ], + if (appointmentsVM.providerServiceId.selectedId != -1 && !appointmentsVM.isFetchingServices) ...[ + 16.height, + Row( + children: [ + "Select Service Location".toText( + fontSize: 16, + isBold: true, + color: MyColors.black, + ), + ], + ), + 8.height, + Row( + children: [ + Expanded( + child: ShowFillButton( + isFilled: appointmentsVM.isHomeTapped, + maxHeight: 48, + title: "Home", + txtColor: appointmentsVM.isHomeTapped ? MyColors.white : MyColors.darkTextColor, + onPressed: () => appointmentsVM.updateIsHomeTapped(true), + ), + ), + 12.width, + Expanded( + child: ShowFillButton( + isFilled: !appointmentsVM.isHomeTapped, + txtColor: !appointmentsVM.isHomeTapped ? MyColors.white : MyColors.darkTextColor, + maxHeight: 48, + title: "Workshop", + onPressed: () => appointmentsVM.updateIsHomeTapped(false), + ), + ), + ], + ), + if (appointmentsVM.isHomeTapped) ...[ + 8.height, + TxtField( + hint: 'Pick Home Location', + value: appointmentsVM.pickedHomeLocation, + isNeedClickAll: true, + postfixData: Icons.location_on, + postFixDataColor: MyColors.darkTextColor, + onTap: () { + //TODO: open the place picked to pick the location and save it in provider. + appointmentsVM.updatePickedHomeLocation("PM58+F97, Al Olaya, Riyadh 12333"); + }, + ), + 14.height, + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Icon( + Icons.warning, + color: MyColors.adPendingStatusColor, + size: 19, + ).paddingOnly(bottom: 2), + 3.width, + "Some services are not available on home location.".toText( + color: MyColors.adPendingStatusColor, + fontSize: 12, + isItalic: true, + ), + ], + ), + ] + ], + ], + ), + ), + SizedBox( + width: double.infinity, + child: Column( + children: [ + if (appointmentsVM.isHomeTapped && !appointmentsVM.isFetchingServices) ...[ + const Divider(thickness: 1, height: 1), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + // TODO: This Price will be decided according to the service selected + 150.toString().toText(fontSize: 30, isBold: true), + "SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5), + ], + ), + "These charges are additional to the actual service charges. For heavy items the charges may vary.".toText(fontSize: 12, color: MyColors.lightTextColor), + 22.height, + ], + SizedBox( + width: double.infinity, + child: ShowFillButton( + maxHeight: 55, + title: "Next", + onPressed: () {}, + ), + ), + ], + ), + ).paddingOnly(bottom: 20) + ], + )).horPaddingMain(); + }, + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: CustomAppBar( + title: "Book Appointment", + isRemoveBackButton: false, + isDrawerEnabled: false, + actions: [MyAssets.searchIcon.buildSvg().paddingOnly(right: 21)], + onBackButtonTapped: () => Navigator.pop(context), + ), + body: Consumer( + builder: (BuildContext context, AppointmentsVM appointmentsVM, Widget? child) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 21.height, + CustomAddButton( + onTap: () => {openTheAddServiceBottomSheet(context)}, + text: "Add Services", + icon: Container( + height: 24, + width: 24, + decoration: const BoxDecoration(shape: BoxShape.circle, color: MyColors.darkTextColor), + child: const Icon(Icons.add, color: MyColors.white), + ), + ), + // 20.height, + // ListView.builder( + // physics: const NeverScrollableScrollPhysics(), + // shrinkWrap: true, + // itemCount: adVM.specialServiceCards.length, + // itemBuilder: (BuildContext context, int index) { + // SpecialServiceCard specialServicesCard = adVM.specialServiceCards[index]; + // return Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Column( + // children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Expanded( + // child: specialServicesCard.serviceSelectedId!.selectedOption.toText(fontSize: 16, isBold: true), + // ), + // Align( + // alignment: Alignment.topRight, + // child: MyAssets.closeWithOrangeBg.buildSvg( + // fit: BoxFit.fill, + // height: 30, + // width: 30, + // ), + // ).onPress(() => adVM.removeSpecialServiceCard(index)) + // ], + // ), + // Builder(builder: (context) { + // return Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // if (specialServicesCard.serviceSelectedId!.selectedId != 1 && specialServicesCard.serviceSelectedId!.selectedId != 3) ...[ + // // Row( + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // "Duration: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + // // (specialServicesCard.duration ?? "").toText(fontSize: 12, isBold: true).expand(), + // // ], + // // ), + // 8.height, + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // "Description: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + // (specialServicesCard.description ?? "").toText(fontSize: 12, isBold: true).expand(), + // ], + // ), + // ], + // if (specialServicesCard.serviceSelectedId!.selectedId == 1 || specialServicesCard.serviceSelectedId!.selectedId == 3) ...[ + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // const Icon( + // weight: 2, + // Icons.location_on_outlined, + // color: MyColors.primaryColor, + // size: 17, + // ), + // "${specialServicesCard.duration} km".toText(fontSize: 10, color: MyColors.primaryColor), + // ], + // ), + // 8.height, + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // "Branch Address: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + // (specialServicesCard.address ?? "").toText(fontSize: 12, isBold: true).expand(), + // ], + // ), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // "Appointment Time: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + // "${specialServicesCard.serviceDate} - ${specialServicesCard.serviceTime}".toText(fontSize: 12, isBold: true).expand(), + // ], + // ), + // ], + // 6.height, + // Row( + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // (specialServicesCard.serviceSelectedId!.itemPrice).toText(fontSize: 20, isBold: true), + // 2.width, + // "SAR".toText(color: MyColors.lightTextColor, fontSize: 14), + // ], + // ), + // ], + // ); + // }), + // 3.height, + // const Divider(thickness: 1.5) + // ], + // ), + // 10.height, + // ], + // ); + // }, + // ), + ], + ); + }, + ).horPaddingMain()); + } +} diff --git a/lib/views/appointments/pick_items_view.dart b/lib/views/appointments/pick_items_view.dart new file mode 100644 index 0000000..0a51fa6 --- /dev/null +++ b/lib/views/appointments/pick_items_view.dart @@ -0,0 +1,168 @@ +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/widgets/button/show_fill_button.dart'; +import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; +import 'package:mc_common_app/widgets/common_widgets/provider_details_card.dart'; +import 'package:mc_common_app/widgets/common_widgets/time_slots.dart'; +import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; + +class BookProviderAppView extends StatefulWidget { + const BookProviderAppView({Key? key}) : super(key: key); + + @override + State createState() => _BookProviderAppViewState(); +} + +class _BookProviderAppViewState extends State { + bool isReview = false; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: CustomAppBar( + title: "Appointment", + profileImageUrl: MyAssets.bnCar, + isRemoveBackButton: false, + isDrawerEnabled: false, + ), + body: Container( + color: MyColors.backgroundColor, + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + Expanded( + child: ListView( + children: [ + ProviderDetailsCard( + onCardTapped: () {}, + providerImageUrl: MyAssets.bnCar, + providerLocation: "3km", + providerName: "Al Ahmed Maintenance", + providerRatings: "4.9", + ), + 12.height, + isReview ? ReviewAppointmentSection() : ServicesSelectionSection(), + 10.height, + ], + ), + ), + 10.height, + Padding( + padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21), + child: ShowFillButton( + title: "Book Appointment", + maxWidth: double.infinity, + onPressed: () { + isReview = !isReview; + setState(() {}); + }, + ), + ), + ], + ), + ), + ); + } +} + +class ServicesSelectionSection extends StatelessWidget { + const ServicesSelectionSection({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + List dropList = [ + DropValue(0, "Maintenance", ""), + DropValue(1, "Car Wash", ""), + DropValue(2, "Monthly Checkup", ""), + DropValue(3, "Friendly Visit", ""), + DropValue(4, "Muftaa", ""), + ]; + return Container( + padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Select services you want".toText(fontSize: 18, isBold: true), + 8.height, + DropdownField( + (DropValue value) {}, + list: dropList, + hint: "Select service type", + ), + 8.height, + DropdownField( + (DropValue value) {}, + list: dropList, + hint: "Select service type", + ), + 8.height, + DropdownField( + (DropValue value) {}, + list: dropList, + hint: "Select service type", + ), + 22.height, + "Select date and time".toText(fontSize: 18, isBold: true), + 8.height, + DropdownField( + (DropValue value) {}, + list: dropList, + hint: "Select service type", + ), + 22.height, + "Available slots".toText(fontSize: 15, isBold: true), + 8.height, + BuildTimeSlots(onPressed: (index) {}, timeSlots: []), + 22.height, + "Total Amount".toText(fontSize: 18, isBold: true), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + "3000".toText(fontSize: 20, isBold: true), + "SAR".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor), + ], + ), + 10.height, + ], + ).toWhiteContainer(width: double.infinity, allPading: 12), + ); + } +} + +class ReviewAppointmentSection extends StatelessWidget { + const ReviewAppointmentSection({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.only(bottom: 10, left: 21, right: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Review Appointment".toText(fontSize: 18, isBold: true), + 15.height, + "Services".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), + "Car Engine Check".toText(fontSize: 18, isBold: true), + 13.height, + "Date and Time".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), + "2 Feb, 2023 at 09:00am".toText(fontSize: 18, isBold: true), + 13.height, + "Total Amount".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + "3000".toText(fontSize: 20, isBold: true), + "SAR".toText(fontSize: 10, isBold: true, color: MyColors.lightTextColor), + ], + ), + 100.height, + ], + ).toWhiteContainer(width: double.infinity, allPading: 12), + ); + } +} diff --git a/lib/views/appointments/widgets/customer_appointment_slider_widget.dart b/lib/views/appointments/widgets/customer_appointment_slider_widget.dart new file mode 100644 index 0000000..7cfb819 --- /dev/null +++ b/lib/views/appointments/widgets/customer_appointment_slider_widget.dart @@ -0,0 +1,199 @@ +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/navigator.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; + +class CustomerAppointmentSliderWidget extends StatelessWidget { + final List myUpComingAppointments; + + const CustomerAppointmentSliderWidget({Key? key, required this.myUpComingAppointments}) : super(key: key); + + @override + Widget build(BuildContext context) { + if (myUpComingAppointments.isEmpty) { + return InkWell( + child: Container( + height: 86, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 24, + width: 24, + decoration: BoxDecoration(shape: BoxShape.circle, color: MyColors.darkTextColor), + child: Icon( + Icons.add, + color: MyColors.white, + ), + ), + SizedBox(width: 10), + "Add New Appointment".toText( + fontSize: 15, + isBold: true, + color: MyColors.lightTextColor, + ), + ], + ), + ), + ).toWhiteContainer(width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 21, vertical: 10)); + } + return CarouselSlider.builder( + options: CarouselOptions( + height: 140, + viewportFraction: 1.0, + enlargeCenterPage: false, + enableInfiniteScroll: false, + ), + itemCount: myUpComingAppointments.length, + itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => BuildAppointmentContainerForCustomer( + isForHome: true, + appointmentListModel: myUpComingAppointments[itemIndex], + onTapped: () => navigateWithName(context, AppRoutes.appointmentDetailView, arguments: myUpComingAppointments[itemIndex]), + ), + ); + } +} + +class BuildAppointmentContainerForCustomer extends StatelessWidget { + final bool? isForHome; + final AppointmentListModel? appointmentListModel; + final Function() onTapped; + + const BuildAppointmentContainerForCustomer({Key? key, this.isForHome = false, required this.onTapped, required this.appointmentListModel}) : super(key: key); + + Widget showServices(String title, String icon, {bool isMoreText = false}) { + return Row( + children: [ + if (icon != "") ...[ + SvgPicture.asset(icon), + 8.width, + ], + Flexible( + child: title.toText( + fontSize: 12, + isBold: true, + color: isMoreText ? MyColors.primaryColor : MyColors.black, + ), + ), + ], + ); + } + + List buildServicesFromAppointment({required AppointmentListModel appointmentListModel}) { + if (appointmentListModel.serviceAppointmentItems == null || appointmentListModel.serviceAppointmentItems!.isEmpty) { + return [SizedBox()]; + } + + if (appointmentListModel.serviceAppointmentItems!.length == 1) { + return [ + showServices( + appointmentListModel.serviceAppointmentItems![0].serviceItemName!, + MyAssets.modificationsIcon, + ) + ]; + } + + List servicesList = List.generate( + 2, + (index) => showServices( + appointmentListModel.serviceAppointmentItems![index].serviceItemName!, + MyAssets.modificationsIcon, + ), + ); + + if (appointmentListModel.serviceAppointmentItems!.length > 1) { + servicesList.add( + showServices( + "+ ${appointmentListModel.serviceAppointmentItems!.length - 1} More", + "", + isMoreText: true, + ), + ); + } + return servicesList; + } + + @override + Widget build(BuildContext context) { + return Container( + margin: const EdgeInsets.only(bottom: 10, left: 21, right: 21), + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + isForHome != null && isForHome! + ? Image.asset( + MyAssets.bnCar, + width: 56, + height: 56, + fit: BoxFit.fill, + ).toCircle(borderRadius: 100) + : Image.asset( + MyAssets.bnCar, + width: 80, + height: 85, + fit: BoxFit.cover, + ), + 8.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + (appointmentListModel!.providerName ?? "").toText(color: MyColors.black, isBold: true, fontSize: 16), + Row( + children: [ + MyAssets.miniClock.buildSvg(height: 12), + 2.width, + "${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}".toText( + color: MyColors.lightTextColor, + fontSize: 12, + ), + ], + ), + 9.height, + isForHome != null && isForHome! + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + "Appointment Details".toText( + color: MyColors.primaryColor, + isUnderLine: true, + isBold: true, + fontSize: 14, + ), + const Icon(Icons.arrow_forward), + ], + ) + : Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Column( + children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!), + ), + ), + const Icon( + Icons.arrow_forward, + ), + ], + ), + ], + ), + ), + ], + ), + ], + ).onPress(onTapped).toWhiteContainer(width: double.infinity, allPading: 12), + ); + } +} diff --git a/lib/views/dashboard/dashboard_page.dart b/lib/views/dashboard/dashboard_page.dart new file mode 100644 index 0000000..921bea8 --- /dev/null +++ b/lib/views/dashboard/dashboard_page.dart @@ -0,0 +1,104 @@ +import 'dart:async'; + +import 'package:car_customer_app/view_models/appointments_view_model.dart'; +import 'package:car_customer_app/view_models/dashboard_view_model.dart'; +import 'package:car_customer_app/view_models/providers_view_model.dart'; +import 'package:car_customer_app/views/dashboard/fragments/ads_fragment.dart'; +import 'package:car_customer_app/views/dashboard/fragments/appointments_fragment.dart'; +import 'package:car_customer_app/views/dashboard/fragments/home_fragment.dart'; +import 'package:car_customer_app/views/dashboard/fragments/providers_fragment.dart'; +import 'package:car_customer_app/views/dashboard/fragments/settings_fragment.dart'; +import 'package:car_customer_app/views/dashboard/widgets/bottom_nav_bar.dart'; +import 'package:car_customer_app/views/dashboard/widgets/drawer_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/view_models/ad_view_model.dart'; +import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:provider/provider.dart'; + +class DashboardPage extends StatefulWidget { + const DashboardPage({Key? key}) : super(key: key); + + @override + State createState() => _DashboardPageState(); +} + +class _DashboardPageState extends State { + // late DashboardVM dashboardVM; + + @override + void initState() { + super.initState(); + // dashboardVM = Provider.of(context, listen: false); + fetchUsername(); + scheduleMicrotask(() { + context.read().populateAppointmentsFilterList(); + context.read().populateProvidersFilterList(); + context.read().populateAdsFilterList(); + _onRefresh(); + }); + } + + Future _onRefresh() async { + AdVM adVm = Provider.of(context, listen: false); + AppointmentsVM appointmentsVM = Provider.of(context, listen: false); + if (appointmentsVM.myAppointments.isEmpty) { + await appointmentsVM.getMyAppointments(); + } + if (adVm.myAds.isEmpty) { + await adVm.getMyAds(); + } + if (adVm.exploreAds.isEmpty) { + await adVm.getExploreAds(); + } + } + + fetchUsername() async {} + + List fragments = [ + const ProvidersFragment(), + const AppointmentsFragment(), + const HomeFragment(), + AdsFragment(), + const SettingsFragment(), + ]; + + String getPageTitle(int index) { + if (index == 0) { + return "Providers"; + } + if (index == 1) { + return "Appointments"; + } + if (index == 2) { + return ""; + } + if (index == 3) { + return "Ads"; + } + if (index == 4) { + return ""; + } + return ""; + } + + @override + Widget build(BuildContext context) { + bool isHomePage = context.watch().selectedNavbarBarIndex == 2; + return Scaffold( + appBar: CustomAppBar( + backgroundColor: null, + leadingWidth: 100, + title: getPageTitle(context.watch().selectedNavbarBarIndex), + profileImageUrl: MyAssets.bnCar, + isRemoveBackButton: true, + isDrawerEnabled: isHomePage ? true : false, + actions: [(isHomePage ? MyAssets.notificationsBellIcon : MyAssets.searchIcon).buildSvg().paddingOnly(right: 21)], + ), + drawer: CustomDrawer(dashboardVM: context.watch()), + bottomNavigationBar: CustomBottomNavbar(), + body: fragments[context.watch().selectedNavbarBarIndex], + ); + } +} diff --git a/lib/views/dashboard/fragments/ads_fragment.dart b/lib/views/dashboard/fragments/ads_fragment.dart new file mode 100644 index 0000000..d13952c --- /dev/null +++ b/lib/views/dashboard/fragments/ads_fragment.dart @@ -0,0 +1,118 @@ +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/app_state.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/navigator.dart'; +import 'package:mc_common_app/view_models/ad_view_model.dart'; +import 'package:mc_common_app/views/advertisement/ads_list.dart'; +import 'package:mc_common_app/widgets/button/show_fill_button.dart'; +import 'package:mc_common_app/widgets/common_widgets/categories_list.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:provider/provider.dart'; + +class AdsFragment extends StatelessWidget { + AdsFragment({Key? key}) : super(key: key); + + Future onRefreshAds(BuildContext context) async { + AdVM adVM = context.read(); + await adVM.getExploreAds(); + await adVM.getMyAds(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + color: MyColors.backgroundColor, + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + 16.height, + Consumer( + builder: (BuildContext context, AdVM adVM, Widget? child) { + return Column( + children: [ + Row( + children: [ + Expanded( + child: ShowFillButton( + isFilled: adVM.isExploreAdsTapped, + maxHeight: 55, + title: "Explore Ads", + txtColor: adVM.isExploreAdsTapped ? MyColors.white : MyColors.darkTextColor, + onPressed: () { + print("ads: ${AppState().getUser.data!.accessToken}"); + adVM.updateIsExploreAds(true); + }, + ), + ), + 12.width, + Expanded( + child: ShowFillButton( + isFilled: !adVM.isExploreAdsTapped, + txtColor: !adVM.isExploreAdsTapped ? MyColors.white : MyColors.darkTextColor, + maxHeight: 55, + title: "My Ads", + onPressed: () { + adVM.updateIsExploreAds(false); + }, + ), + ), + ], + ).horPaddingMain(), + if (adVM.isExploreAdsTapped && adVM.exploreAds.isNotEmpty) ...[ + 16.height, + FiltersList(filterList: adVM.exploreAdsFilterOptions, onFilterTapped: (index, selectedFilterId) => adVM.applyFilterOnExploreAds(index: index), needLeftPadding: false) + .paddingOnly(left: 21), + ], + if (!adVM.isExploreAdsTapped && adVM.myAds.isNotEmpty) ...[ + 16.height, + FiltersList( + filterList: adVM.myAdsFilterOptions, + onFilterTapped: (index, selectedFilterId) => adVM.applyFilterOnMyAds(index: index, selectedFilterId: selectedFilterId), + needLeftPadding: false) + .paddingOnly(left: 21), + ], + ], + ); + }, + ), + 16.height, + Expanded( + child: RefreshIndicator( + onRefresh: () => onRefreshAds(context), + child: Consumer( + builder: (BuildContext context, AdVM adVM, Widget? child) { + return BuildAdsList( + isAdsFragment: true, + shouldShowAdStatus: !adVM.isExploreAdsTapped, + adsList: adVM.isExploreAdsTapped && adVM.exploreAdsFilteredList.isNotEmpty + ? adVM.exploreAdsFilteredList + : !adVM.isExploreAdsTapped && adVM.myAdsFilteredList.isNotEmpty + ? adVM.myAdsFilteredList + : [], + ); + }, + ), + ), + ) + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + context.read().getVehicleTypes(); + + navigateWithName(context, AppRoutes.createAdView); + }, + backgroundColor: MyColors.darkPrimaryColor, + child: Icon( + Icons.add, + color: MyColors.white, + ), + ), + ); + } +} diff --git a/lib/views/dashboard/fragments/appointments_fragment.dart b/lib/views/dashboard/fragments/appointments_fragment.dart new file mode 100644 index 0000000..137ae1e --- /dev/null +++ b/lib/views/dashboard/fragments/appointments_fragment.dart @@ -0,0 +1,56 @@ +import 'package:car_customer_app/view_models/appointments_view_model.dart'; +import 'package:car_customer_app/views/appointments/widgets/customer_appointment_slider_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/navigator.dart'; +import 'package:mc_common_app/widgets/common_widgets/categories_list.dart'; +import 'package:provider/provider.dart'; + +class AppointmentsFragment extends StatelessWidget { + const AppointmentsFragment({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + color: MyColors.backgroundColor, + width: double.infinity, + height: double.infinity, + child: Consumer( + builder: (BuildContext context, AppointmentsVM appointmentsVM, Widget? child) { + return Column( + children: [ + 16.height, + FiltersList( + filterList: appointmentsVM.appointmentsFilterOptions, + onFilterTapped: (index, selectedFilterId) => appointmentsVM.applyFilterOnAppointmentsVM(index: index), + ), + 16.height, + Expanded( + child: appointmentsVM.myAppointments.isEmpty + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + "No Appointments to show.".toText(fontSize: 16, color: MyColors.lightTextColor), + ], + ) + : ListView.builder( + shrinkWrap: true, + itemCount: appointmentsVM.myAppointments.length, + itemBuilder: (BuildContext context, int index) { + return BuildAppointmentContainerForCustomer( + onTapped: () => navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentsVM.myAppointments[index]), + appointmentListModel: appointmentsVM.myAppointments[index], + ); + }, + ), + ), + ], + ); + }, + ), + ); + } +} diff --git a/lib/views/dashboard/fragments/home_fragment.dart b/lib/views/dashboard/fragments/home_fragment.dart new file mode 100644 index 0000000..c7c4d6b --- /dev/null +++ b/lib/views/dashboard/fragments/home_fragment.dart @@ -0,0 +1,106 @@ +import 'package:car_customer_app/view_models/appointments_view_model.dart'; +import 'package:car_customer_app/view_models/dashboard_view_model.dart'; +import 'package:car_customer_app/view_models/providers_view_model.dart'; +import 'package:car_customer_app/views/appointments/widgets/customer_appointment_slider_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/app_state.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/view_models/ad_view_model.dart'; +import 'package:mc_common_app/views/advertisement/ads_list.dart'; +import 'package:mc_common_app/widgets/common_widgets/my_service_provider.dart'; +import 'package:mc_common_app/widgets/common_widgets/view_all_widget.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:provider/provider.dart'; + +class HomeFragment extends StatelessWidget { + const HomeFragment({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: double.infinity, + height: double.infinity, + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.only(top: 8), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + 16.height, + ViewAllWidget( + title: "Upcoming Appointment".toUpperCase(), + subTitle: "View All", + onSubtitleTapped: () { + context.read().onNavbarTapped(1); + context.read().applyFilterOnAppointmentsVM(index: 0); + }, + ).horPaddingMain(), + CustomerAppointmentSliderWidget(myUpComingAppointments: context.watch().myAppointments), + 7.height, + ViewAllWidget( + title: "My Recent Service Providers".toUpperCase(), + subTitle: "View All", + onSubtitleTapped: () { + print("value: ${AppState().getUser.data!.accessToken}"); + context.read().onNavbarTapped(0); + context.read().applyFilterOnProviders(index: 0); + }).horPaddingMain(), + const ServiceProviderWidget().horPaddingMain(), + Consumer( + builder: (BuildContext context, AdVM adVM, Widget? child) { + return Column( + children: [ + if (adVM.myActiveAdsForHome.isNotEmpty) ...[ + Column( + children: [ + 15.height, + ViewAllWidget( + title: "My Active Ads".toUpperCase(), + subTitle: "View All", + onSubtitleTapped: () { + context.read().onNavbarTapped(3); + context.read().updateIsExploreAds(false); + }).horPaddingMain(), + BuildAdsList( + shouldShowAdStatus: true, + isAdsFragment: false, + adsList: adVM.myActiveAdsForHome, + scrollPhysics: NeverScrollableScrollPhysics(), + ), + ], + ) + ], + if (adVM.exploreAds.isNotEmpty) ...[ + Column( + children: [ + 15.height, + ViewAllWidget( + title: "My Recommended Ads".toUpperCase(), + subTitle: "View All", + onSubtitleTapped: () { + context.read().onNavbarTapped(3); + context.read().updateIsExploreAds(true); + context.read().applyFilterOnExploreAds(index: 0); + }, + ).horPaddingMain(), + BuildAdsList( + shouldShowAdStatus: false, + adsList: adVM.exploreAds.length >= 3 ? adVM.exploreAds.take(3).toList() : adVM.exploreAds, + isAdsFragment: false, + scrollPhysics: NeverScrollableScrollPhysics(), + ), + ], + ) + ] + ], + ); + }, + ), + 20.height, + ], + ), + ), + ), + ); + } +} diff --git a/lib/views/dashboard/fragments/providers_fragment.dart b/lib/views/dashboard/fragments/providers_fragment.dart new file mode 100644 index 0000000..235874b --- /dev/null +++ b/lib/views/dashboard/fragments/providers_fragment.dart @@ -0,0 +1,60 @@ +import 'package:car_customer_app/view_models/appointments_view_model.dart'; +import 'package:car_customer_app/view_models/providers_view_model.dart'; +import 'package:flutter/material.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/navigator.dart'; +import 'package:mc_common_app/widgets/common_widgets/categories_list.dart'; +import 'package:mc_common_app/widgets/common_widgets/provider_details_card.dart'; +import 'package:provider/provider.dart'; + +class ProvidersFragment extends StatelessWidget { + const ProvidersFragment({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + color: MyColors.backgroundColor, + width: double.infinity, + height: double.infinity, + child: Consumer( + builder: (BuildContext context, ProvidersVM providersVM, Widget? child) { + return Column( + children: [ + 16.height, + FiltersList( + filterList: providersVM.providersFilterOptions, + onFilterTapped: (index, selectedFilterId) => providersVM.applyFilterOnProviders(index: index), + ), + 16.height, + Expanded( + child: Container( + child: ListView.builder( + shrinkWrap: true, + itemCount: 30, + itemBuilder: (BuildContext context, int index) { + return ProviderDetailsCard( + onCardTapped: () { + if (context.read().providerCategories.isEmpty) { + context.read().getProviderCategories(); + } + navigateWithName(context, AppRoutes.bookAppointmenServicesView); + }, + providerImageUrl: MyAssets.bnCar, + providerLocation: " 3km", + providerName: "Al Ahmed Maintenance", + providerRatings: "4.9", + ); + }, + ), + ), + ), + ], + ); + }, + ), + ); + } +} diff --git a/lib/views/dashboard/fragments/settings_fragment.dart b/lib/views/dashboard/fragments/settings_fragment.dart new file mode 100644 index 0000000..b5a47cf --- /dev/null +++ b/lib/views/dashboard/fragments/settings_fragment.dart @@ -0,0 +1,10 @@ +import 'package:flutter/material.dart'; + +class SettingsFragment extends StatelessWidget { + const SettingsFragment({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/views/dashboard/widgets/bottom_nav_bar.dart b/lib/views/dashboard/widgets/bottom_nav_bar.dart new file mode 100644 index 0000000..b8ea535 --- /dev/null +++ b/lib/views/dashboard/widgets/bottom_nav_bar.dart @@ -0,0 +1,61 @@ +import 'package:car_customer_app/view_models/dashboard_view_model.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/generated/locale_keys.g.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:provider/provider.dart'; + +class CustomBottomNavbar extends StatelessWidget { + const CustomBottomNavbar({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + DashboardVM dashboardVM = context.watch(); + return BottomNavigationBar( + items: [ + BottomNavigationBarItem( + icon: SvgPicture.asset(MyAssets.providersIcon).paddingAll(5), + activeIcon: SvgPicture.asset(MyAssets.providersIcon, color: MyColors.darkIconColor).paddingAll(5), + label: LocaleKeys.providers.tr(), + ), + BottomNavigationBarItem( + icon: SvgPicture.asset(MyAssets.appointmentsIcon).paddingAll(5), + activeIcon: SvgPicture.asset(MyAssets.appointmentsIcon, color: MyColors.darkIconColor).paddingAll(5), + label: LocaleKeys.appointments.tr(), + ), + BottomNavigationBarItem( + icon: SvgPicture.asset( + MyAssets.homeIcon, + color: MyColors.lightIconColor, + ).paddingAll(5), + activeIcon: SvgPicture.asset(MyAssets.homeIcon, color: MyColors.darkIconColor).paddingAll(5), + label: LocaleKeys.home.tr(), + ), + BottomNavigationBarItem( + icon: SvgPicture.asset(MyAssets.announcementIcon).paddingAll(5), + activeIcon: SvgPicture.asset(MyAssets.announcementIcon, color: MyColors.darkIconColor).paddingAll(5), + label: LocaleKeys.ads.tr(), + ), + BottomNavigationBarItem( + icon: SvgPicture.asset(MyAssets.settingsIcon).paddingAll(5), + activeIcon: SvgPicture.asset(MyAssets.settingsIcon, color: MyColors.darkIconColor).paddingAll(5), + label: LocaleKeys.settings.tr(), + ), + ], + currentIndex: dashboardVM.selectedNavbarBarIndex, + type: BottomNavigationBarType.fixed, + selectedItemColor: MyColors.darkIconColor, + showSelectedLabels: true, + showUnselectedLabels: true, + unselectedItemColor: MyColors.lightTextColor, + unselectedFontSize: 11, + selectedFontSize: 11, + selectedLabelStyle: const TextStyle(fontFamily: "Poppins"), + unselectedLabelStyle: const TextStyle(fontFamily: "Poppins"), + onTap: (index) => dashboardVM.onNavbarTapped(index), + ); + } +} diff --git a/lib/views/dashboard/widgets/drawer_widget.dart b/lib/views/dashboard/widgets/drawer_widget.dart new file mode 100644 index 0000000..52a1f80 --- /dev/null +++ b/lib/views/dashboard/widgets/drawer_widget.dart @@ -0,0 +1,194 @@ +import 'package:car_customer_app/view_models/dashboard_view_model.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:mc_common_app/classes/app_state.dart'; +import 'package:mc_common_app/classes/consts.dart'; +import 'package:mc_common_app/config/routes.dart'; +import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/generated/locale_keys.g.dart'; +import 'package:mc_common_app/models/user/image_response.dart'; +import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/navigator.dart'; +import 'package:mc_common_app/utils/utils.dart'; +import 'package:mc_common_app/widgets/button/show_fill_button.dart'; +import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; + +class CustomDrawer extends StatefulWidget { + final DashboardVM dashboardVM; + + const CustomDrawer({Key? key, required this.dashboardVM}) : super(key: key); + + @override + State createState() => _CustomDrawerState(); +} + +class _CustomDrawerState extends State { + void _openImagePicker() { + showDialog( + context: context, + builder: (context) => AlertDialog( + content: const Text("Choose image source"), + actions: [ + TextButton(child: const Text("Camera"), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 0)), + TextButton(child: const Text("Gallery"), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 1)), + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + return Drawer( + child: Column( + children: [ + Stack( + children: [ + Container( + width: double.infinity, + height: 200, + color: MyColors.darkPrimaryColor.withOpacity(0.01), + child: Image.network( + ApiConsts.baseUrlServices + AppState().getUser.data!.userInfo!.userImageUrl.toString(), + ), + ), + Positioned( + top: 10, + right: 10, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(30), + ), + child: const Icon( + Icons.edit, + color: MyColors.darkPrimaryColor, + ).onPress(() { + _openImagePicker(); + // _handleURLButtonPress(context, ImageSourceType.camera); + }), + ), + 12.height, + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: Colors.grey[200], + borderRadius: BorderRadius.circular(30), + ), + child: const Icon( + Icons.delete, + color: Colors.red, + ).onPress(() async { + Utils.showLoading(context); + ImageResponse response = await widget.dashboardVM.updateUserImage(""); + if (response.messageStatus == 1) { + Utils.showToast("Image is Deleted"); + setState(() { + AppState().getUser.data!.userInfo!.userImageUrl = response.data; + }); + } + Utils.hideLoading(context); + }), + ), + ], + ), + ], + ), + ) + ], + ), + Container( + width: double.infinity, + color: MyColors.darkPrimaryColor.withOpacity(0.1), + padding: const EdgeInsets.all(20), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "userName".toText( + isBold: true, + fontSize: 20, + letterSpacing: -1.44, + ), + AppState().getUser.data!.userInfo!.roleName!.toText(fontSize: 10), + ], + ), + ), + ShowFillButton( + title: LocaleKeys.edit.tr(), + fontSize: 12, + maxHeight: 35, + maxWidth: 70, + onPressed: () { + navigateWithName(context, AppRoutes.editAccountPage); + }, + ), + ], + ), + ), + ListTile( + leading: const Icon( + Icons.notifications, + color: MyColors.darkPrimaryColor, + ), + title: LocaleKeys.notifications.tr().toText(fontSize: 12), + ), + ListTile( + leading: const Icon( + Icons.settings, + color: MyColors.darkPrimaryColor, + ), + title: LocaleKeys.general.tr().toText(fontSize: 12), + ), + ListTile( + leading: const Icon( + Icons.person, + color: MyColors.darkPrimaryColor, + ), + title: LocaleKeys.account.tr().toText(fontSize: 12), + ), + ListTile( + leading: Image.asset( + MyAssets.icWorldPng, + width: 20, + height: 20, + color: MyColors.darkPrimaryColor, + ), + title: LocaleKeys.english.tr().toText(fontSize: 12), + onTap: () { + if (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA") { + context.setLocale(const Locale("en", "US")); + } else { + context.setLocale(const Locale('ar', 'SA')); + } + }, + ), + ListTile( + leading: const Icon( + Icons.logout, + color: MyColors.darkPrimaryColor, + ), + title: LocaleKeys.signOut.tr().toText(fontSize: 12), + onTap: () { + pop(context); + navigateReplaceWithName(context, AppRoutes.registerSelection); + }, + ), + ], + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..1c5a0d4 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,85 @@ +name: car_customer_app +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 used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.12.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 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + + mc_common_app: + path: D:/Development/car_common_app + +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. + + + +# 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. +flutter: + + # 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: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # 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: Poppins +# fonts: +# - asset: assets/fonts/Poppins-Medium.ttf + # 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..6284eaa --- /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 that Flutter provides. 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:car_customer_app/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget( 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); + }); +}