commit 21a18461eac8d0e64c88c6558cf0fde751b471fb Author: IbnuBatutah Date: Sat Dec 9 21:16:47 2023 +0700 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..24476c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..a697366 --- /dev/null +++ b/.metadata @@ -0,0 +1,33 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: android + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + - platform: ios + create_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + base_revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f6743a --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# snap_and_cook_mobile + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. 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..c37f7be --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,77 @@ +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 { + namespace "com.ibnu.snap_and_cook_mobile" + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + aaptOptions { + noCompress 'tflite' + noCompress 'lite' + } + + 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.ibnu.snap_and_cook_mobile" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion 23 + targetSdkVersion 33 + 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..399f698 --- /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..2ef8698 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/ibnu/snap_and_cook_mobile/MainActivity.kt b/android/app/src/main/kotlin/com/ibnu/snap_and_cook_mobile/MainActivity.kt new file mode 100644 index 0000000..863679b --- /dev/null +++ b/android/app/src/main/kotlin/com/ibnu/snap_and_cook_mobile/MainActivity.kt @@ -0,0 +1,6 @@ +package com.ibnu.snap_and_cook_mobile + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /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..f7eb7f6 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.3.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3c472b9 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..f860b76 --- /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" \ No newline at end of file diff --git a/assets/fonts/TT Commons-ExtraBold-Italic.ttf b/assets/fonts/TT Commons-ExtraBold-Italic.ttf new file mode 100644 index 0000000..da2c5b4 Binary files /dev/null and b/assets/fonts/TT Commons-ExtraBold-Italic.ttf differ diff --git a/assets/fonts/TT Commons-Light-Italic.ttf b/assets/fonts/TT Commons-Light-Italic.ttf new file mode 100644 index 0000000..a507025 Binary files /dev/null and b/assets/fonts/TT Commons-Light-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-Black-Italic.ttf b/assets/fonts/TT-Commons-Black-Italic.ttf new file mode 100644 index 0000000..5a2e65f Binary files /dev/null and b/assets/fonts/TT-Commons-Black-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-Black.ttf b/assets/fonts/TT-Commons-Black.ttf new file mode 100644 index 0000000..2a9bdf3 Binary files /dev/null and b/assets/fonts/TT-Commons-Black.ttf differ diff --git a/assets/fonts/TT-Commons-Bold-Italic.ttf b/assets/fonts/TT-Commons-Bold-Italic.ttf new file mode 100644 index 0000000..9f5d83c Binary files /dev/null and b/assets/fonts/TT-Commons-Bold-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-Bold.ttf b/assets/fonts/TT-Commons-Bold.ttf new file mode 100644 index 0000000..4177082 Binary files /dev/null and b/assets/fonts/TT-Commons-Bold.ttf differ diff --git a/assets/fonts/TT-Commons-ExtraBold.ttf b/assets/fonts/TT-Commons-ExtraBold.ttf new file mode 100644 index 0000000..867f06f Binary files /dev/null and b/assets/fonts/TT-Commons-ExtraBold.ttf differ diff --git a/assets/fonts/TT-Commons-ExtraLight-Italic.ttf b/assets/fonts/TT-Commons-ExtraLight-Italic.ttf new file mode 100644 index 0000000..3d9e382 Binary files /dev/null and b/assets/fonts/TT-Commons-ExtraLight-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-ExtraLight.ttf b/assets/fonts/TT-Commons-ExtraLight.ttf new file mode 100644 index 0000000..5131ae4 Binary files /dev/null and b/assets/fonts/TT-Commons-ExtraLight.ttf differ diff --git a/assets/fonts/TT-Commons-Light.ttf b/assets/fonts/TT-Commons-Light.ttf new file mode 100644 index 0000000..0969a78 Binary files /dev/null and b/assets/fonts/TT-Commons-Light.ttf differ diff --git a/assets/fonts/TT-Commons-Medium-Italic.ttf b/assets/fonts/TT-Commons-Medium-Italic.ttf new file mode 100644 index 0000000..e1a73c1 Binary files /dev/null and b/assets/fonts/TT-Commons-Medium-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-Medium.ttf b/assets/fonts/TT-Commons-Medium.ttf new file mode 100644 index 0000000..1bf86d0 Binary files /dev/null and b/assets/fonts/TT-Commons-Medium.ttf differ diff --git a/assets/fonts/TT-Commons-Regular-Italic.ttf b/assets/fonts/TT-Commons-Regular-Italic.ttf new file mode 100644 index 0000000..242f672 Binary files /dev/null and b/assets/fonts/TT-Commons-Regular-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-Regular.ttf b/assets/fonts/TT-Commons-Regular.ttf new file mode 100644 index 0000000..62257b1 Binary files /dev/null and b/assets/fonts/TT-Commons-Regular.ttf differ diff --git a/assets/fonts/TT-Commons-SemiBold-Italic.ttf b/assets/fonts/TT-Commons-SemiBold-Italic.ttf new file mode 100644 index 0000000..6fe0861 Binary files /dev/null and b/assets/fonts/TT-Commons-SemiBold-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-SemiBold.ttf b/assets/fonts/TT-Commons-SemiBold.ttf new file mode 100644 index 0000000..4aa9205 Binary files /dev/null and b/assets/fonts/TT-Commons-SemiBold.ttf differ diff --git a/assets/fonts/TT-Commons-Thin-Italic.ttf b/assets/fonts/TT-Commons-Thin-Italic.ttf new file mode 100644 index 0000000..8056ae0 Binary files /dev/null and b/assets/fonts/TT-Commons-Thin-Italic.ttf differ diff --git a/assets/fonts/TT-Commons-Thin.ttf b/assets/fonts/TT-Commons-Thin.ttf new file mode 100644 index 0000000..6e0db95 Binary files /dev/null and b/assets/fonts/TT-Commons-Thin.ttf differ diff --git a/assets/images/logo_snapcook_full.png b/assets/images/logo_snapcook_full.png new file mode 100644 index 0000000..52727bd Binary files /dev/null and b/assets/images/logo_snapcook_full.png differ diff --git a/assets/labels.txt b/assets/labels.txt new file mode 100644 index 0000000..1f42c8e --- /dev/null +++ b/assets/labels.txt @@ -0,0 +1,80 @@ +person +bicycle +car +motorcycle +airplane +bus +train +truck +boat +traffic light +fire hydrant +stop sign +parking meter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe +backpack +umbrella +handbag +tie +suitcase +frisbee +skis +snowboard +sports ball +kite +baseball bat +baseball glove +skateboard +surfboard +tennis racket +bottle +wine glass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hot dog +pizza +donut +cake +chair +couch +potted plant +bed +dining table +toilet +tv +laptop +mouse +remote +keyboard +cell phone +microwave +oven +toaster +sink +refrigerator +book +clock +vase +scissors +teddy bear +hair drier +toothbrush \ No newline at end of file diff --git a/assets/yolov8m_float16.tflite b/assets/yolov8m_float16.tflite new file mode 100644 index 0000000..57d73e6 Binary files /dev/null and b/assets/yolov8m_float16.tflite differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..9625e10 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..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/Podfile b/ios/Podfile new file mode 100644 index 0000000..fdcc671 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..73bca67 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,613 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + 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 */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807E294A63A400263BE5 /* Frameworks */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 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 */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.ibnu.snapAndCookMobile; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.ibnu.snapAndCookMobile.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.ibnu.snapAndCookMobile.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.ibnu.snapAndCookMobile.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.ibnu.snapAndCookMobile; + 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.ibnu.snapAndCookMobile; + 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 */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 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..e42adcb --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..a2b9cb8 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Snap And Cook Mobile + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + snap_and_cook_mobile + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/components/app/app.dart b/lib/components/app/app.dart new file mode 100644 index 0000000..2d17351 --- /dev/null +++ b/lib/components/app/app.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../main.dart'; +import '../../routes/routes.dart'; +import '../../routes/routes/main_route.dart'; +import '../../styles/themes.dart'; + +class App extends StatefulWidget { + const App({Key? key}) : super(key: key); + + @override + _App createState() => _App(); +} + +class _App extends State with RestorationMixin { + final RestorableInt _index = RestorableInt(0); + + @override + void initState() { + super.initState(); + initPlatformState(); + } + + Future initPlatformState() async {} + + @override + Widget build(BuildContext context) { + return ScreenUtilInit( + minTextAdapt: true, + splitScreenMode: true, + builder: (context, widget) => GetMaterialApp( + // home: MyApp(), + initialRoute: MainRoute.splash, + title: "Snap And Cook", + initialBinding: null, + unknownRoute: GetPage( + name: "/route_not_found", page: () => const Text("not found")), + getPages: routes, + theme: AppTheme.mainTheme, + darkTheme: AppTheme.mainTheme, + debugShowCheckedModeBanner: false, + ), + ); + } + + @override + String? get restorationId => 'main_page'; + + @override + void restoreState(RestorationBucket? oldBucket, bool initialRestore) { + registerForRestoration(_index, 'main_index'); + } +} + + diff --git a/lib/components/appbar/basic_appbar.dart b/lib/components/appbar/basic_appbar.dart new file mode 100644 index 0000000..3ef433a --- /dev/null +++ b/lib/components/appbar/basic_appbar.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:snap_and_cook_mobile/styles/text_styles/tt_commons_text_styles.dart'; + +import '../../styles/colors.dart'; +import '../asset_image_view.dart'; + +class BasicAppBar extends StatelessWidget implements PreferredSizeWidget { + final String appBarTitleText; + final Color appBarTitleColor; + final double appBarTitleSize; + final FontWeight appBarTitleWeight; + final double appBarHeight; + final String? appBarSubTitleText; + final Color appBarSubTitleColor; + final double appBarSubTitleSize; + final FontWeight appBarSubTitleWeight; + final Function? onTapBack; + final List? actions; + final double appBarElevation; + final IconData? leadingIconData; + final String? leadingImage; + final bool centerTitle; + final Color backgroundColor; + final Color leadingIconColor; + final double leadingHeight; + final double leadingWeight; + + BasicAppBar({ + Key? key, + this.appBarTitleText = '', + this.appBarTitleColor = AppColors.heroBlack, + this.appBarTitleSize = 18, + this.appBarTitleWeight = FontWeight.w500, + this.appBarHeight = 56, + this.appBarSubTitleColor = AppColors.heroBlack, + this.appBarSubTitleSize = 18, + this.appBarSubTitleWeight = FontWeight.w500, + this.appBarSubTitleText, + this.onTapBack, + this.actions, + this.appBarElevation = 0, + this.leadingIconData, + this.leadingImage = '', + this.centerTitle = false, + this.backgroundColor = AppColors.semanticGreen300, + this.leadingIconColor = AppColors.heroBlack, + this.leadingHeight = 24, + this.leadingWeight = 24, + }) : super(key: key); + + @override + Size get preferredSize => AppBar().preferredSize; + + @override + Widget build(BuildContext context) { + return AppBar( + backgroundColor: backgroundColor, + centerTitle: centerTitle, + elevation: appBarElevation, + toolbarHeight: appBarHeight, + automaticallyImplyLeading: false, + actions: actions, + titleSpacing: 0, + iconTheme: const IconThemeData( + color: AppColors.primaryGrey, + ), + title: Container( + width: Get.width, + margin: actions == null + ? EdgeInsets.only( + right: 55.sp, + ) + : EdgeInsets.zero, + child: Row( + children: [ + if (leadingIconData == null && leadingImage!.isEmpty) + SizedBox(width: 16.w), + _basicAppBarTitle(), + SizedBox(width: 8.w), + _basicAppBarSubTitle(), + ], + ), + ), + leading: _basicAppBarLeadingIcon(), + ); + } + + Widget? _basicAppBarLeadingIcon() { + if (leadingIconData != null || leadingImage!.isNotEmpty) { + return GestureDetector( + child: AbsorbPointer( + child: Center( + child: AssetImageView( + materialIcon: leadingIconData, + height:leadingHeight, + width: leadingWeight, + color: leadingIconColor, + fileName: leadingImage!, + ), + ), + ), + onTap: () { + if (onTapBack != null) { + onTapBack?.call(); + } else { + Get.back(); + } + }, + ); + } + return null; + } + + Widget _basicAppBarTitle() { + if (appBarTitleText.isNotEmpty) { + return Text( + appBarTitleText, + style: TTCommonsTextStyles.textMd.textMedium().copyWith( + color: appBarTitleColor, + fontSize: appBarTitleSize, + fontWeight: appBarTitleWeight, + ), + textAlign: TextAlign.center, + ); + } + return const SizedBox(); + } + + Widget _basicAppBarSubTitle() { + if (appBarSubTitleText != null) { + return Text( + appBarSubTitleText!, + style: TTCommonsTextStyles.textMd.textMedium().copyWith( + color: appBarSubTitleColor, + fontSize: appBarSubTitleSize, + fontWeight: appBarSubTitleWeight, + ), + textAlign: TextAlign.center, + ); + } + return const SizedBox(); + } +} diff --git a/lib/components/asset_image_view.dart b/lib/components/asset_image_view.dart new file mode 100644 index 0000000..e83bbe7 --- /dev/null +++ b/lib/components/asset_image_view.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +import '../styles/colors.dart'; +import '../styles/values.dart'; + +class AssetImageView extends StatelessWidget { + final String fileName; + final IconData? materialIcon; + final double? height; + final double? width; + final Color? color; + final double? scale; + final BoxFit? fit; + final GestureTapCallback? onTap; + + const AssetImageView( + {Key? key, + required this.fileName, + this.materialIcon, + this.height = 24, + this.width = 24, + this.color, + this.scale, + this.fit, + this.onTap}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: _getView(), + ); + } + + Widget _getView() { + String mimType = fileName.split(".").last; + String path = fileName; + + if (mimType.isEmpty) { + if (materialIcon != null) { + return Icon( + materialIcon, + size: width ?? 12, + color: color, + ); + } + return Icon( + Icons.image_not_supported_outlined, + size: width, + color: color, + ); + } + + switch (mimType) { + case "svg": + return SvgPicture.asset( + path, + height: height, + width: width, + colorFilter: color != null ? ColorFilter.mode(color!, BlendMode.srcIn) : null, + ); + case "png": + return Image.asset( + path, + height: height, + width: width, + color: color, + scale: scale, + fit: fit, + ); + case "jpg": + return Image.asset( + path, + height: height, + width: width, + color: color, + scale: scale, + fit: fit, + ); + case "jpeg": + return Image.asset( + path, + height: height, + width: width, + color: color, + scale: scale, + fit: fit, + ); + default: + return Icon( + Icons.image_not_supported_outlined, + size: width, + color: color ?? AppColors.heroBlack, + ); + } + } +} diff --git a/lib/components/basic_button.dart b/lib/components/basic_button.dart new file mode 100644 index 0000000..d7db9d8 --- /dev/null +++ b/lib/components/basic_button.dart @@ -0,0 +1,168 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +import '../styles/colors.dart'; +import '../styles/text_styles/tt_commons_text_styles.dart'; + +class BasicButton extends StatelessWidget { + final BuildContext? context; + final Function onPress; + final String text; + final bool isEnabled; + final bool isLoading; + final bool isTransparent; + final bool isBorder; + final bool isLeading; + final double borderRadius; + final Color bgColor; + final Color textColor; + final Color borderColor; + final double height; + final Widget? leadingIcon; + final double sizeText; + final FontWeight fontWeight; + final Color disableColor; + final Color loadingColor; + final Key? viewKey; + + const BasicButton({ + Key? key, + this.context, + required this.onPress, + required this.text, + this.isEnabled = true, + this.isLoading = false, + this.isTransparent = false, + this.isBorder = false, + this.isLeading = false, + this.borderRadius = 0, + this.bgColor = AppColors.heroBlack, + this.textColor = AppColors.heroWhite, + this.borderColor = AppColors.heroBlack, + this.height = 60, + this.sizeText = 18, + this.leadingIcon, + this.fontWeight = FontWeight.w600, + this.disableColor = AppColors.primaryGrey100, + this.loadingColor = AppColors.heroWhite, this.viewKey, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return SizedBox( + height: height.h, + child: IgnorePointer( + ignoring: !isEnabled, + child: TextButton( + key: viewKey, + onPressed: () { + if (isEnabled) onPress.call(); + }, + style: buttonStyle(), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12), + child: IntrinsicHeight( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + basicButtonLeading(), + basicButtonOnProgress(), + basicButtonText(), + ], + ), + ), + ), + ), + ), + ); + } + + Widget basicButtonLeading() { + if (isLeading) { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + leadingIcon ?? const SizedBox(), + SizedBox( + width: 24.w, + ), + ], + ); + } + return const SizedBox(); + } + + Widget basicButtonOnProgress() { + if (isLoading) { + return Row( + children: [ + SizedBox( + width: 18.w, + height: 18.h, + child: CircularProgressIndicator( + color: loadingColor, + strokeWidth: 3.r, + ), + ), + SizedBox( + width: 12.w, + ), + ], + ); + } + return const SizedBox(); + } + + Widget basicButtonText() { + return Text( + text, + textAlign: TextAlign.center, + textHeightBehavior: const TextHeightBehavior( + applyHeightToFirstAscent: false, + applyHeightToLastDescent: false, + ), + style: TTCommonsTextStyles.textSm.textMedium().copyWith( + color: isEnabled ? AppColors.heroWhite : AppColors.primaryGrey200, + fontSize: sizeText.sp, + fontWeight: fontWeight, + ), + ); + } + + ButtonStyle buttonStyle() { + return const ButtonStyle().copyWith( + backgroundColor: buttonStyleBackgroundColor(), + padding: MaterialStateProperty.all(EdgeInsets.zero), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + side: buttonStyleBorderSide(), + borderRadius: BorderRadius.all( + Radius.circular( + borderRadius, + ), + ), + ), + ), + ); + } + + MaterialStateProperty buttonStyleBackgroundColor() { + if (isTransparent) { + return MaterialStateProperty.all(Colors.transparent); + } + return MaterialStateProperty.all(isEnabled ? bgColor : disableColor); + } + + BorderSide buttonStyleBorderSide() { + if (isBorder) { + return BorderSide( + width: 1.w, + color: borderColor, + ); + } + return BorderSide( + width: 0.w, + color: Colors.transparent, + ); + } +} diff --git a/lib/components/camera/custom_camera.dart b/lib/components/camera/custom_camera.dart new file mode 100644 index 0000000..86f194e --- /dev/null +++ b/lib/components/camera/custom_camera.dart @@ -0,0 +1,256 @@ +library camera_with_files; + +import 'dart:async'; +import 'dart:io'; +import 'dart:math'; + +import 'package:camera/camera.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_image_compress/flutter_image_compress.dart'; +import 'package:image_picker/image_picker.dart'; +import "package:intl/intl.dart"; +import 'package:path_provider/path_provider.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:photo_gallery/photo_gallery.dart'; + +class CameraApp extends StatefulWidget { + final int? compressionQuality; + + const CameraApp({Key? key, this.compressionQuality = 100}) : super(key: key); + + @override + CameraAppState createState() => CameraAppState(); +} + +class CameraAppState extends State { + CameraController? controller; + late List cameras; + List imageAlbums = []; + Set imageMedium = {}; + Uint8List? bytes; + List results = []; + List indexList = []; + bool flashOn = false; + bool showPerformance = false; + late double width; + + @override + void initState() { + super.initState(); + cameraLoad(); + } + + cameraLoad() async { + cameras = await availableCameras(); + controller = CameraController(cameras[0], ResolutionPreset.max, + imageFormatGroup: Platform.isIOS ? ImageFormatGroup.bgra8888 : null); + controller!.initialize().then((_) { + if (!mounted) { + return; + } + _promptPermissionSetting().then((_) { + if (_) {} + setState(() {}); + }); + setState(() {}); + }); + } + + Future _promptPermissionSetting() async { + if (kIsWeb) { + return true; + } else if (Platform.isIOS) { + PermissionStatus status = await Permission.storage.request(); + PermissionStatus status2 = await Permission.photos.request(); + PermissionStatus status3 = await Permission.mediaLibrary.request(); + return status.isGranted && status2.isGranted && status3.isGranted; + } else if (Platform.isAndroid) { + PermissionStatus status = await Permission.storage.request(); + return status.isGranted; + } + return false; + } + + @override + void dispose() { + controller!.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (controller == null) { + return Container(); + } + var camera = controller!.value; + final size = MediaQuery.of(context).size; + var scale = 0.0; + try { + scale = size.aspectRatio * camera.aspectRatio; + } catch (e) { + debugPrint(e.toString()); + } + + if (scale < 1) scale = 1 / scale; + + if (!controller!.value.isInitialized) { + return Container(); + } + return WillPopScope( + onWillPop: () { + return Future.value(true); + }, + child: Scaffold( + body: Stack( + children: [ + GestureDetector( + onVerticalDragStart: (e) {}, + child: Transform.scale( + scale: scale, + child: Center( + child: CameraPreview(controller!), + ), + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: MediaQuery.of(context).size.width, + height: 215, + color: Colors.transparent, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + _galleryButton(), + _cameraButton() + ], + ), + ), + ), + SafeArea( + child: Align( + alignment: Alignment.topCenter, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton( + onPressed: () { + setState(() { + flashOn = !flashOn; + if (flashOn) { + controller!.setFlashMode(FlashMode.torch); + } else { + controller!.setFlashMode(FlashMode.off); + } + }); + }, + icon: const Icon(Icons.flash_off, + size: 30, color: Colors.white)), + IconButton( + onPressed: () { + compress([]); + }, + icon: const Icon( + Icons.close_rounded, + color: Colors.white, + )) + ], + )), + ), + ], + ), + ), + ); + } + + Widget _galleryButton(){ + return IconButton( + onPressed: () async { + final ImagePicker picker0 = + ImagePicker(); + final XFile? image = + await picker0.pickImage( + source: ImageSource.gallery); + if (image == null) { + return; + } + File file = File(image.path); + compress([file]); + }, + icon: const Icon(Icons.photo_library, + size: 30, color: Colors.white), + ); + } + + Widget _cameraButton(){ + return GestureDetector( + onTap: () async { + XFile file2 = await controller!.takePicture(); + File file = File(file2.path); + compress([file]); + }, + child: Container( + width: 75, + height: 75, + decoration: BoxDecoration( + // color: Colors.white, + borderRadius: const BorderRadius.all( + Radius.circular( + 50) + ), + border: Border.all( + color: Colors.white, width: 3)), + ), + ); + } + + void onSettingCallback() { + setState(() { + showPerformance = !showPerformance; + }); + } + + void compress(List files) async { + List files2 = []; + for (File file in files) { + Uint8List? blobBytes = await compressFile(file); + var dir = await getTemporaryDirectory(); + String trimmed = dir.absolute.path; + String dateTimeString = DateTime.now().millisecondsSinceEpoch.toString(); + String pathString = "$trimmed/$dateTimeString.jpg"; + File fileNew = File(pathString); + fileNew.writeAsBytesSync(List.from(blobBytes!)); + files2.add(fileNew); + } + + if (context.mounted) { + Navigator.of(context).pop(files2); + } + } + + String dateTimeToString(DateTime dateTime, String pattern) { + final format = DateFormat(pattern); + return format.format(dateTime); + } + + Future compressFile(File file) async { + var decodedImage = await decodeImageFromList(file.readAsBytesSync()); + print("Image compress Before: " + + getFileSizeString(bytes: file.lengthSync())); + var result = await FlutterImageCompress.compressWithFile(file.absolute.path, + minHeight: decodedImage.height, + minWidth: decodedImage.width, + quality: widget.compressionQuality!); + print("Image compress After: " + + getFileSizeString(bytes: result!.lengthInBytes)); + return result; + } + + String getFileSizeString({required int bytes, int decimals = 0}) { + const suffixes = ["b", "kb", "mb", "gb", "tb"]; + var i = (log(bytes) / log(1024)).floor(); + return ((bytes / pow(1024, i)).toStringAsFixed(decimals)) + suffixes[i]; + } +} diff --git a/lib/components/dismissable_keyboard.dart b/lib/components/dismissable_keyboard.dart new file mode 100644 index 0000000..9c1f705 --- /dev/null +++ b/lib/components/dismissable_keyboard.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class DismissKeyboard extends StatelessWidget { + final Widget child; + + const DismissKeyboard({super.key, required this.child}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus && + currentFocus.focusedChild != null) { + FocusManager.instance.primaryFocus?.unfocus(); + } + }, + child: child, + ); + } +} diff --git a/lib/components/loading_container.dart b/lib/components/loading_container.dart new file mode 100644 index 0000000..7b65b3d --- /dev/null +++ b/lib/components/loading_container.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +import '../styles/colors.dart'; + +class LoadingContainer extends StatelessWidget { + final double? width, height, padding; + final Color? color, bgColor; + const LoadingContainer({Key? key, this.width, this.height, this.padding, this.color, this.bgColor}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Align( + alignment: Alignment.center, + child: Container( + width: width ?? 100, + height: height ?? 100, + padding: EdgeInsets.all(padding ?? 0), + decoration: BoxDecoration( + color: bgColor, + border: Border.all(color: const Color(0xffFFFFFF), width: 0), + borderRadius: const BorderRadius.all(Radius.circular(15)), + ), + child: CircularProgressIndicator( + color: color ?? AppColors.heroBlack, + ), + ), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/components/progress_container.dart b/lib/components/progress_container.dart new file mode 100644 index 0000000..33fdaaf --- /dev/null +++ b/lib/components/progress_container.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import 'loading_container.dart'; + +class ProgressContainer extends StatelessWidget { + final void Function()? onDismiss; + final bool isShow; + + const ProgressContainer({ + Key? key, + this.onDismiss, + this.isShow = false, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return AnimatedOpacity( + opacity: isShow ? 1.0 : 0.0, + duration: const Duration(milliseconds: 600), + child: isShow + ? GestureDetector( + onTap: onDismiss, + child: Material( + color: Colors.transparent, + child: Container( + width: Get.width, + height: Get.height, + color: Colors.white.withOpacity(0.7), + child: const LoadingContainer(), + ), + ), + ) + : const SizedBox(), + ); + } +} \ No newline at end of file diff --git a/lib/components/space/space_form_field.dart b/lib/components/space/space_form_field.dart new file mode 100644 index 0000000..1156e1d --- /dev/null +++ b/lib/components/space/space_form_field.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class SpaceFormField extends StatelessWidget { + const SpaceFormField({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return const SizedBox( + height: 24, + ); + } +} diff --git a/lib/components/tab_view.dart b/lib/components/tab_view.dart new file mode 100644 index 0000000..328e450 --- /dev/null +++ b/lib/components/tab_view.dart @@ -0,0 +1,136 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../styles/colors.dart'; +import '../styles/values.dart'; + +class BasicTabView extends StatelessWidget { + final BuildContext? context; + final TabController tabController; + final Decoration tabBarDecoration; + final TextStyle labelStyle; + final Color labelColor; + final Color unselectedLabelColor; + final Color indicatorColor; + final EdgeInsetsGeometry labelPadding; + final List tabTitles; + final List tabViews; + final Decoration decoration; + + const BasicTabView({ + Key? key, + this.context, + required this.tabController, + required this.tabTitles, + required this.tabViews, + required this.labelStyle, + this.labelColor = AppColors.heroBlack, + this.unselectedLabelColor = AppColors.heroBlack, + this.indicatorColor = AppColors.primaryOrange, + this.decoration = const BoxDecoration( + color: AppColors.primaryOrange400, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.symmetric( + horizontal: BorderSide( + color: AppColors.primaryOrange200, + ), + vertical: BorderSide( + color: AppColors.primaryOrange200, + ), + ), + boxShadow: [ + BoxShadow( + color: AppColors.primaryGrey100, + blurRadius: 2, + spreadRadius: 0.2, + offset: + Offset(1, 2), // Shadow position + ), + ],), + this.labelPadding = const EdgeInsets.symmetric( + horizontal: 8, + ), + this.tabBarDecoration = const BoxDecoration( + border: Border( + bottom: BorderSide( + color: AppColors.primaryGrey100, + ), + ), + ), + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + basicTabBarTitle(), + basicTabView(), + ], + ), + ); + } + + Widget basicTabBarTitle() { + return Container( + margin: const EdgeInsets.symmetric(horizontal: 24), + height: 40.h, + decoration: tabBarDecoration, + child: SizedBox( + height: 40.h, + width: double.infinity, + child: TabBar( + indicatorWeight: 2, + isScrollable: true, + automaticIndicatorColorAdjustment: true, + labelStyle: labelStyle, + labelColor: labelColor, + unselectedLabelColor: unselectedLabelColor, + indicatorColor: indicatorColor, + physics: const BouncingScrollPhysics(), + controller: tabController, + labelPadding: labelPadding, + tabs: tabTitles, + indicatorSize: TabBarIndicatorSize.label, + // indicator: decoration, + ), + ), + ); + } + + Widget basicTabView() { + return Expanded( + child: TabBarView( + controller: tabController, + physics: const BouncingScrollPhysics(), + children: tabViews, + ), + ); + } +} + +class BasicTabViewSelection { + static Widget basicTabViewDefaultSelection({ + required int tabId, + required int selectedIndex, + required Widget child, + }) { + if (selectedIndex == tabId) { + return Container( + padding: const EdgeInsets.all(6), + decoration: const BoxDecoration( + color: Colors.orange, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + ), + child: child, + ); + } + return Container( + child: child, + ); + } +} diff --git a/lib/components/text/basic_form_label.dart b/lib/components/text/basic_form_label.dart new file mode 100644 index 0000000..9c344cc --- /dev/null +++ b/lib/components/text/basic_form_label.dart @@ -0,0 +1,32 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../styles/icons.dart'; +import '../../styles/text_styles/tt_commons_text_styles.dart'; +import '../asset_image_view.dart'; + +class BasicFormLabel extends StatelessWidget { + final String text; + final bool? isMandatory; + + const BasicFormLabel({Key? key, required this.text, this.isMandatory}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + text, + style: TTCommonsTextStyles.textSm.textSemiBold(), + ), + Visibility( + visible: (isMandatory ?? false), + child: const AssetImageView(fileName: GeneralIcons.asterisk, height: 10, width: 10,), + ), + ], + ); + } +} diff --git a/lib/configuration/app_build_config.dart b/lib/configuration/app_build_config.dart new file mode 100644 index 0000000..f8cffe2 --- /dev/null +++ b/lib/configuration/app_build_config.dart @@ -0,0 +1,17 @@ +import '../data/enums/environment_enum.dart'; + +class AppBuildConfig { + late final BuildConfigEnum config; + bool _lock = false; + + AppBuildConfig._(); + + static final AppBuildConfig instance = AppBuildConfig._(); + + factory AppBuildConfig.instantiate({required BuildConfigEnum config}) { + if (instance._lock) return instance; + instance.config = config; + instance._lock = true; + return instance; + } +} diff --git a/lib/configuration/app_environtment.dart b/lib/configuration/app_environtment.dart new file mode 100644 index 0000000..512efdc --- /dev/null +++ b/lib/configuration/app_environtment.dart @@ -0,0 +1,11 @@ +import '../resources/constants/environtment_constant.dart'; + +class AppEnvironment { + static Map get env => { + EnvironmentConstant.baseUrl: const String.fromEnvironment( + EnvironmentConstant.baseUrl, + defaultValue: ""), + }; + + static String get baseUrl => env[EnvironmentConstant.baseUrl] ?? ''; +} diff --git a/lib/data/enums/environment_enum.dart b/lib/data/enums/environment_enum.dart new file mode 100644 index 0000000..12d61f7 --- /dev/null +++ b/lib/data/enums/environment_enum.dart @@ -0,0 +1,4 @@ +enum BuildConfigEnum { + staging, + production +} \ No newline at end of file diff --git a/lib/data/remote/models/ingredient_model.dart b/lib/data/remote/models/ingredient_model.dart new file mode 100644 index 0000000..0f6e30f --- /dev/null +++ b/lib/data/remote/models/ingredient_model.dart @@ -0,0 +1,21 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'ingredient_model.g.dart'; + +@JsonSerializable() +class Ingredient { + String? name; + int? quantity; + String? unit; + + Ingredient({ + this.name, + this.quantity, + this.unit, + }); + + Map toJson() => _$IngredientToJson(this); + + factory Ingredient.fromJson(Map json) => + _$IngredientFromJson(json); +} \ No newline at end of file diff --git a/lib/data/remote/models/ingredient_model.g.dart b/lib/data/remote/models/ingredient_model.g.dart new file mode 100644 index 0000000..1c6c1d3 --- /dev/null +++ b/lib/data/remote/models/ingredient_model.g.dart @@ -0,0 +1,20 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'ingredient_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Ingredient _$IngredientFromJson(Map json) => Ingredient( + name: json['name'] as String?, + quantity: json['quantity'] as int?, + unit: json['unit'] as String?, + ); + +Map _$IngredientToJson(Ingredient instance) => + { + 'name': instance.name, + 'quantity': instance.quantity, + 'unit': instance.unit, + }; diff --git a/lib/data/remote/models/recipe_model.dart b/lib/data/remote/models/recipe_model.dart new file mode 100644 index 0000000..a90e839 --- /dev/null +++ b/lib/data/remote/models/recipe_model.dart @@ -0,0 +1,37 @@ +import 'package:json_annotation/json_annotation.dart'; + +import 'ingredient_model.dart'; + +part 'recipe_model.g.dart'; + +@JsonSerializable() +class Recipe { + String? uuid; + String? title; + String? description; + String? image; + List? ingredients; + List? instructions; + int? prepTime; + int? cookTime; + int? servings; + List? utensils; + + Recipe({ + this.uuid, + this.title, + this.description, + this.image, + this.ingredients, + this.instructions, + this.prepTime, + this.cookTime, + this.servings, + this.utensils, + }); + + Map toJson() => _$RecipeToJson(this); + + factory Recipe.fromJson(Map json) => + _$RecipeFromJson(json); +} diff --git a/lib/data/remote/models/recipe_model.g.dart b/lib/data/remote/models/recipe_model.g.dart new file mode 100644 index 0000000..da0b250 --- /dev/null +++ b/lib/data/remote/models/recipe_model.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recipe_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Recipe _$RecipeFromJson(Map json) => Recipe( + uuid: json['uuid'] as String?, + title: json['title'] as String?, + description: json['description'] as String?, + image: json['image'] as String?, + ingredients: (json['ingredients'] as List?) + ?.map((e) => Ingredient.fromJson(e as Map)) + .toList(), + instructions: (json['instructions'] as List?) + ?.map((e) => e as String) + .toList(), + prepTime: json['prepTime'] as int?, + cookTime: json['cookTime'] as int?, + servings: json['servings'] as int?, + utensils: (json['utensils'] as List?) + ?.map((e) => e as String) + .toList(), + ); + +Map _$RecipeToJson(Recipe instance) => { + 'uuid': instance.uuid, + 'title': instance.title, + 'description': instance.description, + 'image': instance.image, + 'ingredients': instance.ingredients, + 'instructions': instance.instructions, + 'prepTime': instance.prepTime, + 'cookTime': instance.cookTime, + 'servings': instance.servings, + 'utensils': instance.utensils, + }; diff --git a/lib/data/remote/requests/forgot_password_request.dart b/lib/data/remote/requests/forgot_password_request.dart new file mode 100644 index 0000000..1101f2f --- /dev/null +++ b/lib/data/remote/requests/forgot_password_request.dart @@ -0,0 +1,20 @@ + +import 'package:json_annotation/json_annotation.dart'; + +part 'forgot_password_request.g.dart'; + +@JsonSerializable() +class ForgotPasswordRequest { + String phone; + String key; + + ForgotPasswordRequest({ + required this.phone, + required this.key, + }); + + Map toJson() => _$ForgotPasswordRequestToJson(this); + + factory ForgotPasswordRequest.fromJson(Map json) => + _$ForgotPasswordRequestFromJson(json); +} diff --git a/lib/data/remote/requests/forgot_password_request.g.dart b/lib/data/remote/requests/forgot_password_request.g.dart new file mode 100644 index 0000000..1bf9f5a --- /dev/null +++ b/lib/data/remote/requests/forgot_password_request.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'forgot_password_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ForgotPasswordRequest _$ForgotPasswordRequestFromJson( + Map json) => + ForgotPasswordRequest( + phone: json['phone'] as String, + key: json['key'] as String, + ); + +Map _$ForgotPasswordRequestToJson( + ForgotPasswordRequest instance) => + { + 'phone': instance.phone, + 'key': instance.key, + }; diff --git a/lib/data/remote/requests/login_request.dart b/lib/data/remote/requests/login_request.dart new file mode 100644 index 0000000..2b6d228 --- /dev/null +++ b/lib/data/remote/requests/login_request.dart @@ -0,0 +1,20 @@ + +import 'package:json_annotation/json_annotation.dart'; + +part 'login_request.g.dart'; + +@JsonSerializable() +class LoginRequest { + String phone; + String password; + + LoginRequest({ + required this.phone, + required this.password, + }); + + Map toJson() => _$LoginRequestToJson(this); + + factory LoginRequest.fromJson(Map json) => + _$LoginRequestFromJson(json); +} diff --git a/lib/data/remote/requests/login_request.g.dart b/lib/data/remote/requests/login_request.g.dart new file mode 100644 index 0000000..e157d0f --- /dev/null +++ b/lib/data/remote/requests/login_request.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'login_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LoginRequest _$LoginRequestFromJson(Map json) => LoginRequest( + phone: json['phone'] as String, + password: json['password'] as String, + ); + +Map _$LoginRequestToJson(LoginRequest instance) => + { + 'phone': instance.phone, + 'password': instance.password, + }; diff --git a/lib/data/remote/requests/phone_number_check_request.dart b/lib/data/remote/requests/phone_number_check_request.dart new file mode 100644 index 0000000..703c9d1 --- /dev/null +++ b/lib/data/remote/requests/phone_number_check_request.dart @@ -0,0 +1,16 @@ +import 'package:json_annotation/json_annotation.dart'; +part 'phone_number_check_request.g.dart'; + +@JsonSerializable() +class PhoneNumberCheckRequest { + String phone; + + PhoneNumberCheckRequest({ + required this.phone, + }); + + Map toJson() => _$PhoneNumberCheckRequestToJson(this); + + factory PhoneNumberCheckRequest.fromJson(Map json) => + _$PhoneNumberCheckRequestFromJson(json); +} diff --git a/lib/data/remote/requests/phone_number_check_request.g.dart b/lib/data/remote/requests/phone_number_check_request.g.dart new file mode 100644 index 0000000..e613f80 --- /dev/null +++ b/lib/data/remote/requests/phone_number_check_request.g.dart @@ -0,0 +1,19 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'phone_number_check_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PhoneNumberCheckRequest _$PhoneNumberCheckRequestFromJson( + Map json) => + PhoneNumberCheckRequest( + phone: json['phone'] as String, + ); + +Map _$PhoneNumberCheckRequestToJson( + PhoneNumberCheckRequest instance) => + { + 'phone': instance.phone, + }; diff --git a/lib/data/remote/requests/register_request.dart b/lib/data/remote/requests/register_request.dart new file mode 100644 index 0000000..ac01c9c --- /dev/null +++ b/lib/data/remote/requests/register_request.dart @@ -0,0 +1,23 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'register_request.g.dart'; + +@JsonSerializable() +class RegisterRequest { + String name; + String phone; + String email; + String password; + + RegisterRequest({ + required this.name, + required this.phone, + required this.email, + required this.password, + }); + + Map toJson() => _$RegisterRequestToJson(this); + + factory RegisterRequest.fromJson(Map json) => + _$RegisterRequestFromJson(json); +} diff --git a/lib/data/remote/requests/register_request.g.dart b/lib/data/remote/requests/register_request.g.dart new file mode 100644 index 0000000..c48de2c --- /dev/null +++ b/lib/data/remote/requests/register_request.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'register_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RegisterRequest _$RegisterRequestFromJson(Map json) => + RegisterRequest( + name: json['name'] as String, + phone: json['phone'] as String, + email: json['email'] as String, + password: json['password'] as String, + ); + +Map _$RegisterRequestToJson(RegisterRequest instance) => + { + 'name': instance.name, + 'phone': instance.phone, + 'email': instance.email, + 'password': instance.password, + }; diff --git a/lib/data/remote/requests/reset_password_request.dart b/lib/data/remote/requests/reset_password_request.dart new file mode 100644 index 0000000..da7a964 --- /dev/null +++ b/lib/data/remote/requests/reset_password_request.dart @@ -0,0 +1,24 @@ + +import 'package:json_annotation/json_annotation.dart'; + +part 'reset_password_request.g.dart'; + +@JsonSerializable() +class ResetPasswordRequest { + String code; + String phone; + String password; + String passwordConfirmation; + + ResetPasswordRequest({ + required this.code, + required this.phone, + required this.password, + required this.passwordConfirmation, + }); + + Map toJson() => _$ResetPasswordRequestToJson(this); + + factory ResetPasswordRequest.fromJson(Map json) => + _$ResetPasswordRequestFromJson(json); +} diff --git a/lib/data/remote/requests/reset_password_request.g.dart b/lib/data/remote/requests/reset_password_request.g.dart new file mode 100644 index 0000000..b4f4c42 --- /dev/null +++ b/lib/data/remote/requests/reset_password_request.g.dart @@ -0,0 +1,25 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'reset_password_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ResetPasswordRequest _$ResetPasswordRequestFromJson( + Map json) => + ResetPasswordRequest( + code: json['code'] as String, + phone: json['phone'] as String, + password: json['password'] as String, + passwordConfirmation: json['passwordConfirmation'] as String, + ); + +Map _$ResetPasswordRequestToJson( + ResetPasswordRequest instance) => + { + 'code': instance.code, + 'phone': instance.phone, + 'password': instance.password, + 'passwordConfirmation': instance.passwordConfirmation, + }; diff --git a/lib/data/remote/requests/verify_otp_request.dart b/lib/data/remote/requests/verify_otp_request.dart new file mode 100644 index 0000000..1cec3f1 --- /dev/null +++ b/lib/data/remote/requests/verify_otp_request.dart @@ -0,0 +1,19 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'verify_otp_request.g.dart'; + +@JsonSerializable() +class VerifyOtpRequest { + String phone; + String otpCode; + + VerifyOtpRequest({ + required this.phone, + required this.otpCode, + }); + + Map toJson() => _$VerifyOtpRequestToJson(this); + + factory VerifyOtpRequest.fromJson(Map json) => + _$VerifyOtpRequestFromJson(json); +} \ No newline at end of file diff --git a/lib/data/remote/requests/verify_otp_request.g.dart b/lib/data/remote/requests/verify_otp_request.g.dart new file mode 100644 index 0000000..ce82975 --- /dev/null +++ b/lib/data/remote/requests/verify_otp_request.g.dart @@ -0,0 +1,19 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'verify_otp_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +VerifyOtpRequest _$VerifyOtpRequestFromJson(Map json) => + VerifyOtpRequest( + phone: json['phone'] as String, + otpCode: json['otpCode'] as String, + ); + +Map _$VerifyOtpRequestToJson(VerifyOtpRequest instance) => + { + 'phone': instance.phone, + 'otpCode': instance.otpCode, + }; diff --git a/lib/data/remote/responses/base_response.dart b/lib/data/remote/responses/base_response.dart new file mode 100644 index 0000000..15eb735 --- /dev/null +++ b/lib/data/remote/responses/base_response.dart @@ -0,0 +1,19 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'base_response.g.dart'; + +@JsonSerializable(genericArgumentFactories: true) +class BaseResponse { + T? data; + int? code; + String? message; + + BaseResponse({this.data}); + + factory BaseResponse.fromJson( + Map json, T Function(Object? json) fromJsonT) => + _$BaseResponseFromJson(json, fromJsonT); + + Map toJson(Map Function(T value) toJsonT) => + _$BaseResponseToJson(this, toJsonT); +} \ No newline at end of file diff --git a/lib/data/remote/responses/base_response.g.dart b/lib/data/remote/responses/base_response.g.dart new file mode 100644 index 0000000..27c418c --- /dev/null +++ b/lib/data/remote/responses/base_response.g.dart @@ -0,0 +1,39 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'base_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BaseResponse _$BaseResponseFromJson( + Map json, + T Function(Object? json) fromJsonT, +) => + BaseResponse( + data: _$nullableGenericFromJson(json['data'], fromJsonT), + ) + ..code = json['code'] as int? + ..message = json['message'] as String?; + +Map _$BaseResponseToJson( + BaseResponse instance, + Object? Function(T value) toJsonT, +) => + { + 'data': _$nullableGenericToJson(instance.data, toJsonT), + 'code': instance.code, + 'message': instance.message, + }; + +T? _$nullableGenericFromJson( + Object? input, + T Function(Object? json) fromJson, +) => + input == null ? null : fromJson(input); + +Object? _$nullableGenericToJson( + T? input, + Object? Function(T value) toJson, +) => + input == null ? null : toJson(input); diff --git a/lib/data/remote/services/recipe_service.dart b/lib/data/remote/services/recipe_service.dart new file mode 100644 index 0000000..6fc388c --- /dev/null +++ b/lib/data/remote/services/recipe_service.dart @@ -0,0 +1,21 @@ +import 'package:dio/dio.dart' hide Headers; +import 'package:retrofit/retrofit.dart'; +import 'package:snap_and_cook_mobile/data/remote/models/recipe_model.dart'; +import 'package:snap_and_cook_mobile/data/remote/responses/base_response.dart'; + +import '../../../resources/services/recipe_service_constant.dart'; + +part 'recipe_service.g.dart'; + +@RestApi() +abstract class RecipeServices { + factory RecipeServices(Dio dio) = _RecipeServices; + + @GET(RecipeServiceConstants.listRecipe) + Future>> getAllRecipes( + @CancelRequest() CancelToken cancelToken); + + @GET(RecipeServiceConstants.detailRecipe) + Future> getDetailRecipe( + @CancelRequest() CancelToken cancelToken, @Path("uuid") String uuid); +} diff --git a/lib/data/remote/services/recipe_service.g.dart b/lib/data/remote/services/recipe_service.g.dart new file mode 100644 index 0000000..8657238 --- /dev/null +++ b/lib/data/remote/services/recipe_service.g.dart @@ -0,0 +1,92 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'recipe_service.dart'; + +// ************************************************************************** +// RetrofitGenerator +// ************************************************************************** + +// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers + +class _RecipeServices implements RecipeServices { + _RecipeServices( + this._dio, { + this.baseUrl, + }); + + final Dio _dio; + + String? baseUrl; + + @override + Future>> getAllRecipes(cancelToken) async { + const _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + final _result = await _dio.fetch>( + _setStreamType>>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'recipes', + queryParameters: queryParameters, + data: _data, + cancelToken: cancelToken, + ) + .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final value = BaseResponse>.fromJson( + _result.data!, + (json) => (json as List) + .map((i) => Recipe.fromJson(i as Map)) + .toList(), + ); + return value; + } + + @override + Future> getDetailRecipe( + cancelToken, + uuid, + ) async { + const _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + final _result = await _dio.fetch>( + _setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + 'recipe/${uuid}', + queryParameters: queryParameters, + data: _data, + cancelToken: cancelToken, + ) + .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final value = BaseResponse.fromJson( + _result.data!, + (json) => Recipe.fromJson(json as Map), + ); + return value; + } + + RequestOptions _setStreamType(RequestOptions requestOptions) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { + if (T == String) { + requestOptions.responseType = ResponseType.plain; + } else { + requestOptions.responseType = ResponseType.json; + } + } + return requestOptions; + } +} diff --git a/lib/domain/use_case/general/recipe_interface.dart b/lib/domain/use_case/general/recipe_interface.dart new file mode 100644 index 0000000..4fef763 --- /dev/null +++ b/lib/domain/use_case/general/recipe_interface.dart @@ -0,0 +1,7 @@ +import 'package:dartz/dartz.dart'; +import 'package:dio/dio.dart'; +import 'package:snap_and_cook_mobile/data/remote/models/recipe_model.dart'; + +abstract class RecipeInterface { + Future>> fetchRecipes(CancelToken cancelToken); +} diff --git a/lib/domain/use_case/general/recipe_use_case.dart b/lib/domain/use_case/general/recipe_use_case.dart new file mode 100644 index 0000000..42b6cf1 --- /dev/null +++ b/lib/domain/use_case/general/recipe_use_case.dart @@ -0,0 +1,22 @@ +import 'package:dartz/dartz.dart'; +import 'package:dio/dio.dart'; +import 'package:get/get.dart'; + +import '../../../data/remote/models/recipe_model.dart'; +import '../../../data/remote/services/recipe_service.dart'; +import 'recipe_interface.dart'; + +class RecipeUseCase implements RecipeInterface { + final service = Get.find(); + + @override + Future>> + fetchRecipes(CancelToken cancelToken) async { + try { + final response = await service.getAllRecipes(cancelToken); + return Right(response.data ?? []); + } on DioError catch (e) { + return Left(e); + } + } +} diff --git a/lib/init.dart b/lib/init.dart new file mode 100644 index 0000000..99e8ddc --- /dev/null +++ b/lib/init.dart @@ -0,0 +1,24 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:snap_and_cook_mobile/data/remote/services/recipe_service.dart'; +import 'package:snap_and_cook_mobile/utils/extension/dio_extension.dart'; +import 'components/app/app.dart'; +import 'configuration/app_environtment.dart'; +import 'resources/constants/session_constants.dart'; +import 'utils/interceptor/authorization_header_interceptor.dart'; +import 'utils/session/session.dart'; + +Future init() async { + WidgetsFlutterBinding.ensureInitialized(); + await Get.putAsync( + () async => Dio().baseUrl(AppEnvironment.baseUrl).addInterceptor( + AuthorizationHeaderInterceptor( + onToken: () async => + await Session.get(SessionConstants.token) ?? "")), + ); + + await Get.putAsync(() async => Session()); + await Get.putAsync(() async => RecipeServices(Get.find())); + runApp(const RootRestorationScope(restorationId: 'root', child: App())); +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..f0bce5e --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,212 @@ +import 'dart:io'; +import 'dart:typed_data'; +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'dart:async'; +import 'package:flutter_vision/flutter_vision.dart'; +import 'package:image_picker/image_picker.dart'; + +enum Options { none, imagev8 } + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + runApp(const MaterialApp( + home: MyApp(), + debugShowCheckedModeBanner: false, + )); +} + +class MyApp extends StatefulWidget { + const MyApp({Key? key}) : super(key: key); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + late FlutterVision vision; + Options option = Options.none; + + @override + void initState() { + super.initState(); + vision = FlutterVision(); + } + + @override + void dispose() async { + super.dispose(); + await vision.closeYoloModel(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: task(option), + ); + } + + Widget task(Options option) { + return YoloImageV8(vision: vision); + + } +} + +class YoloImageV8 extends StatefulWidget { + final FlutterVision vision; + const YoloImageV8({Key? key, required this.vision}) : super(key: key); + + @override + State createState() => _YoloImageV8State(); +} + +class _YoloImageV8State extends State { + late List> yoloResults; + File? imageFile; + int imageHeight = 1; + int imageWidth = 1; + bool isLoaded = false; + + @override + void initState() { + super.initState(); + loadYoloModel().then((value) { + setState(() { + yoloResults = []; + isLoaded = true; + }); + }); + } + + @override + void dispose() async { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final Size size = MediaQuery.of(context).size; + if (!isLoaded) { + return const Scaffold( + body: Center( + child: Text("Model not loaded, waiting for it"), + ), + ); + } + return Scaffold( + appBar: AppBar( + title: const Text("Yolo V8"), + ), + body: Column( + children: [ + Expanded(child: imageFile != null ? Image.file(imageFile!) : const SizedBox()), + Stack( + fit: StackFit.expand, + children: [ + Align( + alignment: Alignment.bottomCenter, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: pickImage, + child: const Text("ambil gmbr serah"), + ), + // ElevatedButton( + // onPressed: yoloOnImage, + // child: const Text("Ya test"), + // ) + ], + ), + ), + ], + ), + ...displayBoxesAroundRecognizedObjects(size), + ], + ), + ); + } + + Future loadYoloModel() async { + await widget.vision.loadYoloModel( + labels: 'assets/labels.txt', + modelPath: 'assets/yolov8m_float16.tflite', + modelVersion: "yolov8", + quantization: false, + numThreads: 2, + useGpu: true, + ); + setState(() { + isLoaded = true; + }); + } + + Future pickImage() async { + final ImagePicker picker = ImagePicker(); + final XFile? photo = await picker.pickImage(source: ImageSource.gallery); + if (photo != null) { + setState(() { + imageFile = File(photo.path); + yoloOnImage(); + }); + } + } + + yoloOnImage() async { + yoloResults.clear(); + Uint8List byte = await imageFile!.readAsBytes(); + final image = await decodeImageFromList(byte); + imageHeight = image.height; + imageWidth = image.width; + final result = await widget.vision.yoloOnImage( + bytesList: byte, + imageHeight: image.height, + imageWidth: image.width, + iouThreshold: 0.8, + confThreshold: 0.2, + classThreshold: 0.3, + ); + if (result.isNotEmpty) { + setState(() { + yoloResults = result; + }); + } + } + + List displayBoxesAroundRecognizedObjects(Size screen) { + if (yoloResults.isEmpty) return []; + + double factorX = screen.width / (imageWidth); + double imgRatio = imageWidth / imageHeight; + double newWidth = imageWidth * factorX; + double newHeight = newWidth / imgRatio; + double factorY = newHeight / (imageHeight); + + double pady = (screen.height - newHeight) / 2; + + Color colorPick = const Color.fromARGB(255, 50, 233, 30); + return yoloResults.map((result) { + return Positioned( + left: result["box"][0] * factorX, + top: result["box"][1] * factorY + pady, + width: (result["box"][2] - result["box"][0]) * factorX, + height: (result["box"][3] - result["box"][1]) * factorY, + child: Container( + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(10.0)), + border: Border.all(color: Colors.pink, width: 2.0), + ), + child: Text( + "${result['tag']} ${(result['box'][4] * 100).toStringAsFixed(0)}%", + style: TextStyle( + background: Paint()..color = colorPick, + color: Colors.white, + fontSize: 12.0, + ), + ), + ), + ); + }).toList(); + } +} \ No newline at end of file diff --git a/lib/main_production.dart b/lib/main_production.dart new file mode 100644 index 0000000..f420fdb --- /dev/null +++ b/lib/main_production.dart @@ -0,0 +1,8 @@ +import 'configuration/app_build_config.dart'; +import 'data/enums/environment_enum.dart'; +import 'init.dart'; + +void main() async{ + AppBuildConfig.instantiate(config: BuildConfigEnum.production); + await init(); +} \ No newline at end of file diff --git a/lib/main_staging.dart b/lib/main_staging.dart new file mode 100644 index 0000000..34323f9 --- /dev/null +++ b/lib/main_staging.dart @@ -0,0 +1,12 @@ +import 'configuration/app_build_config.dart'; +import 'data/enums/environment_enum.dart'; +import 'init.dart'; + + +void main() async{ + AppBuildConfig.instantiate(config: BuildConfigEnum.staging); + await init(); +} + + + diff --git a/lib/presentation/base/base_view.dart b/lib/presentation/base/base_view.dart new file mode 100644 index 0000000..c938895 --- /dev/null +++ b/lib/presentation/base/base_view.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:get/get.dart'; + +import '../../components/dismissable_keyboard.dart'; +import '../../components/progress_container.dart'; +import '../../styles/colors.dart'; +import 'base_view_model.dart'; + +abstract class BaseView extends GetView{ + const BaseView({super.key}); + + Widget body(BuildContext context); + + PreferredSizeWidget? appBar(BuildContext context); + + @override + Widget build(BuildContext context) { + return annotatedRegion(context); + } + + Widget annotatedRegion(BuildContext context) { + return AnnotatedRegion( + value: SystemUiOverlayStyle( + //Status bar color for android + statusBarColor: statusBarColor(), + statusBarBrightness: Brightness.dark, + statusBarIconBrightness: Brightness.dark, + ), + child: pageScaffold(context), + ); + } + + Widget pageScaffold(BuildContext context) { + return DismissKeyboard( + child: Scaffold( + backgroundColor: backgroundColor(), + appBar: appBar(context), + floatingActionButton: floatingActionButton(), + body: pageContent(context), + bottomNavigationBar: bottomNavigationBar(), + floatingActionButtonLocation: + FloatingActionButtonLocation.centerFloat, + drawer: drawer(), + ), + ); + } + + Color statusBarColor() { + return AppColors.heroWhite; + } + + Color backgroundColor() { + return AppColors.heroWhite; + } + + Widget? floatingActionButton() { + return null; + } + + Widget pageContent(BuildContext context) { + return SafeArea( + child: body(context), + ); + } + Widget? drawer() { + return null; + } + + Widget? bottomNavigationBar() { + return null; + } +} \ No newline at end of file diff --git a/lib/presentation/base/base_view_model.dart b/lib/presentation/base/base_view_model.dart new file mode 100644 index 0000000..ccb6115 --- /dev/null +++ b/lib/presentation/base/base_view_model.dart @@ -0,0 +1,37 @@ +import 'package:dio/dio.dart'; +import 'package:get/get.dart'; + +import '../../components/loading_container.dart'; +import '../../styles/colors.dart'; + +class BaseViewModel extends GetxController { + final _loadingContainer = false.obs; + + final cancelToken = CancelToken(); + bool get isLoadingContainer => _loadingContainer.value; + + _updateLoadingContainer(bool isLoading) => _loadingContainer(isLoading); + + showLoadingContainer() => _updateLoadingContainer(true); + + hideLoadingContainer() => _updateLoadingContainer(false); + + void closeLoadingDialog() { + Get.isDialogOpen ?? false ? Get.back() : null; + } + + void showLoadingDialog() { + Get.dialog( + const LoadingContainer( + height: 200, + width: 200, + bgColor: AppColors.heroWhite, padding: 32), + ); + } + + @override + void onClose() { + cancelToken.cancel(); + super.onClose(); + } +} \ No newline at end of file diff --git a/lib/presentation/home/binding/home_binding.dart b/lib/presentation/home/binding/home_binding.dart new file mode 100644 index 0000000..5234273 --- /dev/null +++ b/lib/presentation/home/binding/home_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../view_model/home_view_model.dart'; + +class HomeBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => HomeViewModel(), + ); + } +} diff --git a/lib/presentation/home/view/home_view.dart b/lib/presentation/home/view/home_view.dart new file mode 100644 index 0000000..6303dd6 --- /dev/null +++ b/lib/presentation/home/view/home_view.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:snap_and_cook_mobile/styles/text_styles/tt_commons_text_styles.dart'; + +import '../../../components/appbar/basic_appbar.dart'; +import '../../base/base_view.dart'; +import '../view_model/home_view_model.dart'; + +class HomeView extends BaseView { + const HomeView({super.key}); + + @override + PreferredSizeWidget? appBar(BuildContext context) { + return BasicAppBar(appBarTitleText: "", centerTitle: false); + } + + @override + Widget body(BuildContext context) { + return Column( + children: [ + const SizedBox( + width: double.infinity, + ), + Text(controller.version, style: TTCommonsTextStyles.textLg.textMedium()), + const SizedBox( + height: 32, + ), + ], + ); + } +} diff --git a/lib/presentation/home/view_model/home_view_model.dart b/lib/presentation/home/view_model/home_view_model.dart new file mode 100644 index 0000000..45466ad --- /dev/null +++ b/lib/presentation/home/view_model/home_view_model.dart @@ -0,0 +1,18 @@ +import 'package:get/get.dart'; + +import '../../../resources/constants/session_constants.dart'; +import '../../../routes/routes/main_route.dart'; +import '../../../utils/session/session.dart'; +import '../../base/base_view_model.dart'; + +class HomeViewModel extends BaseViewModel { + String version = "Version 0.0.1-dev"; + + @override + void onReady() { + super.onReady(); + } + + @override + void onClose() {} +} diff --git a/lib/presentation/recipe_detection/binding/recipe_detection_binding.dart b/lib/presentation/recipe_detection/binding/recipe_detection_binding.dart new file mode 100644 index 0000000..d7b61cf --- /dev/null +++ b/lib/presentation/recipe_detection/binding/recipe_detection_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../view_model/recipe_detection_view_model.dart'; + +class RecipeDetectionBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => RecipeDetectionViewModel(), + ); + } +} diff --git a/lib/presentation/recipe_detection/view/recipe_detection_view.dart b/lib/presentation/recipe_detection/view/recipe_detection_view.dart new file mode 100644 index 0000000..5fd95ff --- /dev/null +++ b/lib/presentation/recipe_detection/view/recipe_detection_view.dart @@ -0,0 +1,83 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../components/appbar/basic_appbar.dart'; +import '../../base/base_view.dart'; +import '../view_model/recipe_detection_view_model.dart'; + +class RecipeDetectionView extends BaseView { + const RecipeDetectionView({super.key}); + + @override + PreferredSizeWidget? appBar(BuildContext context) { + return BasicAppBar(appBarTitleText: "Detection", centerTitle: true); + } + + @override + Widget body(BuildContext context) { + return Column( + children: [ + Expanded( + child: _detection(context)), + TextButton( + onPressed: controller.pickImage, + child: const Text("ambil gmbr serah"), + ) + ], + ); + } + + Widget _detection(BuildContext context) { + return Stack( + fit: StackFit.expand, + children: [ + Obx(() { + if (controller.imageBytes.value != null) { + return Image.memory(controller.imageBytes.value!, fit: BoxFit.contain,); + } else { + return const SizedBox(); + } + }), + // ...displayBoxesAroundRecognizedObjects(MediaQuery.of(context).size), + ], + ); + } + + List displayBoxesAroundRecognizedObjects(Size screen) { + if (controller.modelResults.isEmpty) return []; + + double factorX = screen.width / (controller.imageWidth.value); + double imgRatio = + controller.imageWidth.value / controller.imageHeight.value; + double newWidth = controller.imageWidth.value * factorX; + double newHeight = newWidth / imgRatio; + double factorY = newHeight / (controller.imageHeight.value); + + double pady = (screen.height - newHeight) / 2; + + Color colorPick = const Color.fromARGB(255, 50, 233, 30); + return controller.modelResults.map((result) { + return Positioned( + left: result["box"][0] * factorX, + top: result["box"][1] * factorY + pady, + width: (result["box"][2] - result["box"][0]) * factorX, + height: (result["box"][3] - result["box"][1]) * factorY, + child: Container( + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(10.0)), + border: Border.all(color: Colors.pink, width: 2.0), + ), + child: Text( + "${result['tag']} ${(result['box'][4] * 100).toStringAsFixed(0)}%", + style: TextStyle( + background: Paint()..color = colorPick, + color: Colors.white, + fontSize: 12.0, + ), + ), + ), + ); + }).toList(); + } +} diff --git a/lib/presentation/recipe_detection/view_model/recipe_detection_view_model.dart b/lib/presentation/recipe_detection/view_model/recipe_detection_view_model.dart new file mode 100644 index 0000000..73cbb74 --- /dev/null +++ b/lib/presentation/recipe_detection/view_model/recipe_detection_view_model.dart @@ -0,0 +1,157 @@ +import 'dart:io'; +import 'dart:typed_data'; +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter_vision/flutter_vision.dart'; +import 'package:get/get.dart'; +import 'package:image_picker/image_picker.dart'; + +import '../../base/base_view_model.dart'; + +class RecipeDetectionViewModel extends BaseViewModel { + final FlutterVision _vision = FlutterVision(); + RxList> modelResults = RxList(); + Rxn imageFile = Rxn(); + RxInt imageHeight = RxInt(1); + RxInt imageWidth = RxInt(1); + RxBool isLoadingModel = RxBool(false); + RxBool isProcessingModel = RxBool(false); + Rxn imageBytes = Rxn(); + + @override + void onInit() { + super.onInit(); + _loadMachineLearningModel(); + } + + Future _loadMachineLearningModel() async { + isLoadingModel.value = true; + await _vision.loadYoloModel( + labels: 'assets/labels.txt', + modelPath: 'assets/yolov8m_float16.tflite', + modelVersion: "yolov8", + quantization: false, + numThreads: 2, + useGpu: true, + ); + isLoadingModel.value = false; + } + + Future pickImage() async { + final ImagePicker picker = ImagePicker(); + final XFile? photo = await picker.pickImage(source: ImageSource.gallery); + if (photo != null) { + imageFile.value = File(photo.path); + _detectIngredients(); + } + } + + void _detectIngredients() async { + modelResults.clear(); + Uint8List byte = await imageFile.value!.readAsBytes(); + final image = await decodeImageFromList(byte); + imageHeight.value = image.height; + imageWidth.value = image.width; + + showLoadingDialog(); + final result = await _vision.yoloOnImage( + bytesList: byte, + imageHeight: image.height, + imageWidth: image.width, + iouThreshold: 0.8, + confThreshold: 0.2, + classThreshold: 0.3, + ); + closeLoadingDialog(); + if (result.isNotEmpty) { + modelResults.value = result; + imageBytes.value = await drawOnImage( modelResults); + } + } + + Future drawOnImage(List> modelResults) async { + final image = imageFile.value; + if (image == null) { + return Uint8List(0); + } + + final imgBytes = image.readAsBytesSync(); + final img = await decodeImageFromList(Uint8List.fromList(imgBytes)); + + final recorder = PictureRecorder(); + final canvas = Canvas(recorder); + canvas.drawImage(img, Offset.zero, Paint()); + drawBoxesOnCanvas(canvas, Size(img.width.toDouble(), img.height.toDouble()), modelResults); + + final picture = recorder.endRecording(); + final imgWithBoxes = await picture.toImage(img.width, img.height); + final ByteData? byteData = await imgWithBoxes.toByteData(format: ImageByteFormat.png); + + return byteData!.buffer.asUint8List(); + } + + void drawBoxesOnCanvas(Canvas canvas, Size screen, List> modelResults) { + if (modelResults.isEmpty) return; + + double factorX = screen.width / imageWidth.value; + double imgRatio = imageWidth.value / imageHeight.value; + double newWidth = imageWidth.value * factorX; + double newHeight = newWidth / imgRatio; + double factorY = newHeight / imageHeight.value; + + double pady = (screen.height - newHeight) / 2; + + Color colorPick = const Color.fromARGB(255, 50, 233, 30); + + final Paint boxPaint = Paint() + ..color = Colors.pink + ..style = PaintingStyle.stroke + ..strokeWidth = 4.0; + + final Paint textBackgroundPaint = Paint() + ..color = colorPick; + + const TextStyle textStyle = TextStyle( + color: Colors.white, + fontSize: 28.0, + ); + + for (Map result in modelResults) { + double left = result["box"][0] * factorX; + double top = result["box"][1] * factorY + pady; + double width = (result["box"][2] - result["box"][0]) * factorX; + double height = (result["box"][3] - result["box"][1]) * factorY; + + Rect rect = Rect.fromLTWH(left, top, width, height); + canvas.drawRect(rect, boxPaint); + + TextSpan textSpan = TextSpan( + text: "${result['tag']} ${(result['box'][4] * 100).toStringAsFixed(0)}%", + style: textStyle, + ); + TextPainter textPainter = TextPainter( + text: textSpan, + textAlign: TextAlign.center, + textDirection: TextDirection.ltr, + ); + + textPainter.layout(); + Offset textOffset = Offset(left, top - textPainter.height - 2.0); + + Rect textBackgroundRect = Rect.fromPoints( + Offset(textOffset.dx, textOffset.dy), + Offset(textOffset.dx + textPainter.width, textOffset.dy + textPainter.height), + ); + canvas.drawRect(textBackgroundRect, textBackgroundPaint); + textPainter.paint(canvas, textOffset); + } + } + + @override + void onClose() { + _vision.closeYoloModel(); + super.onClose(); + } +} diff --git a/lib/presentation/splash/binding/splash_binding.dart b/lib/presentation/splash/binding/splash_binding.dart new file mode 100644 index 0000000..a7fc055 --- /dev/null +++ b/lib/presentation/splash/binding/splash_binding.dart @@ -0,0 +1,12 @@ +import 'package:get/get.dart'; + +import '../view_model/splash_view_model.dart'; + +class SplashBinding extends Bindings { + @override + void dependencies() { + Get.lazyPut( + () => SplashViewModel(), + ); + } +} diff --git a/lib/presentation/splash/view/splash_view.dart b/lib/presentation/splash/view/splash_view.dart new file mode 100644 index 0000000..d52d44e --- /dev/null +++ b/lib/presentation/splash/view/splash_view.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:snap_and_cook_mobile/styles/text_styles/tt_commons_text_styles.dart'; +import '../../../components/asset_image_view.dart'; +import '../../../styles/values.dart'; +import '../../base/base_view.dart'; +import '../view_model/splash_view_model.dart'; +import '../../../components/appbar/basic_appbar.dart'; +import '../../../styles/images.dart'; + +class SplashView extends BaseView { + const SplashView({super.key}); + + @override + PreferredSizeWidget? appBar(BuildContext context) { + return BasicAppBar(appBarTitleText: "", centerTitle: false); + } + + @override + Widget body(BuildContext context) { + return Column( + children: [ + const SizedBox( + width: double.infinity, + ), + const Expanded( + child: AssetImageView( + fileName: AppImages.logoFull, + width: AppValues.logoWidth, + height: AppValues.logoHeight, + )), + Text(controller.version, style: TTCommonsTextStyles.textLg.textMedium()), + const SizedBox( + height: 32, + ), + ], + ); + } +} diff --git a/lib/presentation/splash/view_model/splash_view_model.dart b/lib/presentation/splash/view_model/splash_view_model.dart new file mode 100644 index 0000000..8558281 --- /dev/null +++ b/lib/presentation/splash/view_model/splash_view_model.dart @@ -0,0 +1,22 @@ +import 'package:get/get.dart'; + +import '../../../routes/routes/main_route.dart'; +import '../../base/base_view_model.dart'; + +class SplashViewModel extends BaseViewModel { + String version = "Version 0.0.1-dev"; + + @override + void onReady() { + super.onReady(); + _startSplash(); + } + + @override + void onClose() {} + + Future _startSplash() async { + await Future.delayed(const Duration(seconds: 2)); + Get.offNamed(MainRoute.detection); + } +} diff --git a/lib/resources/arguments/argument_constants.dart b/lib/resources/arguments/argument_constants.dart new file mode 100644 index 0000000..0446717 --- /dev/null +++ b/lib/resources/arguments/argument_constants.dart @@ -0,0 +1,11 @@ +class ArgumentConstants { + static const String phoneNumber = "phone_number_args"; + static const String forgotPasswordCode = "forgot_password_code_args"; + + static const String isPhoneNumberNotRegistered = "is_phone_number_not_registered"; + static const String otpCalledFrom = "otp_called_from_args"; + + //Success Screen + static const String successContentType = "success_screen_args"; +} + diff --git a/lib/resources/arguments/value_constants.dart b/lib/resources/arguments/value_constants.dart new file mode 100644 index 0000000..34c3848 --- /dev/null +++ b/lib/resources/arguments/value_constants.dart @@ -0,0 +1,8 @@ +class ValueConstants { + static const String successVerifyOtp = "successVerifyOtp"; + static const String successVerifyPhoneNumber = "successVerifyPhoneNumber"; + static const String successChangePassword = "successChangePassword"; + + static const String calledFromRegister = "calledFromRegister"; + static const String calledFromPhoneNumberCheck = "calledFromPhoneNumberCheck"; +} diff --git a/lib/resources/constants/environtment_constant.dart b/lib/resources/constants/environtment_constant.dart new file mode 100644 index 0000000..ca004a6 --- /dev/null +++ b/lib/resources/constants/environtment_constant.dart @@ -0,0 +1,19 @@ + + +class EnvironmentConstant { + static const baseUrl = "BASE_URL"; + + static const firebaseApiKeyAndroid = "FIREBASE_API_KEY_ANDROID"; + static const firebaseAppIdAndroid = "FIREBASE_APP_ID_ANDROID"; + static const firebaseMessagingSenderIdAndroid = "FIREBASE_MESSAGING_SENDER_ID_ANDROID"; + static const firebaseProjectIdAndroid = "FIREBASE_PROJECT_ID_ANDROID"; + static const firebaseStrokeBucketAndroid = "FIREBASE_STORE_BUCKET_ANDROID"; + + static const firebaseApiKeyIos = "FIREBASE_API_KEY_IOS"; + static const firebaseAppIdIos = "FIREBASE_APP_ID_IOS"; + static const firebaseMessagingSenderIdIos = "FIREBASE_MESSAGING_SENDER_ID_IOS"; + static const firebaseProjectIdIos = "FIREBASE_PROJECT_ID_IOS"; + static const firebaseStrokeBucketIos = "FIREBASE_STORE_BUCKET_IOS"; + static const firebaseIosClientId = "FIREBASE_IOS_CLIENT_ID"; + static const firebaseIosBundleId = "FIREBASE_IOS_BUNDLE_ID"; +} \ No newline at end of file diff --git a/lib/resources/constants/session_constants.dart b/lib/resources/constants/session_constants.dart new file mode 100644 index 0000000..061508d --- /dev/null +++ b/lib/resources/constants/session_constants.dart @@ -0,0 +1,4 @@ +class SessionConstants { + static const String token = "session_token"; + static const String isAlreadyOnBoarding = "session_is_already_on_boarding"; +} diff --git a/lib/resources/services/recipe_service_constant.dart b/lib/resources/services/recipe_service_constant.dart new file mode 100644 index 0000000..bec909a --- /dev/null +++ b/lib/resources/services/recipe_service_constant.dart @@ -0,0 +1,5 @@ +class RecipeServiceConstants { + static const String listRecipe = 'recipes'; + static const String detailRecipe = 'recipe/{uuid}'; + static const String recipeRecommendation = 'recipe/recommendation'; +} \ No newline at end of file diff --git a/lib/routes/routes.dart b/lib/routes/routes.dart new file mode 100644 index 0000000..b6dae9d --- /dev/null +++ b/lib/routes/routes.dart @@ -0,0 +1,5 @@ +import 'routes/main_route.dart'; + +final routes = [ + ...MainRoute.routes, +]; \ No newline at end of file diff --git a/lib/routes/routes/main_route.dart b/lib/routes/routes/main_route.dart new file mode 100644 index 0000000..9444de8 --- /dev/null +++ b/lib/routes/routes/main_route.dart @@ -0,0 +1,32 @@ +import 'package:get/get.dart'; +import 'package:snap_and_cook_mobile/presentation/home/binding/home_binding.dart'; +import 'package:snap_and_cook_mobile/presentation/home/view/home_view.dart'; +import 'package:snap_and_cook_mobile/presentation/recipe_detection/binding/recipe_detection_binding.dart'; +import 'package:snap_and_cook_mobile/presentation/recipe_detection/view/recipe_detection_view.dart'; +import '../../presentation/splash/binding/splash_binding.dart'; +import '../../presentation/splash/view/splash_view.dart'; + +class MainRoute { + static const onboards = "/on-boards-page"; + static const splash = "/"; + static const home = "/home-page"; + static const detection = "/recipe-detection-page"; + + static final routes = [ + GetPage( + name: splash, + page: () => const SplashView(), + binding: SplashBinding(), + ), + GetPage( + name: home, + page: () => const HomeView(), + binding: HomeBinding(), + ), + GetPage( + name: detection, + page: () => const RecipeDetectionView(), + binding: RecipeDetectionBinding(), + ), + ]; +} diff --git a/lib/styles/colors.dart b/lib/styles/colors.dart new file mode 100644 index 0000000..ce32bbe --- /dev/null +++ b/lib/styles/colors.dart @@ -0,0 +1,46 @@ + + +import 'dart:ui'; + +class AppColors { + static const Color heroWhite = Color(0xFFFFFFFF); + static const Color heroBlack = Color(0xFF14130E); + + static const Color primaryLightGrey = Color(0xFFCCD2D9); + static const Color primaryLightGrey100 = Color(0xFFCCD2D9); + static const Color primaryLightGrey200 = Color(0xFFEBEDF0); + static const Color primaryLightGrey300 = Color(0xFFE1E4E9); + static const Color primaryLightGrey400 = Color(0xFFD7DBE1); + + + static const Color primaryGrey = Color(0xFF394048); + static const Color primaryGrey100 = Color(0xFFD7D9DB); + static const Color primaryGrey200 = Color(0xFFA4A2A8); + static const Color primaryGrey300 = Color(0xFF888D92); + static const Color primaryGrey400 = Color(0xFF61666D); + + static const Color primaryOrange = Color(0xFFE63A15); + static const Color primaryOrange100 = Color(0xFFFAD8D0); + static const Color primaryOrange200 = Color(0xFFF5B1A1); + static const Color primaryOrange300 = Color(0xFFF08972); + static const Color primaryOrange400 = Color(0xFFEB6243); + + + static const Color semanticRed500 = Color(0xFFD10000); + static const Color semanticGreen500 = Color(0xFF069A4D); + static const Color semanticOrange500 = Color(0xFFFB8C00); + static const Color semanticBlue500 = Color(0xFF1E88E5); + + static const Color semanticRed300 = Color(0xFFD10000); + static const Color semanticGreen300 = Color(0xFFD0E9D2); + static const Color semanticOrange300 = Color(0xFFFB8C00); + static const Color semanticBlue300 = Color(0xFF1E88E5); + + static const Color semanticRed100 = Color(0xFFD10000); + static const Color semanticGreen100 = Color(0xFFEEFBEF); + static const Color semanticOrange100 = Color(0xFFFB8C00); + static const Color semanticBlue100 = Color(0xFF1E88E5); + + + +} \ No newline at end of file diff --git a/lib/styles/form/form_border_side.dart b/lib/styles/form/form_border_side.dart new file mode 100644 index 0000000..2e0a56d --- /dev/null +++ b/lib/styles/form/form_border_side.dart @@ -0,0 +1,21 @@ +import 'package:flutter/cupertino.dart'; + +import '../colors.dart'; + +class FormBorderSide { + + // Border Side + static BorderSide get sideNormal => + const BorderSide(width: 1, color: AppColors.primaryGrey300); + static BorderSide get sideInactive => + const BorderSide(width: 1, color: AppColors.primaryGrey300); + static BorderSide get sideFocused => + const BorderSide(width: 2, color: AppColors.heroBlack); + static BorderSide get sideError => + const BorderSide(width: 2, color: AppColors.semanticRed500); + static BorderSide get sideInfo => + const BorderSide(width: 1, color: AppColors.semanticOrange500); + static BorderSide get sideSuccess => + const BorderSide(width: 1, color: AppColors.semanticGreen500); + +} diff --git a/lib/styles/form/form_input_borders.dart b/lib/styles/form/form_input_borders.dart new file mode 100644 index 0000000..c192580 --- /dev/null +++ b/lib/styles/form/form_input_borders.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; + +import '../colors.dart'; +import '../radiuses.dart'; +import 'form_border_side.dart'; + +class FormInputBorders { + + + // Outline Input Border + static OutlineInputBorder get normalBorder => OutlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideInactive, + ); + static OutlineInputBorder get focusedBorder => OutlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideFocused, + ); + static OutlineInputBorder get errorBorder => OutlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideError, + ); + static OutlineInputBorder get disabledBorder => OutlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideInactive, + ); + + // Underline Input Border + static UnderlineInputBorder get normalUnderlineBorder => UnderlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideInactive.copyWith( + width: 1, + color: AppColors.heroBlack, + ), + ); + static UnderlineInputBorder get focusedUnderlineBorder => + UnderlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideFocused, + ); + static UnderlineInputBorder get errorUnderlineBorder => UnderlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideError, + ); + static UnderlineInputBorder get disabledUnderlineBorder => + UnderlineInputBorder( + borderRadius: AppBorderRadius.radius4, + borderSide: FormBorderSide.sideInactive, + ); +} diff --git a/lib/styles/icons.dart b/lib/styles/icons.dart new file mode 100644 index 0000000..2102a7b --- /dev/null +++ b/lib/styles/icons.dart @@ -0,0 +1,96 @@ +class GeneralIcons { + // static const share = "icons/share.svg"; + static const asterisk = "assets/icons/ic_asterisk.svg"; + static const account = "assets/icons/ic_account.svg"; + static const addPhoto = "assets/icons/ic_add_photo.svg"; + static const benefit = "assets/icons/ic_benefit.svg"; + static const calendarToday = "assets/icons/ic_calendar_today.svg"; + static const card = "assets/icons/ic_card.svg"; + static const cart = "assets/icons/ic_cart.svg"; + static const check = "assets/icons/ic_check.svg"; + static const checkBoxFilled = "assets/icons/ic_check_box_filled.svg"; + static const checkCircle = "assets/icons/ic_check_circle.svg"; + static const checkCircleFilled = "assets/icons/ic_check_circle_fill.svg"; + static const checkboxActive = "assets/icons/ic_check_active.svg"; + static const checkboxDeactivate = "assets/icons/ic_checkbox_deactivate.svg"; + static const close = "assets/icons/ic_close.svg"; + static const closeCircle = "assets/icons/ic_close_circle.svg"; + static const coffee = "assets/icons/ic_coffee.svg"; + static const compare = "assets/icons/ic_compare.svg"; + static const copy = "assets/icons/ic_copy.svg"; + static const delete = "assets/icons/ic_delete.svg"; + static const delivery = "assets/icons/ic_delivery.svg"; + static const dot = "assets/icons/ic_dot.svg"; + static const eacLogo = "assets/icons/ic_eac_logo.svg"; + static const edit = "assets/icons/ic_edit.svg"; + static const expandLess = "assets/icons/ic_expand_less.svg"; + static const expandMore = "assets/icons/ic_expand_more.svg"; + static const favorite = "assets/icons/ic_favorite.svg"; + static const favoriteFilled = "assets/icons/ic_favorite_fill.svg"; + static const filter = "assets/icons/ic_filers.svg"; + static const help = "assets/icons/ic_help.svg"; + static const home = "assets/icons/ic_home.svg"; + static const info = "assets/icons/ic_info.svg"; + static const left = "assets/icons/ic_left.svg"; + static const locationFilled = "assets/icons/ic_location_filled.svg"; + static const locationOutlined = "assets/icons/ic_location_outline.svg"; + static const logout = "assets/icons/ic_logout.svg"; + static const map = "assets/icons/ic_map.svg"; + static const menu = "assets/icons/ic_menu.svg"; + static const messageSquare = "assets/icons/ic_message_square.svg"; + static const minus = "assets/icons/ic_minus.svg"; + static const moreHorizontal = "assets/icons/ic_more_horizontal.svg"; + static const notification = "assets/icons/ic_notification.svg"; + static const parkingCircle = "assets/icons/ic_parking_circle.svg"; + static const placeholder = "assets/icons/ic_placeholder.svg"; + static const play = "assets/icons/ic_play.svg"; + static const plus = "assets/icons/ic_plus.svg"; + static const prayerTimeOutlined = "assets/icons/ic_prayer_times_outline.svg"; + static const publicToilet = "assets/icons/ic_public_toilet.svg"; + static const radioButtonActive = "assets/icons/ic_radio_button_active.svg"; + static const radioButtonDeactivate = "assets/icons/ic_radio_button_deactivate.svg"; + static const receipt = "assets/icons/ic_receipt.svg"; + static const review = "assets/icons/ic_review.svg"; + static const right = "assets/icons/ic_right.svg"; + static const scan = "assets/icons/ic_scan.svg"; + static const search = "assets/icons/ic_search.svg"; + static const settings = "assets/icons/ic_settings.svg"; + static const share = "assets/icons/ic_share.svg"; + static const share2 = "assets/icons/ic_share2.svg"; + static const shopping = "assets/icons/ic_shop.svg"; + static const show = "assets/icons/ic_show_active.svg"; + static const hide = "assets/icons/ic_show_deactivate.svg"; + static const facebook = "assets/icons/ic_sosmed_facebook.svg"; + static const instagram = "assets/icons/ic_sosmed_instagram.svg"; + static const twitter = "assets/icons/ic_sosmed_twitter.svg"; + static const whatsapp = "assets/icons/ic_sosmed_whatsapp.svg"; + static const star = "assets/icons/ic_star.svg"; + static const stock = "assets/icons/ic_stock.svg"; + static const store = "assets/icons/ic_store.svg"; + static const story = "assets/icons/ic_story.svg"; + static const time = "assets/icons/ic_time.svg"; + static const warning = "assets/icons/ic_warn.svg"; + static const wifi = "assets/icons/ic_wifi.svg"; + static const eigerAdventureClub = "assets/icons/ic_eiger_adventure_club.png"; +} + +class ActivityIcons { + static const close = "assets/icons/ic_close.svg"; + static const back = "assets/icons/ic_left.svg"; +} + +class TabBarIcons { + static const home = "assets/icons/ic_home.svg"; + static const shopping = "assets/icons/ic_shop.svg"; + static const benefit = "assets/icons/ic_benefit.svg"; + static const scan = "assets/icons/ic_scan.svg"; +} + +class NavBarIcons { + static const back = "assets/icons/ic_left.svg"; + static const search = "assets/icons/ic_search.svg"; + static const barcode = "assets/icons/ic_scan.svg"; + static const cart = "assets/icons/ic_cart.svg"; + static const menu = "assets/icons/ic_menu.svg"; + static const notification = "assets/icons/ic_notification.svg"; +} diff --git a/lib/styles/images.dart b/lib/styles/images.dart new file mode 100644 index 0000000..cc003be --- /dev/null +++ b/lib/styles/images.dart @@ -0,0 +1,3 @@ +class AppImages { + static const logoFull = "assets/images/logo_snapcook_full.png"; +} \ No newline at end of file diff --git a/lib/styles/radiuses.dart b/lib/styles/radiuses.dart new file mode 100644 index 0000000..2d49aad --- /dev/null +++ b/lib/styles/radiuses.dart @@ -0,0 +1,10 @@ + + +import 'package:flutter/material.dart'; + +class AppBorderRadius { + static BorderRadius get radius4 => BorderRadius.circular(4); + static BorderRadius get radius8 => BorderRadius.circular(8); + static BorderRadius get radius10 => BorderRadius.circular(10); + static BorderRadius get radius16 => BorderRadius.circular(16); +} \ No newline at end of file diff --git a/lib/styles/sizes.dart b/lib/styles/sizes.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/styles/text_styles/tt_commons_text_styles.dart b/lib/styles/text_styles/tt_commons_text_styles.dart new file mode 100644 index 0000000..d13fed4 --- /dev/null +++ b/lib/styles/text_styles/tt_commons_text_styles.dart @@ -0,0 +1,225 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class TTCommonsTextStyles { + /* text */ + static final textXxs = _TextXxs(); + static final textXs = _TextXs(); + static final textSm = _TextSm(); + static final textMd = _TextMd(); + static final textLg = _TextLg(); + static final textXl = _TextXl(); + + /* display */ + static final displayXs = _DisplayXs(); + static final displaySm = _DisplaySm(); + static final displayMd = _DisplayMd(); + static final displayLg = _DisplayLg(); + static final displayXl = _DisplayXl(); + static final display2Xl = _Display2Xl(); +} + +abstract class _TTCommonsStyles { + TextStyle modify(TextStyle style); + + TextStyle _style() { + return modify(const TextStyle( + fontFamily: 'TTCommons', + )); + } + + TextStyle textRegular() { + return _style().copyWith( + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + ); + } + + TextStyle textMedium() { + return _style().copyWith( + fontWeight: FontWeight.w500, + fontStyle: FontStyle.normal, + ); + } + + TextStyle textSemiBold() { + return _style().copyWith( + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + ); + } + + TextStyle textBold() { + return _style().copyWith( + fontWeight: FontWeight.w700, + fontStyle: FontStyle.normal, + ); + } + + TextStyle textRegularItalic() { + return _style().copyWith( + fontWeight: FontWeight.w400, + fontStyle: FontStyle.italic, + ); + } + + TextStyle textMediumItalic() { + return _style().copyWith( + fontWeight: FontWeight.w500, + fontStyle: FontStyle.italic, + ); + } + + TextStyle textSemiBoldItalic() { + return _style().copyWith( + fontWeight: FontWeight.w600, + fontStyle: FontStyle.italic, + ); + } + + TextStyle textTextBoldItalic() { + return _style().copyWith( + fontWeight: FontWeight.w700, + fontStyle: FontStyle.italic, + ); + } + + TextStyle textRegularUnderlined() { + return _style().copyWith( + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + decoration: TextDecoration.underline); + } + + TextStyle textMediumUnderlined() { + return _style().copyWith( + fontWeight: FontWeight.w500, + fontStyle: FontStyle.normal, + decoration: TextDecoration.underline); + } + + TextStyle textSemiBoldUnderlined() { + return _style().copyWith( + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + decoration: TextDecoration.underline); + } + + TextStyle textTextBoldUnderlined() { + return _style().copyWith( + fontWeight: FontWeight.w700, + fontStyle: FontStyle.normal, + decoration: TextDecoration.underline); + } +} + +/* text class styles */ +class _TextXxs extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 10.sp, + ); + } +} + +class _TextXs extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 12.sp, + ); + } +} + +class _TextSm extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 14.sp, + ); + } +} + +class _TextMd extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 16.sp, + ); + } +} + +class _TextLg extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 18.sp, + ); + } +} + +class _TextXl extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 20.sp, + ); + } +} + +/* display class styles */ +class _DisplayXs extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 24.sp, + ); + } +} + +class _DisplaySm extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 30.sp, + ); + } +} + +class _DisplayMd extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 36.sp, + ); + } +} + +class _DisplayLg extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 48.sp, + ); + } +} + +class _DisplayXl extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 60.sp, + ); + } +} + +class _Display2Xl extends _TTCommonsStyles { + @override + TextStyle modify(TextStyle style) { + return style.copyWith( + fontSize: 72.sp, + ); + } +} diff --git a/lib/styles/themes.dart b/lib/styles/themes.dart new file mode 100644 index 0000000..bb9fb92 --- /dev/null +++ b/lib/styles/themes.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; + +import 'colors.dart'; +import 'text_styles/tt_commons_text_styles.dart'; + +class AppTheme { + static ThemeData get mainTheme { + return ThemeData( + primaryColor: AppColors.primaryOrange, + scaffoldBackgroundColor: AppColors.heroWhite, + dialogBackgroundColor: AppColors.heroWhite, + dividerColor: Colors.transparent, + appBarTheme: const AppBarTheme( + backgroundColor: AppColors.heroWhite), + bottomAppBarTheme: + const BottomAppBarTheme(color: AppColors.heroWhite, elevation: 4.0), + + // dividerColor: AppColors.basicBlack13, + + // text theme + textTheme: TextTheme( + displaySmall: TTCommonsTextStyles.displayXs.textBold() + ), + + // text button theme + textButtonTheme: TextButtonThemeData( + style: const ButtonStyle().copyWith( + textStyle: MaterialStateProperty.all( + TTCommonsTextStyles.textSm.textMedium() + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/styles/values.dart b/lib/styles/values.dart new file mode 100644 index 0000000..c4fd84c --- /dev/null +++ b/lib/styles/values.dart @@ -0,0 +1,17 @@ +abstract class AppValues { + static const double logoHeight = 120; + static const double logoWidth = 84; + + static const double padding = 16; + static const double halfPadding = 8; + static const double smallPadding = 10; + static const double extraSmallPadding = 6; + static const double largePadding = 24; + static const double extraLargePadding = 32; + static const double buttonVerticalPadding = 12; + + static const double margin = 16; + static const double smallMargin = 8; + static const double extraSmallMargin = 6; + static const double largeMargin = 24; +} diff --git a/lib/utils/extension/dio_extension.dart b/lib/utils/extension/dio_extension.dart new file mode 100644 index 0000000..0e1b04c --- /dev/null +++ b/lib/utils/extension/dio_extension.dart @@ -0,0 +1,21 @@ +import 'package:dio/dio.dart'; + +extension DioExtention on Dio { + Dio addInterceptor(Interceptor interceptor) { + interceptors.add(interceptor); + return this; + } + + Dio baseUrl(String baseUrl) { + options = BaseOptions( + baseUrl: baseUrl, + connectTimeout: 60 * 1000, + receiveTimeout: 60 * 1000, + ); + return this; + } + Dio modify(Function (Dio) modify) { + modify.call(this); + return this; + } +} diff --git a/lib/utils/extension/int_extension.dart b/lib/utils/extension/int_extension.dart new file mode 100644 index 0000000..fd02e36 --- /dev/null +++ b/lib/utils/extension/int_extension.dart @@ -0,0 +1,8 @@ +extension IntExtension on int { + String toTimerCountDown(){ + if (this < 10){ + return "00:0$this"; + } + return "00:$this"; + } +} diff --git a/lib/utils/extension/null_extension.dart b/lib/utils/extension/null_extension.dart new file mode 100644 index 0000000..1518ee0 --- /dev/null +++ b/lib/utils/extension/null_extension.dart @@ -0,0 +1,9 @@ +extension NullIntExtension on int? { + +} + +extension NullBooleanExtension on bool? { + bool toDefault(){ + return this ?? false; + } +} \ No newline at end of file diff --git a/lib/utils/extension/password_extension.dart b/lib/utils/extension/password_extension.dart new file mode 100644 index 0000000..461ad62 --- /dev/null +++ b/lib/utils/extension/password_extension.dart @@ -0,0 +1,17 @@ +extension PasswordExtention on String { + bool isCorrectPasswordLength() { + return length >= 8; + } + + bool isContainsOneCapital() { + return contains(RegExp(r'[A-Z]')); + } + + bool isContainsOneDigit() { + return contains(RegExp(r'\d')); + } + + bool isContainsOneSpecialSymbol() { + return contains(RegExp(r'[!@#$%^&*]')); + } +} diff --git a/lib/utils/extension/string_extension.dart b/lib/utils/extension/string_extension.dart new file mode 100644 index 0000000..a4b5854 --- /dev/null +++ b/lib/utils/extension/string_extension.dart @@ -0,0 +1,20 @@ +extension StringConverter on String { + bool isEmailValid() { + RegExp regex = RegExp( + r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"); + if (regex.hasMatch(this)) { + return true; + } else { + return false; + } + } + + String formatToIdnPhone() { + if (startsWith("0")) { + String phoneNumber = replaceFirst("0", "+62"); + return phoneNumber; + } + return "+${trim()}"; + } + +} diff --git a/lib/utils/interceptor/authorization_header_interceptor.dart b/lib/utils/interceptor/authorization_header_interceptor.dart new file mode 100644 index 0000000..db9c6df --- /dev/null +++ b/lib/utils/interceptor/authorization_header_interceptor.dart @@ -0,0 +1,38 @@ +import 'package:dio/dio.dart'; + +typedef TokenCallback = Future Function(); + +class AuthorizationHeaderInterceptor extends Interceptor { + TokenCallback onToken; + + AuthorizationHeaderInterceptor({required this.onToken}); + + @override + void onRequest( + RequestOptions options, RequestInterceptorHandler handler) async { + String token = await onToken(); + bool authorization = true; + if (options.headers.values.isNotEmpty) { + options.headers.forEach((key, value) { + if (key == "Authorization" && value == "disable") { + authorization = false; + } + }); + } + + if (authorization) { + if (options.headers.entries + .where((element) => element.key == "Authorization") + .isEmpty) { + options.headers.addAll({ + 'content-type': 'application/json', + 'Authorization': "Bearer $token" + }); + } + } else { + options.headers.removeWhere( + (key, value) => key == "Authorization" && value == "disable"); + } + super.onRequest(options, handler); + } +} diff --git a/lib/utils/json_serializable_util.dart b/lib/utils/json_serializable_util.dart new file mode 100644 index 0000000..cea1f6c --- /dev/null +++ b/lib/utils/json_serializable_util.dart @@ -0,0 +1,40 @@ +import 'package:intl/intl.dart'; + +class JsonSerializableUtil { + static DateTime? fromJsonYyyyMmDdTHhMmSsZ(String? date) { + if (date != null && date.isNotEmpty) { + try { + return DateFormat("yyyy-MM-ddTHH:mm:ssZ").parse(date); + } catch (e) { + try { + return DateFormat("yyyy-MM-dd HH:mm:ss").parse(date); + } catch (e) { + return null; + } + } + } + return null; + } + + static String? toJsonYyyyMmDdTHhMmSsZ(DateTime? date) { + if (date != null) { + try { + return DateFormat("yyyy-MM-ddTHH:mm:ssZ").format(date); + } catch (e) { + try { + return DateFormat("yyyy-MM-dd HH:mm:ss").format(date); + } catch (e) { + return null; + } + } + } + return null; + } +} + +class DateTimeWithBool { + final DateTime date; + bool isScheduleYyyMmDdHhMmSs; + + DateTimeWithBool({required this.date, this.isScheduleYyyMmDdHhMmSs = true}); +} diff --git a/lib/utils/session/session.dart b/lib/utils/session/session.dart new file mode 100644 index 0000000..670df3f --- /dev/null +++ b/lib/utils/session/session.dart @@ -0,0 +1,17 @@ +import 'package:shared_preferences/shared_preferences.dart'; + +class Session { + + static Future set(String key, String value) async { + SharedPreferences pref = await SharedPreferences.getInstance(); + return pref.setString(key, value); + } + static Future get(String key) async{ + SharedPreferences pref = await SharedPreferences.getInstance(); + return pref.getString(key); + } + static Future remove(String key) async{ + SharedPreferences pref = await SharedPreferences.getInstance(); + return pref.remove(key); + } +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..79d9588 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1042 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "67d591d602906ef9201caf93452495ad1812bea2074f04e25dbd7c133785821b" + url: "https://pub.dev" + source: hosted + version: "2.4.7" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + url: "https://pub.dev" + source: hosted + version: "7.2.11" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "69acb7007eb2a31dc901512bfe0f7b767168be34cb734835d54c070bfa74c1b2" + url: "https://pub.dev" + source: hosted + version: "8.8.0" + camera: + dependency: "direct main" + description: + name: camera + sha256: "71fb0e03618a8629a912bbf49bb664869bd16830c1d363b1096df99727b0bebb" + url: "https://pub.dev" + source: hosted + version: "0.10.5+6" + camera_android: + dependency: transitive + description: + name: camera_android + sha256: b63304d553dde613ca68fb40aaa76bbbcdbd051683bdbf2019671ec8d9645ce7 + url: "https://pub.dev" + source: hosted + version: "0.10.8+14" + camera_avfoundation: + dependency: transitive + description: + name: camera_avfoundation + sha256: "3b6d9f550cfd658c71f34a99509528501e5e5d4fa79f11e3a4d6ef380d8e0254" + url: "https://pub.dev" + source: hosted + version: "0.9.13+7" + camera_platform_interface: + dependency: transitive + description: + name: camera_platform_interface + sha256: "86fd4fc597c6e455265ddb5884feb352d0171ad14b9cdf3aba30da59b25738c4" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + camera_web: + dependency: transitive + description: + name: camera_web + sha256: "012c82efeb6b69626f1cf7a37c5277c1032428bcae98c7ab6401ff5e91eca628" + url: "https://pub.dev" + source: hosted + version: "0.3.2+2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: b2151ce26a06171005b379ecff6e08d34c470180ffe16b8e14b6d52be292b55f + url: "https://pub.dev" + source: hosted + version: "4.8.0" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" + url: "https://pub.dev" + source: hosted + version: "0.3.3+7" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" + source: hosted + version: "1.0.6" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + dartz: + dependency: "direct dev" + description: + name: dartz + sha256: e6acf34ad2e31b1eb00948692468c30ab48ac8250e0f0df661e29f12dd252168 + url: "https://pub.dev" + source: hosted + version: "0.10.1" + dio: + dependency: "direct main" + description: + name: dio + sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + url: "https://pub.dev" + source: hosted + version: "4.0.6" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_image_compress: + dependency: "direct main" + description: + name: flutter_image_compress + sha256: "37f1b26399098e5f97b74c1483f534855e7dff68ead6ddaccf747029fb03f29f" + url: "https://pub.dev" + source: hosted + version: "1.1.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.dev" + source: hosted + version: "2.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da + url: "https://pub.dev" + source: hosted + version: "2.0.17" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "8cf100b8e4973dc570b6415a2090b0bfaa8756ad333db46939efc3e774ee100d" + url: "https://pub.dev" + source: hosted + version: "5.9.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.dev" + source: hosted + version: "2.0.9" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_vision: + dependency: "direct main" + description: + name: flutter_vision + sha256: ef1765d992ce39998c25a9d4e2eae7c8e5c4d3fc1f31742a829476fd6758ba6f + url: "https://pub.dev" + source: hosted + version: "1.1.4" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + fluttertoast: + dependency: "direct main" + description: + name: fluttertoast + sha256: dfdde255317af381bfc1c486ed968d5a43a2ded9c931e87cbecd88767d6a71c1 + url: "https://pub.dev" + source: hosted + version: "8.2.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + get: + dependency: "direct main" + description: + name: get + sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" + url: "https://pub.dev" + source: hosted + version: "4.6.5" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http: + dependency: transitive + description: + name: http + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + image_gallery_saver: + dependency: "direct main" + description: + name: image_gallery_saver + sha256: be812580c7a320d3bf583af89cac6b376f170d48000aca75215a73285a3223a0 + url: "https://pub.dev" + source: hosted + version: "1.7.1" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c + url: "https://pub.dev" + source: hosted + version: "0.8.9" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: d6a6e78821086b0b737009b09363018309bbc6de3fd88cc5c26bc2bb44a4957f + url: "https://pub.dev" + source: hosted + version: "0.8.8+2" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "76ec722aeea419d03aa915c2c96bf5b47214b053899088c9abb4086ceecf97a7" + url: "https://pub.dev" + source: hosted + version: "0.8.8+4" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + intl: + dependency: "direct main" + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct dev" + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" + source: hosted + version: "6.7.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + sha256: bc56bfe9d3f44c3c612d8d393bd9b174eb796d706759f9b495ac254e4294baa5 + url: "https://pub.dev" + source: hosted + version: "10.4.5" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "59c6322171c29df93a22d150ad95f3aa19ed86542eaec409ab2691b8f35f9a47" + url: "https://pub.dev" + source: hosted + version: "10.3.6" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" + url: "https://pub.dev" + source: hosted + version: "9.1.4" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4" + url: "https://pub.dev" + source: hosted + version: "3.12.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 + url: "https://pub.dev" + source: hosted + version: "0.1.3" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + photo_gallery: + dependency: "direct main" + description: + name: photo_gallery + sha256: f8daca29042710ba2836a0666f0d18b320e286b5843dcd68d6f1980a2de0c8b2 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + platform: + dependency: transitive + description: + name: platform + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + url: "https://pub.dev" + source: hosted + version: "2.1.7" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + pull_to_refresh: + dependency: "direct main" + description: + name: pull_to_refresh + sha256: bbadd5a931837b57739cf08736bea63167e284e71fb23b218c8c9a6e042aad12 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + retrofit: + dependency: "direct main" + description: + name: retrofit + sha256: "9254ec985d5e26a839a9070ae25b98f0781c9c420e4241c5fb8b8965aa1fc7f2" + url: "https://pub.dev" + source: hosted + version: "3.3.1" + retrofit_generator: + dependency: "direct dev" + description: + name: retrofit_generator + sha256: f5107e842e77ce71c63b995331b43d4597f71df9031389dd93a1197a00118d83 + url: "https://pub.dev" + source: hosted + version: "4.2.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" + url: "https://pub.dev" + source: hosted + version: "2.3.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a + url: "https://pub.dev" + source: hosted + version: "2.3.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf + url: "https://pub.dev" + source: hosted + version: "2.2.1" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + tuple: + dependency: transitive + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + win32: + dependency: transitive + description: + name: win32 + sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" + url: "https://pub.dev" + source: hosted + version: "5.0.9" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.2 <4.0.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..0556723 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,146 @@ +name: snap_and_cook_mobile +description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=3.0.2 <4.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 + flutter_vision: ^1.1.4 + image_picker: ^0.8.6+3 + dio: ^4.0.4 + flutter_svg: ^2.0.2 + fluttertoast: ^8.2.1 + retrofit: ^3.0.1+1 + pull_to_refresh: ^2.0.0 + intl: ^0.17.0 + flutter_screenutil: ^5.6.1 + get: ^4.6.5 + shared_preferences: ^2.2.2 + image_gallery_saver: ^1.7.1 + photo_gallery: ^1.1.1 + flutter_image_compress: ^1.1.0 + camera: ^0.10.3+1 + permission_handler: ^10.2.0 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + retrofit_generator: ^4.0.1 + build_runner: ^2.0.0 + dartz: ^0.10.1 + json_serializable: ^6.0.0 + json_annotation: ^4.8.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # 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 + assets: + - assets/yolov8m_float16.tflite + - assets/labels.txt + - assets/images/ + - assets/fonts/ + + fonts: + - family: TTCommons + fonts: + - asset: assets/fonts/TT-Commons-Regular.ttf + weight: 400 + style: normal + - asset: assets/fonts/TT-Commons-Medium.ttf + weight: 500 + style: normal + - asset: assets/fonts/TT-Commons-SemiBold.ttf + weight: 600 + style: normal + - asset: assets/fonts/TT-Commons-Bold.ttf + weight: 700 + style: normal + + - asset: assets/fonts/TT-Commons-Regular-Italic.ttf + weight: 400 + style: italic + - asset: assets/fonts/TT-Commons-Medium-Italic.ttf + weight: 500 + style: italic + - asset: assets/fonts/TT-Commons-SemiBold-Italic.ttf + weight: 600 + style: italic + - asset: assets/fonts/TT-Commons-Bold-Italic.ttf + weight: 700 + style: italic + + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..965308d --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:snap_and_cook_mobile/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}