├── .gitignore ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_chatgpt │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── api_reponse ├── image_generation_response.json └── text_completion_response.json ├── assets ├── app_logo.png ├── loading.gif └── openai-avatar.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── core │ ├── custom_exceptions.dart │ ├── http_certificate_maneger.dart │ └── open_ai_data.dart ├── features │ ├── app │ │ ├── app_const │ │ │ └── page_const.dart │ │ ├── home │ │ │ ├── home_page.dart │ │ │ └── widgets │ │ │ │ └── home_button_widget.dart │ │ ├── routes │ │ │ └── on_generate_route.dart │ │ └── splash │ │ │ └── splash_screen.dart │ ├── global │ │ ├── common │ │ │ └── common.dart │ │ ├── provider │ │ │ └── provider.dart │ │ └── search_text_field │ │ │ └── search_text_field_widget.dart │ ├── image_generation │ │ ├── data │ │ │ ├── model │ │ │ │ ├── image_generation_data.dart │ │ │ │ └── image_generation_model.dart │ │ │ ├── remote_data_source │ │ │ │ ├── image_generation_remote_data_source.dart │ │ │ │ └── image_generation_remote_data_source_impl.dart │ │ │ └── repositories │ │ │ │ └── image_generation_repository_impl.dart │ │ ├── domain │ │ │ ├── repositories │ │ │ │ └── image_generation_repository.dart │ │ │ └── usecases │ │ │ │ └── image_generation_usecase.dart │ │ ├── image_generation_injection_container.dart │ │ └── presentation │ │ │ ├── cubit │ │ │ ├── image_generation_cubit.dart │ │ │ └── image_generation_state.dart │ │ │ └── pages │ │ │ └── image_generation_page.dart │ └── text_completion │ │ ├── data │ │ ├── model │ │ │ ├── text_completion_data.dart │ │ │ └── text_completion_model.dart │ │ ├── remote_data_source │ │ │ ├── text_completion_remote_data_source.dart │ │ │ └── text_completion_remote_data_source_impl.dart │ │ └── repositories │ │ │ └── text_completion_repository_impl.dart │ │ ├── domain │ │ ├── repositories │ │ │ └── text_completion_repository.dart │ │ └── usecases │ │ │ └── text_completion_usecase.dart │ │ ├── presentation │ │ ├── cubit │ │ │ ├── text_completion_cubit.dart │ │ │ └── text_completion_state.dart │ │ └── pages │ │ │ └── text_completion_page.dart │ │ └── text_completion_injection_container.dart ├── injection_container.dart └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 17 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 18 | - platform: android 19 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 20 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 21 | - platform: ios 22 | create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 23 | base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849 24 | 25 | # User provided section 26 | 27 | # List of Local paths (relative to this file) that should be 28 | # ignored by the migrate tool. 29 | # 30 | # Files that are not part of the templates will be ignored by default. 31 | unmanaged_files: 32 | - 'lib/main.dart' 33 | - 'ios/Runner.xcodeproj/project.pbxproj' 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter ChatGpt with Clean Architecture 2 | 3 | ### Show some and star the repo to support the project 4 | 5 | 6 |
7 | 8 | ChatGPT + Flutter Tutorial - Crash Course on ChatGPT for Beginners 9 |
10 | 11 | 12 | ### Screenshots 13 | 14 |

15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |

23 | 24 | ### Preview 25 |

26 | 27 | ![ezgif com-crop(1)](https://media.giphy.com/media/1rjazDUYO54XUTQJ6q/giphy.gif) 28 |
29 | 30 | 31 | ![ezgif com-crop(1)](https://media.giphy.com/media/HWhHqPdxqyoA5NNhf0/giphy.gif) 32 | 33 |

34 | 35 | 36 | 37 | 38 | 39 | ### # The Clean Architecture [proposed by our friendly Uncle Bob](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) 40 | 41 |

42 | 43 |

44 | 45 | ### Created & Maintained By 46 | 47 | [@MA](https://github.com/amirk3321) , Youtube : [@eTechViral](https://www.youtube.com/c/eTechViral) , Twitter : [@MA](https://twitter.com/__muhammad_amir) 48 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.flutter_chatgpt" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. 50 | minSdkVersion flutter.minSdkVersion 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_chatgpt/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_chatgpt 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /api_reponse/image_generation_response.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "created": 1671907766, 4 | "data": [ 5 | { 6 | "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-gkKbKKi6mIjktVVX4X5QwUJL/user-JzrPsftKY1B1iHJTr0wzj3a7/img-BeEws3wWTAVf2qWWvqctKBLJ.png?st=2022-12-24T17%3A49%3A26Z&se=2022-12-24T19%3A49%3A26Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2022-12-24T15%3A49%3A20Z&ske=2022-12-25T15%3A49%3A20Z&sks=b&skv=2021-08-06&sig=Fx65ggIVcL8NXxvH0I2pIxb/9MzpMV6q4acc5ljlkUQ%3D" 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /api_reponse/text_completion_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "cmpl-6Qyw6gFiMtAo6ZZOMme4e4EGi0v9l", 3 | "object": "text_completion", 4 | "created": 1671888786, 5 | "model": "text-davinci-003", 6 | "choices": [ 7 | { 8 | "text": "\n\nFlutter is an open-source mobile application development framework created by Google", 9 | "index": 0, 10 | "logprobs": null, 11 | "finish_reason": "length" 12 | } 13 | ], 14 | "usage": { 15 | "prompt_tokens": 4, 16 | "completion_tokens": 16, 17 | "total_tokens": 20 18 | } 19 | } -------------------------------------------------------------------------------- /assets/app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/assets/app_logo.png -------------------------------------------------------------------------------- /assets/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/assets/loading.gif -------------------------------------------------------------------------------- /assets/openai-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/assets/openai-avatar.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - FMDB (2.7.5): 4 | - FMDB/standard (= 2.7.5) 5 | - FMDB/standard (2.7.5) 6 | - path_provider_ios (0.0.1): 7 | - Flutter 8 | - share_plus (0.0.1): 9 | - Flutter 10 | - sqflite (0.0.2): 11 | - Flutter 12 | - FMDB (>= 2.7.5) 13 | 14 | DEPENDENCIES: 15 | - Flutter (from `Flutter`) 16 | - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) 17 | - share_plus (from `.symlinks/plugins/share_plus/ios`) 18 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 19 | 20 | SPEC REPOS: 21 | trunk: 22 | - FMDB 23 | 24 | EXTERNAL SOURCES: 25 | Flutter: 26 | :path: Flutter 27 | path_provider_ios: 28 | :path: ".symlinks/plugins/path_provider_ios/ios" 29 | share_plus: 30 | :path: ".symlinks/plugins/share_plus/ios" 31 | sqflite: 32 | :path: ".symlinks/plugins/sqflite/ios" 33 | 34 | SPEC CHECKSUMS: 35 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 36 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 37 | path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 38 | share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68 39 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 40 | 41 | PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 42 | 43 | COCOAPODS: 1.11.3 44 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 2AE19A2A4DB76ED684E7D355 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D07210432EAB81A3A3A47493 /* Pods_Runner.framework */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 36 | 48AE4A882ECA4EDB757F7C94 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 40 | 896E52B467B81C9DC9382DF9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | B486BDEAEEA10CB9DE249090 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 49 | D07210432EAB81A3A3A47493 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 2AE19A2A4DB76ED684E7D355 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 86295250234117FB1B7B391A /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | B486BDEAEEA10CB9DE249090 /* Pods-Runner.debug.xcconfig */, 68 | 48AE4A882ECA4EDB757F7C94 /* Pods-Runner.release.xcconfig */, 69 | 896E52B467B81C9DC9382DF9 /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | name = Pods; 72 | path = Pods; 73 | sourceTree = ""; 74 | }; 75 | 9740EEB11CF90186004384FC /* Flutter */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 79 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 80 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 81 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 82 | ); 83 | name = Flutter; 84 | sourceTree = ""; 85 | }; 86 | 97C146E51CF9000F007C117D = { 87 | isa = PBXGroup; 88 | children = ( 89 | 9740EEB11CF90186004384FC /* Flutter */, 90 | 97C146F01CF9000F007C117D /* Runner */, 91 | 97C146EF1CF9000F007C117D /* Products */, 92 | 86295250234117FB1B7B391A /* Pods */, 93 | F7AFFB181765A165FC9F9C10 /* Frameworks */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 97C146EF1CF9000F007C117D /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 97C146EE1CF9000F007C117D /* Runner.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 97C146F01CF9000F007C117D /* Runner */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 109 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 110 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 111 | 97C147021CF9000F007C117D /* Info.plist */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 115 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 116 | ); 117 | path = Runner; 118 | sourceTree = ""; 119 | }; 120 | F7AFFB181765A165FC9F9C10 /* Frameworks */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | D07210432EAB81A3A3A47493 /* Pods_Runner.framework */, 124 | ); 125 | name = Frameworks; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 97C146ED1CF9000F007C117D /* Runner */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 134 | buildPhases = ( 135 | 11A5439FBAC591DF23F29357 /* [CP] Check Pods Manifest.lock */, 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | 8D30C5DCA9ECFB7215EA2A4F /* [CP] Embed Pods Frameworks */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 1300; 160 | ORGANIZATIONNAME = ""; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | LastSwiftMigration = 1100; 165 | }; 166 | }; 167 | }; 168 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 169 | compatibilityVersion = "Xcode 9.3"; 170 | developmentRegion = en; 171 | hasScannedForEncodings = 0; 172 | knownRegions = ( 173 | en, 174 | Base, 175 | ); 176 | mainGroup = 97C146E51CF9000F007C117D; 177 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 178 | projectDirPath = ""; 179 | projectRoot = ""; 180 | targets = ( 181 | 97C146ED1CF9000F007C117D /* Runner */, 182 | ); 183 | }; 184 | /* End PBXProject section */ 185 | 186 | /* Begin PBXResourcesBuildPhase section */ 187 | 97C146EC1CF9000F007C117D /* Resources */ = { 188 | isa = PBXResourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 11A5439FBAC591DF23F29357 /* [CP] Check Pods Manifest.lock */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputFileListPaths = ( 207 | ); 208 | inputPaths = ( 209 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 210 | "${PODS_ROOT}/Manifest.lock", 211 | ); 212 | name = "[CP] Check Pods Manifest.lock"; 213 | outputFileListPaths = ( 214 | ); 215 | outputPaths = ( 216 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 221 | showEnvVarsInLog = 0; 222 | }; 223 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputPaths = ( 229 | ); 230 | name = "Thin Binary"; 231 | outputPaths = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | shellPath = /bin/sh; 235 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 236 | }; 237 | 8D30C5DCA9ECFB7215EA2A4F /* [CP] Embed Pods Frameworks */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputFileListPaths = ( 243 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 244 | ); 245 | name = "[CP] Embed Pods Frameworks"; 246 | outputFileListPaths = ( 247 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | shellPath = /bin/sh; 251 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 252 | showEnvVarsInLog = 0; 253 | }; 254 | 9740EEB61CF901F6004384FC /* Run Script */ = { 255 | isa = PBXShellScriptBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | inputPaths = ( 260 | ); 261 | name = "Run Script"; 262 | outputPaths = ( 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | shellPath = /bin/sh; 266 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 267 | }; 268 | /* End PBXShellScriptBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 97C146EA1CF9000F007C117D /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 276 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXSourcesBuildPhase section */ 281 | 282 | /* Begin PBXVariantGroup section */ 283 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 284 | isa = PBXVariantGroup; 285 | children = ( 286 | 97C146FB1CF9000F007C117D /* Base */, 287 | ); 288 | name = Main.storyboard; 289 | sourceTree = ""; 290 | }; 291 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 292 | isa = PBXVariantGroup; 293 | children = ( 294 | 97C147001CF9000F007C117D /* Base */, 295 | ); 296 | name = LaunchScreen.storyboard; 297 | sourceTree = ""; 298 | }; 299 | /* End PBXVariantGroup section */ 300 | 301 | /* Begin XCBuildConfiguration section */ 302 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 308 | CLANG_CXX_LIBRARY = "libc++"; 309 | CLANG_ENABLE_MODULES = YES; 310 | CLANG_ENABLE_OBJC_ARC = YES; 311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_COMMA = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 317 | CLANG_WARN_EMPTY_BODY = YES; 318 | CLANG_WARN_ENUM_CONVERSION = YES; 319 | CLANG_WARN_INFINITE_RECURSION = YES; 320 | CLANG_WARN_INT_CONVERSION = YES; 321 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 322 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 323 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 326 | CLANG_WARN_STRICT_PROTOTYPES = YES; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 333 | ENABLE_NS_ASSERTIONS = NO; 334 | ENABLE_STRICT_OBJC_MSGSEND = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_NO_COMMON_BLOCKS = YES; 337 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 338 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 339 | GCC_WARN_UNDECLARED_SELECTOR = YES; 340 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 341 | GCC_WARN_UNUSED_FUNCTION = YES; 342 | GCC_WARN_UNUSED_VARIABLE = YES; 343 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 344 | MTL_ENABLE_DEBUG_INFO = NO; 345 | SDKROOT = iphoneos; 346 | SUPPORTED_PLATFORMS = iphoneos; 347 | TARGETED_DEVICE_FAMILY = "1,2"; 348 | VALIDATE_PRODUCT = YES; 349 | }; 350 | name = Profile; 351 | }; 352 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 355 | buildSettings = { 356 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 357 | CLANG_ENABLE_MODULES = YES; 358 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 359 | DEVELOPMENT_TEAM = TX2VD8KU8S; 360 | ENABLE_BITCODE = NO; 361 | INFOPLIST_FILE = Runner/Info.plist; 362 | LD_RUNPATH_SEARCH_PATHS = ( 363 | "$(inherited)", 364 | "@executable_path/Frameworks", 365 | ); 366 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterChatgpt; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 369 | SWIFT_VERSION = 5.0; 370 | VERSIONING_SYSTEM = "apple-generic"; 371 | }; 372 | name = Profile; 373 | }; 374 | 97C147031CF9000F007C117D /* Debug */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_ANALYZER_NONNULL = YES; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 398 | CLANG_WARN_STRICT_PROTOTYPES = YES; 399 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 400 | CLANG_WARN_UNREACHABLE_CODE = YES; 401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = dwarf; 405 | ENABLE_STRICT_OBJC_MSGSEND = YES; 406 | ENABLE_TESTABILITY = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu99; 408 | GCC_DYNAMIC_NO_PIC = NO; 409 | GCC_NO_COMMON_BLOCKS = YES; 410 | GCC_OPTIMIZATION_LEVEL = 0; 411 | GCC_PREPROCESSOR_DEFINITIONS = ( 412 | "DEBUG=1", 413 | "$(inherited)", 414 | ); 415 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 417 | GCC_WARN_UNDECLARED_SELECTOR = YES; 418 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 419 | GCC_WARN_UNUSED_FUNCTION = YES; 420 | GCC_WARN_UNUSED_VARIABLE = YES; 421 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 422 | MTL_ENABLE_DEBUG_INFO = YES; 423 | ONLY_ACTIVE_ARCH = YES; 424 | SDKROOT = iphoneos; 425 | TARGETED_DEVICE_FAMILY = "1,2"; 426 | }; 427 | name = Debug; 428 | }; 429 | 97C147041CF9000F007C117D /* Release */ = { 430 | isa = XCBuildConfiguration; 431 | buildSettings = { 432 | ALWAYS_SEARCH_USER_PATHS = NO; 433 | CLANG_ANALYZER_NONNULL = YES; 434 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 435 | CLANG_CXX_LIBRARY = "libc++"; 436 | CLANG_ENABLE_MODULES = YES; 437 | CLANG_ENABLE_OBJC_ARC = YES; 438 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 439 | CLANG_WARN_BOOL_CONVERSION = YES; 440 | CLANG_WARN_COMMA = YES; 441 | CLANG_WARN_CONSTANT_CONVERSION = YES; 442 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 443 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 444 | CLANG_WARN_EMPTY_BODY = YES; 445 | CLANG_WARN_ENUM_CONVERSION = YES; 446 | CLANG_WARN_INFINITE_RECURSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 449 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 450 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 451 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 452 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 453 | CLANG_WARN_STRICT_PROTOTYPES = YES; 454 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 455 | CLANG_WARN_UNREACHABLE_CODE = YES; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 458 | COPY_PHASE_STRIP = NO; 459 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 460 | ENABLE_NS_ASSERTIONS = NO; 461 | ENABLE_STRICT_OBJC_MSGSEND = YES; 462 | GCC_C_LANGUAGE_STANDARD = gnu99; 463 | GCC_NO_COMMON_BLOCKS = YES; 464 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 465 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 466 | GCC_WARN_UNDECLARED_SELECTOR = YES; 467 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 468 | GCC_WARN_UNUSED_FUNCTION = YES; 469 | GCC_WARN_UNUSED_VARIABLE = YES; 470 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 471 | MTL_ENABLE_DEBUG_INFO = NO; 472 | SDKROOT = iphoneos; 473 | SUPPORTED_PLATFORMS = iphoneos; 474 | SWIFT_COMPILATION_MODE = wholemodule; 475 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 476 | TARGETED_DEVICE_FAMILY = "1,2"; 477 | VALIDATE_PRODUCT = YES; 478 | }; 479 | name = Release; 480 | }; 481 | 97C147061CF9000F007C117D /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CLANG_ENABLE_MODULES = YES; 487 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 488 | DEVELOPMENT_TEAM = TX2VD8KU8S; 489 | ENABLE_BITCODE = NO; 490 | INFOPLIST_FILE = Runner/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "@executable_path/Frameworks", 494 | ); 495 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterChatgpt; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 498 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 499 | SWIFT_VERSION = 5.0; 500 | VERSIONING_SYSTEM = "apple-generic"; 501 | }; 502 | name = Debug; 503 | }; 504 | 97C147071CF9000F007C117D /* Release */ = { 505 | isa = XCBuildConfiguration; 506 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 507 | buildSettings = { 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 509 | CLANG_ENABLE_MODULES = YES; 510 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 511 | DEVELOPMENT_TEAM = TX2VD8KU8S; 512 | ENABLE_BITCODE = NO; 513 | INFOPLIST_FILE = Runner/Info.plist; 514 | LD_RUNPATH_SEARCH_PATHS = ( 515 | "$(inherited)", 516 | "@executable_path/Frameworks", 517 | ); 518 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterChatgpt; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 521 | SWIFT_VERSION = 5.0; 522 | VERSIONING_SYSTEM = "apple-generic"; 523 | }; 524 | name = Release; 525 | }; 526 | /* End XCBuildConfiguration section */ 527 | 528 | /* Begin XCConfigurationList section */ 529 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 530 | isa = XCConfigurationList; 531 | buildConfigurations = ( 532 | 97C147031CF9000F007C117D /* Debug */, 533 | 97C147041CF9000F007C117D /* Release */, 534 | 249021D3217E4FDB00AE95B9 /* Profile */, 535 | ); 536 | defaultConfigurationIsVisible = 0; 537 | defaultConfigurationName = Release; 538 | }; 539 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 97C147061CF9000F007C117D /* Debug */, 543 | 97C147071CF9000F007C117D /* Release */, 544 | 249021D4217E4FDB00AE95B9 /* Profile */, 545 | ); 546 | defaultConfigurationIsVisible = 0; 547 | defaultConfigurationName = Release; 548 | }; 549 | /* End XCConfigurationList section */ 550 | }; 551 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 552 | } 553 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amirk3321/flutter_chatgpt/ef66534d2594187ab65696f89f403f3aafbd6e6a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter Chatgpt 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_chatgpt 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/core/custom_exceptions.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | class ServerException implements Exception{ 4 | final String message; 5 | ServerException({required this.message}); 6 | } -------------------------------------------------------------------------------- /lib/core/http_certificate_maneger.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'dart:io'; 4 | 5 | class MyHttpOverrides extends HttpOverrides{ 6 | @override 7 | HttpClient createHttpClient(SecurityContext? context){ 8 | return super.createHttpClient(context) 9 | ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/core/open_ai_data.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | const String OPEN_AI_KEY="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"; 4 | 5 | 6 | const String baseURL="https://api.openai.com/v1"; -------------------------------------------------------------------------------- /lib/features/app/app_const/page_const.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | class PageConst{ 4 | static const String ImageGenerationPage="ImageGenerationPage"; 5 | static const String textCompletionPage="textCompletionPage"; 6 | } -------------------------------------------------------------------------------- /lib/features/app/home/home_page.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_chatgpt/features/app/app_const/page_const.dart'; 5 | import 'package:flutter_chatgpt/features/app/home/widgets/home_button_widget.dart'; 6 | 7 | class HomePage extends StatelessWidget { 8 | const HomePage({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | body: Container( 14 | padding: EdgeInsets.symmetric(horizontal: 15, vertical: 15), 15 | child: Column( 16 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 17 | crossAxisAlignment: CrossAxisAlignment.center, 18 | children: [ 19 | Column( 20 | children: [ 21 | SizedBox( 22 | height: 60, 23 | ), 24 | Image.asset("assets/app_logo.png"), 25 | ], 26 | ), 27 | Column( 28 | children: [ 29 | HomeButtonWidget( 30 | textData: "Image Generation - OpenAI", 31 | iconData: Icons.image_outlined, 32 | onTap: () { 33 | Navigator.pushNamed(context, PageConst.ImageGenerationPage); 34 | }, 35 | ), 36 | SizedBox( 37 | height: 30, 38 | ), 39 | HomeButtonWidget( 40 | textData: "Text Completion - OpenAI", 41 | iconData: Icons.text_fields_outlined, 42 | onTap: () { 43 | Navigator.pushNamed(context, PageConst.textCompletionPage); 44 | }, 45 | ), 46 | ], 47 | ), 48 | Text("ChatGPT: Optimizing Language Models for Dialogue",style: TextStyle(color: Colors.grey),), 49 | ], 50 | ), 51 | ), 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/features/app/home/widgets/home_button_widget.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_chatgpt/features/global/common/common.dart'; 5 | 6 | class HomeButtonWidget extends StatelessWidget { 7 | final String textData; 8 | final IconData iconData; 9 | final VoidCallback? onTap; 10 | const HomeButtonWidget({Key? key,required this.textData,this.onTap,required this.iconData}) : super(key: key); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return InkWell( 15 | onTap: onTap, 16 | child: Container( 17 | height: 95, 18 | width: double.infinity, 19 | alignment: Alignment.centerLeft, 20 | padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10), 21 | decoration: BoxDecoration( 22 | color: darkColor, 23 | borderRadius: BorderRadius.circular(10), 24 | boxShadow: glowBoxShadow, 25 | ), 26 | child: 27 | Row( 28 | children: [ 29 | Icon(iconData,size: 40,), 30 | SizedBox(width: 10,), 31 | Text(textData, style: TextStyle(color: Colors.white, fontSize: 18,fontWeight: FontWeight.w600)), 32 | ], 33 | ), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/features/app/routes/on_generate_route.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_chatgpt/features/app/app_const/page_const.dart'; 3 | import 'package:flutter_chatgpt/features/image_generation/presentation/pages/image_generation_page.dart'; 4 | import 'package:flutter_chatgpt/features/text_completion/presentation/pages/text_completion_page.dart'; 5 | 6 | class OnGenerateRoute { 7 | static Route route(RouteSettings settings) { 8 | final args = settings.arguments; 9 | 10 | switch (settings.name) { 11 | case "/": 12 | { 13 | return materialBuilder( 14 | widget: ErrorPage(), 15 | ); 16 | } 17 | case PageConst.ImageGenerationPage: 18 | { 19 | return materialBuilder( 20 | widget: ImageGenerationPage(), 21 | ); 22 | } 23 | case PageConst.textCompletionPage: 24 | { 25 | return materialBuilder( 26 | widget: TextCompletionPage(), 27 | ); 28 | } 29 | default: 30 | return materialBuilder( 31 | widget: ErrorPage(), 32 | ); 33 | } 34 | } 35 | } 36 | 37 | class ErrorPage extends StatelessWidget { 38 | @override 39 | Widget build(BuildContext context) { 40 | return Scaffold( 41 | appBar: AppBar( 42 | title: Text("error"), 43 | ), 44 | body: Center( 45 | child: Text("error"), 46 | ), 47 | ); 48 | } 49 | } 50 | 51 | MaterialPageRoute materialBuilder({required Widget widget}) { 52 | return MaterialPageRoute(builder: (_) => widget); 53 | } 54 | -------------------------------------------------------------------------------- /lib/features/app/splash/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SplashScreen extends StatefulWidget { 4 | final Widget? child; 5 | 6 | const SplashScreen({Key? key, this.child}) : super(key: key); 7 | 8 | @override 9 | State createState() => _SplashScreenState(); 10 | } 11 | 12 | class _SplashScreenState extends State { 13 | @override 14 | void initState() { 15 | Future.delayed(Duration(seconds: 4), () { 16 | Navigator.pushAndRemoveUntil(context, 17 | MaterialPageRoute(builder: (_) => 18 | widget.child!), (route) => false); 19 | }); 20 | 21 | super.initState(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | backgroundColor: Colors.black, 28 | body: Stack( 29 | children: [ 30 | Positioned( 31 | top: 0, 32 | right: 0, 33 | left: 0, 34 | bottom: 0, 35 | child: Image.asset( 36 | "assets/openai-avatar.png", 37 | fit: BoxFit.contain, 38 | )), 39 | ], 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/features/global/common/common.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | final glowBoxShadow = [ 7 | BoxShadow( 8 | color: Colors.black.withOpacity(.4), 9 | blurRadius: 6.0, 10 | spreadRadius: 3.0, 11 | offset: Offset( 12 | 0.0, 13 | 3.0, 14 | ), 15 | ), 16 | ]; 17 | 18 | final darkColor = Color.fromRGBO(48, 48, 48, 1); -------------------------------------------------------------------------------- /lib/features/global/provider/provider.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | //private endPoint Engine 4 | import 'package:flutter_chatgpt/core/open_ai_data.dart'; 5 | 6 | String endPoint(String endPoint) => "$baseURL/$endPoint"; 7 | 8 | Map headerBearerOption(String token) => { 9 | "Content-Type": "application/json", 10 | 'Authorization': 'Bearer $token', 11 | }; 12 | -------------------------------------------------------------------------------- /lib/features/global/search_text_field/search_text_field_widget.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | 6 | 7 | class SearchTextFieldWidget extends StatelessWidget { 8 | final TextEditingController? textEditingController; 9 | final VoidCallback? onTap; 10 | 11 | const SearchTextFieldWidget({ 12 | Key? key, 13 | this.textEditingController, 14 | this.onTap, 15 | }) : super(key: key); 16 | 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return _searchTextField(); 21 | } 22 | 23 | Widget _searchTextField() { 24 | return Container( 25 | margin: EdgeInsets.only(bottom: 10, left: 4, right: 4), 26 | child: Row( 27 | crossAxisAlignment: CrossAxisAlignment.end, 28 | children: [ 29 | Expanded( 30 | child: Container( 31 | decoration: BoxDecoration( 32 | borderRadius: BorderRadius.all(Radius.circular(10)), 33 | boxShadow: [ 34 | BoxShadow( 35 | color: Colors.black.withOpacity(.2), 36 | offset: Offset(0.0, 0.50), 37 | spreadRadius: 1, 38 | blurRadius: 1, 39 | ) 40 | ]), 41 | child: Column( 42 | children: [ 43 | Row( 44 | children: [ 45 | SizedBox( 46 | width: 20, 47 | ), 48 | Expanded( 49 | child: Container( 50 | child: ConstrainedBox( 51 | constraints: BoxConstraints(maxHeight: 60), 52 | child: Scrollbar( 53 | child: TextField( 54 | style: TextStyle(fontSize: 14), 55 | controller: textEditingController, 56 | maxLines: null, 57 | decoration: InputDecoration( 58 | border: InputBorder.none, 59 | hintText: "Open AI Waiting for your query..."), 60 | ), 61 | ), 62 | ), 63 | ), 64 | ), 65 | SizedBox( 66 | width: 15, 67 | ), 68 | ], 69 | ), 70 | ], 71 | ), 72 | ), 73 | ), 74 | SizedBox( 75 | width: 5, 76 | ), 77 | InkWell( 78 | onTap: textEditingController!.text.isEmpty 79 | ? null 80 | : onTap, 81 | child: Container( 82 | decoration: BoxDecoration( 83 | color: textEditingController!.text.isEmpty 84 | ? Colors.green.withOpacity(.4) 85 | : Colors.green, 86 | borderRadius: BorderRadius.circular(40)), 87 | padding: EdgeInsets.all(10), 88 | child: Icon( 89 | Icons.send, 90 | color: Colors.white, 91 | ), 92 | ), 93 | ), 94 | ], 95 | ), 96 | ); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /lib/features/image_generation/data/model/image_generation_data.dart: -------------------------------------------------------------------------------- 1 | class ImageGenerationData{ 2 | final String url; 3 | 4 | ImageGenerationData({required this.url}); 5 | 6 | 7 | factory ImageGenerationData.fromJson(Map json){ 8 | 9 | return ImageGenerationData( 10 | url: json['url'], 11 | ); 12 | } 13 | } -------------------------------------------------------------------------------- /lib/features/image_generation/data/model/image_generation_model.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_data.dart'; 4 | 5 | class ImageGenerationModel { 6 | final num created; 7 | final List data; 8 | 9 | ImageGenerationModel({required this.created, required this.data}); 10 | 11 | factory ImageGenerationModel.fromJson(Map json) { 12 | final imageGenerationItems = json['data'] as List; 13 | List imagesData = imageGenerationItems 14 | .map((singleItem) => ImageGenerationData.fromJson(singleItem)) 15 | .toList(); 16 | 17 | return ImageGenerationModel( 18 | data: imagesData, 19 | created: json['created'], 20 | ); 21 | } 22 | } -------------------------------------------------------------------------------- /lib/features/image_generation/data/remote_data_source/image_generation_remote_data_source.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_model.dart'; 3 | 4 | abstract class ImageGenerationRemoteDataSource { 5 | 6 | 7 | Future getGenerateImages(String query); 8 | } -------------------------------------------------------------------------------- /lib/features/image_generation/data/remote_data_source/image_generation_remote_data_source_impl.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'dart:convert'; 4 | 5 | import 'package:flutter_chatgpt/core/custom_exceptions.dart'; 6 | import 'package:flutter_chatgpt/core/open_ai_data.dart'; 7 | import 'package:flutter_chatgpt/features/global/provider/provider.dart'; 8 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_model.dart'; 9 | import 'package:flutter_chatgpt/features/image_generation/data/remote_data_source/image_generation_remote_data_source.dart'; 10 | import 'package:http/http.dart' as http; 11 | 12 | class ImageGenerationRemoteDataSourceImpl implements ImageGenerationRemoteDataSource{ 13 | 14 | final http.Client httpClient; 15 | 16 | ImageGenerationRemoteDataSourceImpl({required this.httpClient}); 17 | 18 | 19 | 20 | @override 21 | Future getGenerateImages(String query)async { 22 | final String _endPoint = "images/generations"; 23 | 24 | // ['256x256', '512x512', '1024x1024'] 25 | Map rowParams = { 26 | "n":10, 27 | "size":"256x256", 28 | "prompt":query, 29 | }; 30 | 31 | final encodedParams = json.encode(rowParams); 32 | 33 | final response = await httpClient.post( 34 | Uri.parse(endPoint(_endPoint)), 35 | body: encodedParams, 36 | headers: headerBearerOption(OPEN_AI_KEY), 37 | ); 38 | 39 | if (response.statusCode == 200) { 40 | return ImageGenerationModel.fromJson(json.decode(response.body)); 41 | } else { 42 | throw ServerException(message: "Image Generation Server Exception"); 43 | } 44 | 45 | 46 | 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /lib/features/image_generation/data/repositories/image_generation_repository_impl.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_model.dart'; 4 | import 'package:flutter_chatgpt/features/image_generation/data/remote_data_source/image_generation_remote_data_source.dart'; 5 | import 'package:flutter_chatgpt/features/image_generation/domain/repositories/image_generation_repository.dart'; 6 | 7 | class ImageGenerationRepositoryImpl implements ImageGenerationRepository { 8 | final ImageGenerationRemoteDataSource remoteDataSource; 9 | 10 | ImageGenerationRepositoryImpl({required this.remoteDataSource}); 11 | 12 | @override 13 | Future getGenerateImages(String query) async => 14 | remoteDataSource.getGenerateImages(query); 15 | } 16 | -------------------------------------------------------------------------------- /lib/features/image_generation/domain/repositories/image_generation_repository.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_model.dart'; 3 | 4 | abstract class ImageGenerationRepository { 5 | 6 | 7 | Future getGenerateImages(String query); 8 | } -------------------------------------------------------------------------------- /lib/features/image_generation/domain/usecases/image_generation_usecase.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_model.dart'; 4 | import 'package:flutter_chatgpt/features/image_generation/domain/repositories/image_generation_repository.dart'; 5 | 6 | class ImageGenerationUseCase{ 7 | final ImageGenerationRepository repository; 8 | 9 | ImageGenerationUseCase({required this.repository}); 10 | 11 | 12 | Future call(String query)async{ 13 | return repository.getGenerateImages(query); 14 | } 15 | } -------------------------------------------------------------------------------- /lib/features/image_generation/image_generation_injection_container.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_chatgpt/features/image_generation/data/remote_data_source/image_generation_remote_data_source.dart'; 4 | import 'package:flutter_chatgpt/features/image_generation/data/remote_data_source/image_generation_remote_data_source_impl.dart'; 5 | import 'package:flutter_chatgpt/features/image_generation/data/repositories/image_generation_repository_impl.dart'; 6 | import 'package:flutter_chatgpt/features/image_generation/domain/repositories/image_generation_repository.dart'; 7 | import 'package:flutter_chatgpt/features/image_generation/domain/usecases/image_generation_usecase.dart'; 8 | import 'package:flutter_chatgpt/features/image_generation/presentation/cubit/image_generation_cubit.dart'; 9 | import 'package:flutter_chatgpt/injection_container.dart'; 10 | 11 | Future imageGenerationInjectionContainer() async{ 12 | 13 | //Futures bloc 14 | sl.registerFactory( 15 | () => ImageGenerationCubit( 16 | imageGenerationUseCase: sl.call(), 17 | ), 18 | ); 19 | 20 | //UseCase 21 | sl.registerLazySingleton(() => ImageGenerationUseCase( 22 | repository: sl.call(), 23 | )); 24 | //repository 25 | sl.registerLazySingleton( 26 | () => ImageGenerationRepositoryImpl( 27 | remoteDataSource: sl.call(), 28 | )); 29 | //remote data 30 | sl.registerLazySingleton( 31 | () => ImageGenerationRemoteDataSourceImpl( 32 | httpClient: sl.call(), 33 | )); 34 | } -------------------------------------------------------------------------------- /lib/features/image_generation/presentation/cubit/image_generation_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:equatable/equatable.dart'; 5 | import 'package:flutter_chatgpt/core/custom_exceptions.dart'; 6 | import 'package:flutter_chatgpt/features/image_generation/data/model/image_generation_model.dart'; 7 | import 'package:flutter_chatgpt/features/image_generation/domain/usecases/image_generation_usecase.dart'; 8 | 9 | part 'image_generation_state.dart'; 10 | 11 | class ImageGenerationCubit extends Cubit { 12 | final ImageGenerationUseCase imageGenerationUseCase; 13 | ImageGenerationCubit({required this.imageGenerationUseCase}) : super(ImageGenerationInitial()); 14 | 15 | 16 | Future imagesGenerate({required String query}) async { 17 | emit(ImageGenerationLoading()); 18 | try { 19 | final imageGenerationModelData = await imageGenerationUseCase.call(query); 20 | emit(ImageGenerationLoaded(imageGenerationModelData: imageGenerationModelData)); 21 | } on SocketException catch (e) { 22 | emit(ImageGenerationFailure(errorMsg: e.message)); 23 | } on ServerException catch (e) { 24 | emit(ImageGenerationFailure(errorMsg: e.message)); 25 | } 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /lib/features/image_generation/presentation/cubit/image_generation_state.dart: -------------------------------------------------------------------------------- 1 | part of 'image_generation_cubit.dart'; 2 | 3 | abstract class ImageGenerationState extends Equatable { 4 | const ImageGenerationState(); 5 | } 6 | 7 | class ImageGenerationInitial extends ImageGenerationState { 8 | @override 9 | List get props => []; 10 | } 11 | 12 | class ImageGenerationLoading extends ImageGenerationState { 13 | @override 14 | List get props => []; 15 | } 16 | 17 | class ImageGenerationLoaded extends ImageGenerationState { 18 | final ImageGenerationModel imageGenerationModelData; 19 | 20 | ImageGenerationLoaded({required this.imageGenerationModelData}); 21 | @override 22 | List get props => []; 23 | } 24 | 25 | class ImageGenerationFailure extends ImageGenerationState { 26 | final String? errorMsg; 27 | 28 | ImageGenerationFailure({this.errorMsg}); 29 | @override 30 | List get props => []; 31 | } -------------------------------------------------------------------------------- /lib/features/image_generation/presentation/pages/image_generation_page.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | import 'package:flutter_chatgpt/features/global/search_text_field/search_text_field_widget.dart'; 7 | import 'package:flutter_chatgpt/features/image_generation/presentation/cubit/image_generation_cubit.dart'; 8 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 9 | import 'package:shimmer/shimmer.dart'; 10 | 11 | class ImageGenerationPage extends StatefulWidget { 12 | const ImageGenerationPage({Key? key}) : super(key: key); 13 | 14 | @override 15 | State createState() => _ImageGenerationPageState(); 16 | } 17 | 18 | class _ImageGenerationPageState extends State { 19 | 20 | TextEditingController _searchTextController = TextEditingController(); 21 | 22 | @override 23 | void initState() { 24 | _searchTextController.addListener(() { 25 | setState(() {}); 26 | }); 27 | super.initState(); 28 | } 29 | 30 | @override 31 | void dispose() { 32 | _searchTextController.dispose(); 33 | super.dispose(); 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return Scaffold( 39 | appBar: AppBar( 40 | title: Text("Image Generation"), 41 | ), 42 | body: Center( 43 | child: Column( 44 | children: [ 45 | Expanded( 46 | child: BlocBuilder( 47 | builder: (context, imageGenerationState) { 48 | if (imageGenerationState is ImageGenerationLoading) { 49 | return Center( 50 | child: Container( 51 | width: 300, 52 | height: 300, 53 | child: Image.asset("assets/loading.gif")), 54 | ); 55 | } 56 | 57 | if (imageGenerationState is ImageGenerationLoaded) { 58 | return MasonryGridView.builder( 59 | gridDelegate: 60 | SliverSimpleGridDelegateWithFixedCrossAxisCount( 61 | crossAxisCount: 2), 62 | mainAxisSpacing: 3, 63 | crossAxisSpacing: 3, 64 | itemCount: 65 | imageGenerationState.imageGenerationModelData.data.length, 66 | itemBuilder: (context, index) { 67 | final generatedImage = 68 | imageGenerationState.imageGenerationModelData.data[index]; 69 | 70 | return Card( 71 | child: CachedNetworkImage( 72 | imageUrl: "${generatedImage.url}", 73 | fit: BoxFit.cover, 74 | progressIndicatorBuilder: 75 | (context, url, downloadProgress) => SizedBox( 76 | height: 150, 77 | width: 150, 78 | child: Shimmer.fromColors( 79 | baseColor: Colors.grey.withOpacity(.3), 80 | highlightColor: Colors.grey, 81 | child: Container( 82 | height: 220, 83 | width: 130, 84 | 85 | decoration: BoxDecoration( 86 | color: Colors.white, 87 | borderRadius: BorderRadius.circular(4) 88 | ), 89 | ), 90 | )), 91 | errorWidget: (context, url, error) => 92 | Icon(Icons.error), 93 | ), 94 | ); 95 | }); 96 | } 97 | 98 | return Center( 99 | child: Text( 100 | "OpenAI Image Generation", 101 | style: TextStyle(fontSize: 20, color: Colors.grey), 102 | )); 103 | }, 104 | )), 105 | SearchTextFieldWidget( 106 | textEditingController: _searchTextController, 107 | onTap: () { 108 | BlocProvider.of(context).imagesGenerate( 109 | query: _searchTextController.text, 110 | ).then((value) => _clearTextField); 111 | }, 112 | ), 113 | SizedBox( 114 | height: 20, 115 | ), 116 | ], 117 | ), 118 | ), 119 | ); 120 | } 121 | 122 | void _clearTextField() { 123 | setState(() { 124 | _searchTextController.clear(); 125 | }); 126 | } 127 | } -------------------------------------------------------------------------------- /lib/features/text_completion/data/model/text_completion_data.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | class TextCompletionData{ 4 | final String text; 5 | final num index; 6 | final String finish_reason; 7 | 8 | TextCompletionData({required this.text,required this.index,required this.finish_reason}); 9 | 10 | 11 | factory TextCompletionData.fromJson(Map json){ 12 | 13 | return TextCompletionData( 14 | text: json['text'], 15 | index: json['index'], 16 | finish_reason: json['finish_reason'], 17 | ); 18 | } 19 | } -------------------------------------------------------------------------------- /lib/features/text_completion/data/model/text_completion_model.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_data.dart'; 4 | 5 | class TextCompletionModel { 6 | final num created; 7 | final List choices; 8 | 9 | TextCompletionModel({required this.created, required this.choices}); 10 | 11 | factory TextCompletionModel.fromJson(Map json) { 12 | final textCompletionItems = json['choices'] as List; 13 | List choices = textCompletionItems 14 | .map((singleItem) => TextCompletionData.fromJson(singleItem)) 15 | .toList(); 16 | 17 | return TextCompletionModel( 18 | choices: choices, 19 | created: json['created'], 20 | ); 21 | } 22 | } -------------------------------------------------------------------------------- /lib/features/text_completion/data/remote_data_source/text_completion_remote_data_source.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_model.dart'; 3 | 4 | abstract class TextCompletionRemoteDataSource { 5 | 6 | 7 | Future getTextCompletion(String query); 8 | } -------------------------------------------------------------------------------- /lib/features/text_completion/data/remote_data_source/text_completion_remote_data_source_impl.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'dart:convert'; 4 | 5 | import 'package:flutter_chatgpt/core/custom_exceptions.dart'; 6 | import 'package:flutter_chatgpt/core/open_ai_data.dart'; 7 | import 'package:flutter_chatgpt/features/global/provider/provider.dart'; 8 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_model.dart'; 9 | import 'package:flutter_chatgpt/features/text_completion/data/remote_data_source/text_completion_remote_data_source.dart'; 10 | import 'package:http/http.dart' as http; 11 | 12 | class TextCompletionRemoteDataSourceImpl implements TextCompletionRemoteDataSource{ 13 | 14 | final http.Client httpClient; 15 | 16 | TextCompletionRemoteDataSourceImpl({required this.httpClient}); 17 | 18 | 19 | 20 | @override 21 | Future getTextCompletion(String query)async { 22 | final String _endPoint = "completions"; 23 | 24 | Map rowParams = { 25 | "model":"text-davinci-003", 26 | "prompt":query, 27 | }; 28 | 29 | final encodedParams = json.encode(rowParams); 30 | 31 | final response = await httpClient.post( 32 | Uri.parse(endPoint(_endPoint)), 33 | body: encodedParams, 34 | headers: headerBearerOption(OPEN_AI_KEY), 35 | ); 36 | 37 | if (response.statusCode == 200) { 38 | return TextCompletionModel.fromJson(json.decode(response.body)); 39 | } else { 40 | throw ServerException(message: "Text Completion Server Exception"); 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /lib/features/text_completion/data/repositories/text_completion_repository_impl.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_model.dart'; 4 | import 'package:flutter_chatgpt/features/text_completion/data/remote_data_source/text_completion_remote_data_source.dart'; 5 | import 'package:flutter_chatgpt/features/text_completion/domain/repositories/text_completion_repository.dart'; 6 | 7 | class TextCompletionRepositoryImpl implements TextCompletionRepository{ 8 | 9 | final TextCompletionRemoteDataSource remoteDataSource; 10 | 11 | TextCompletionRepositoryImpl({required this.remoteDataSource}); 12 | 13 | @override 14 | Future getTextCompletion(String query) async => 15 | remoteDataSource.getTextCompletion(query); 16 | 17 | } -------------------------------------------------------------------------------- /lib/features/text_completion/domain/repositories/text_completion_repository.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_model.dart'; 5 | 6 | abstract class TextCompletionRepository { 7 | 8 | 9 | Future getTextCompletion(String query); 10 | } -------------------------------------------------------------------------------- /lib/features/text_completion/domain/usecases/text_completion_usecase.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_model.dart'; 5 | import 'package:flutter_chatgpt/features/text_completion/domain/repositories/text_completion_repository.dart'; 6 | 7 | class TextCompletionUseCase{ 8 | final TextCompletionRepository repository; 9 | 10 | TextCompletionUseCase({required this.repository}); 11 | 12 | 13 | Future call(String query)async{ 14 | return repository.getTextCompletion(query); 15 | } 16 | } -------------------------------------------------------------------------------- /lib/features/text_completion/presentation/cubit/text_completion_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:equatable/equatable.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:flutter_chatgpt/core/custom_exceptions.dart'; 7 | import 'package:flutter_chatgpt/features/text_completion/data/model/text_completion_model.dart'; 8 | import 'package:flutter_chatgpt/features/text_completion/domain/usecases/text_completion_usecase.dart'; 9 | 10 | part 'text_completion_state.dart'; 11 | 12 | class TextCompletionCubit extends Cubit { 13 | final TextCompletionUseCase textCompletionUseCase; 14 | TextCompletionCubit({required this.textCompletionUseCase}) : super(TextCompletionInitial()); 15 | 16 | 17 | Future textCompletion({required String query}) async { 18 | emit(TextCompletionLoading()); 19 | try { 20 | final textCompletionModelData = await textCompletionUseCase.call(query); 21 | emit(TextCompletionLoaded(textCompletionModelData: textCompletionModelData)); 22 | } on SocketException catch (e) { 23 | emit(TextCompletionFailure(errorMsg: e.message)); 24 | } on ServerException catch (e) { 25 | emit(TextCompletionFailure(errorMsg: e.message)); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/features/text_completion/presentation/cubit/text_completion_state.dart: -------------------------------------------------------------------------------- 1 | part of 'text_completion_cubit.dart'; 2 | 3 | abstract class TextCompletionState extends Equatable { 4 | const TextCompletionState(); 5 | } 6 | 7 | class TextCompletionInitial extends TextCompletionState { 8 | @override 9 | List get props => []; 10 | } 11 | 12 | class TextCompletionLoading extends TextCompletionState { 13 | @override 14 | List get props => []; 15 | } 16 | class TextCompletionLoaded extends TextCompletionState { 17 | final TextCompletionModel textCompletionModelData; 18 | 19 | TextCompletionLoaded({required this.textCompletionModelData}); 20 | @override 21 | List get props => []; 22 | } 23 | 24 | class TextCompletionFailure extends TextCompletionState { 25 | final String? errorMsg; 26 | 27 | TextCompletionFailure({this.errorMsg}); 28 | @override 29 | List get props => []; 30 | } -------------------------------------------------------------------------------- /lib/features/text_completion/presentation/pages/text_completion_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/services.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:flutter_chatgpt/features/global/search_text_field/search_text_field_widget.dart'; 5 | import 'package:flutter_chatgpt/features/text_completion/presentation/cubit/text_completion_cubit.dart'; 6 | import 'package:share_plus/share_plus.dart'; 7 | 8 | class TextCompletionPage extends StatefulWidget { 9 | const TextCompletionPage({Key? key}) : super(key: key); 10 | 11 | @override 12 | State createState() => _TextCompletionPageState(); 13 | } 14 | 15 | class _TextCompletionPageState extends State { 16 | TextEditingController _searchTextController = TextEditingController(); 17 | 18 | @override 19 | void initState() { 20 | _searchTextController.addListener(() { 21 | setState(() {}); 22 | }); 23 | super.initState(); 24 | } 25 | 26 | @override 27 | void dispose() { 28 | _searchTextController.dispose(); 29 | super.dispose(); 30 | } 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return Scaffold( 35 | appBar: AppBar( 36 | title: Text("Text Completion Page"), 37 | ), 38 | body: Center( 39 | child: Column(children: [ 40 | Expanded( 41 | child: BlocBuilder( 42 | builder: (context, textCompletionState) { 43 | if (textCompletionState is TextCompletionLoading) { 44 | return Center( 45 | child: Container( 46 | width: 300, 47 | height: 300, 48 | child: Image.asset("assets/loading.gif")), 49 | ); 50 | } 51 | if (textCompletionState is TextCompletionLoaded) { 52 | final choicesData = 53 | textCompletionState.textCompletionModelData.choices; 54 | 55 | return ListView.builder( 56 | itemCount: choicesData.length, 57 | itemBuilder: (BuildContext context, int index) { 58 | final textData = choicesData[index]; 59 | return Card( 60 | child: Padding( 61 | padding: const EdgeInsets.all(8.0), 62 | child: Column( 63 | children: [ 64 | Text( 65 | textData.text, 66 | style: TextStyle(fontSize: 18), 67 | ), 68 | SizedBox( 69 | height: 30, 70 | ), 71 | Row( 72 | mainAxisAlignment: 73 | MainAxisAlignment.spaceEvenly, 74 | children: [ 75 | InkWell( 76 | onTap: () { 77 | Share.share(textData.text); 78 | }, 79 | child: Icon(Icons.share, size: 35)), 80 | InkWell( 81 | onTap: () { 82 | Clipboard.setData( 83 | ClipboardData(text: textData.text)); 84 | }, 85 | child: Icon( 86 | Icons.copy, 87 | size: 35, 88 | )), 89 | ], 90 | ), 91 | SizedBox( 92 | height: 10, 93 | ), 94 | ], 95 | ), 96 | ), 97 | ); 98 | }, 99 | ); 100 | } 101 | return Center( 102 | child: Text( 103 | "OpenAI Text Completion", 104 | style: TextStyle(fontSize: 20, color: Colors.grey), 105 | )); 106 | }, 107 | ), 108 | ), 109 | SearchTextFieldWidget( 110 | textEditingController: _searchTextController, 111 | onTap: () { 112 | BlocProvider.of(context) 113 | .textCompletion(query: _searchTextController.text) 114 | .then((value) => _clearTextField()); 115 | }), 116 | SizedBox( 117 | height: 20, 118 | ), 119 | ]), 120 | ), 121 | ); 122 | } 123 | 124 | void _clearTextField() { 125 | setState(() { 126 | _searchTextController.clear(); 127 | }); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /lib/features/text_completion/text_completion_injection_container.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import 'package:flutter_chatgpt/features/text_completion/data/remote_data_source/text_completion_remote_data_source.dart'; 5 | import 'package:flutter_chatgpt/features/text_completion/data/remote_data_source/text_completion_remote_data_source_impl.dart'; 6 | import 'package:flutter_chatgpt/features/text_completion/data/repositories/text_completion_repository_impl.dart'; 7 | import 'package:flutter_chatgpt/features/text_completion/domain/repositories/text_completion_repository.dart'; 8 | import 'package:flutter_chatgpt/features/text_completion/domain/usecases/text_completion_usecase.dart'; 9 | import 'package:flutter_chatgpt/features/text_completion/presentation/cubit/text_completion_cubit.dart'; 10 | import 'package:flutter_chatgpt/injection_container.dart'; 11 | 12 | Future textCompletionInjectionContainer() async{ 13 | 14 | //Futures bloc 15 | sl.registerFactory( 16 | () => TextCompletionCubit( 17 | textCompletionUseCase: sl.call(), 18 | ), 19 | ); 20 | 21 | //UseCase 22 | sl.registerLazySingleton(() => TextCompletionUseCase( 23 | repository: sl.call(), 24 | )); 25 | //repository 26 | sl.registerLazySingleton( 27 | () => TextCompletionRepositoryImpl( 28 | remoteDataSource: sl.call(), 29 | )); 30 | //remote data 31 | sl.registerLazySingleton( 32 | () => TextCompletionRemoteDataSourceImpl( 33 | httpClient: sl.call(), 34 | )); 35 | } -------------------------------------------------------------------------------- /lib/injection_container.dart: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import 'package:flutter_chatgpt/features/image_generation/image_generation_injection_container.dart'; 5 | import 'package:flutter_chatgpt/features/text_completion/text_completion_injection_container.dart'; 6 | import 'package:get_it/get_it.dart'; 7 | import 'package:http/http.dart' as http; 8 | 9 | final sl = GetIt.instance; 10 | 11 | Future init() async { 12 | 13 | 14 | final http.Client httpClient = http.Client(); 15 | 16 | 17 | sl.registerLazySingleton(() => httpClient); 18 | 19 | await textCompletionInjectionContainer(); 20 | await imageGenerationInjectionContainer(); 21 | 22 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_bloc/flutter_bloc.dart'; 5 | import 'package:flutter_chatgpt/core/http_certificate_maneger.dart'; 6 | import 'package:flutter_chatgpt/features/app/home/home_page.dart'; 7 | import 'package:flutter_chatgpt/features/app/routes/on_generate_route.dart'; 8 | import 'package:flutter_chatgpt/features/app/splash/splash_screen.dart'; 9 | import 'package:flutter_chatgpt/features/image_generation/presentation/cubit/image_generation_cubit.dart'; 10 | import 'package:flutter_chatgpt/features/image_generation/presentation/cubit/image_generation_cubit.dart'; 11 | import 'package:flutter_chatgpt/features/text_completion/presentation/cubit/text_completion_cubit.dart'; 12 | import 'injection_container.dart' as di; 13 | 14 | void main()async { 15 | WidgetsFlutterBinding.ensureInitialized(); 16 | HttpOverrides.global = new MyHttpOverrides(); 17 | await di.init(); 18 | runApp(MyApp()); 19 | } 20 | 21 | class MyApp extends StatelessWidget { 22 | @override 23 | Widget build(BuildContext context) { 24 | return MultiBlocProvider( 25 | providers: [ 26 | BlocProvider( 27 | create: (_) => di.sl(), 28 | ), 29 | BlocProvider( 30 | create: (_) => di.sl(), 31 | ), 32 | 33 | ], 34 | child: MaterialApp( 35 | debugShowCheckedModeBanner: false, 36 | title: 'ChatGPT', 37 | onGenerateRoute: OnGenerateRoute.route, 38 | theme: ThemeData(brightness: Brightness.dark), 39 | initialRoute: '/', 40 | routes: { 41 | "/": (context) { 42 | return SplashScreen( 43 | child: HomePage(), 44 | ); 45 | } 46 | }, 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.9.0" 11 | bloc: 12 | dependency: transitive 13 | description: 14 | name: bloc 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "8.1.0" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0" 25 | cached_network_image: 26 | dependency: "direct main" 27 | description: 28 | name: cached_network_image 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "3.2.3" 32 | cached_network_image_platform_interface: 33 | dependency: transitive 34 | description: 35 | name: cached_network_image_platform_interface 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "2.0.0" 39 | cached_network_image_web: 40 | dependency: transitive 41 | description: 42 | name: cached_network_image_web 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.0.2" 46 | characters: 47 | dependency: transitive 48 | description: 49 | name: characters 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.2.1" 53 | clock: 54 | dependency: transitive 55 | description: 56 | name: clock 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.1.1" 60 | collection: 61 | dependency: transitive 62 | description: 63 | name: collection 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.16.0" 67 | cross_file: 68 | dependency: transitive 69 | description: 70 | name: cross_file 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.3.3+2" 74 | crypto: 75 | dependency: transitive 76 | description: 77 | name: crypto 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "3.0.2" 81 | cupertino_icons: 82 | dependency: "direct main" 83 | description: 84 | name: cupertino_icons 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.0.5" 88 | equatable: 89 | dependency: "direct main" 90 | description: 91 | name: equatable 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "2.0.5" 95 | fake_async: 96 | dependency: transitive 97 | description: 98 | name: fake_async 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.3.1" 102 | ffi: 103 | dependency: transitive 104 | description: 105 | name: ffi 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "2.0.1" 109 | file: 110 | dependency: transitive 111 | description: 112 | name: file 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "6.1.4" 116 | flutter: 117 | dependency: "direct main" 118 | description: flutter 119 | source: sdk 120 | version: "0.0.0" 121 | flutter_bloc: 122 | dependency: "direct main" 123 | description: 124 | name: flutter_bloc 125 | url: "https://pub.dartlang.org" 126 | source: hosted 127 | version: "8.1.1" 128 | flutter_blurhash: 129 | dependency: transitive 130 | description: 131 | name: flutter_blurhash 132 | url: "https://pub.dartlang.org" 133 | source: hosted 134 | version: "0.7.0" 135 | flutter_cache_manager: 136 | dependency: transitive 137 | description: 138 | name: flutter_cache_manager 139 | url: "https://pub.dartlang.org" 140 | source: hosted 141 | version: "3.3.0" 142 | flutter_lints: 143 | dependency: "direct dev" 144 | description: 145 | name: flutter_lints 146 | url: "https://pub.dartlang.org" 147 | source: hosted 148 | version: "2.0.1" 149 | flutter_staggered_grid_view: 150 | dependency: "direct main" 151 | description: 152 | name: flutter_staggered_grid_view 153 | url: "https://pub.dartlang.org" 154 | source: hosted 155 | version: "0.6.2" 156 | flutter_test: 157 | dependency: "direct dev" 158 | description: flutter 159 | source: sdk 160 | version: "0.0.0" 161 | flutter_web_plugins: 162 | dependency: transitive 163 | description: flutter 164 | source: sdk 165 | version: "0.0.0" 166 | get_it: 167 | dependency: "direct main" 168 | description: 169 | name: get_it 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "7.2.0" 173 | http: 174 | dependency: "direct main" 175 | description: 176 | name: http 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.13.5" 180 | http_parser: 181 | dependency: transitive 182 | description: 183 | name: http_parser 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "4.0.2" 187 | js: 188 | dependency: transitive 189 | description: 190 | name: js 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "0.6.4" 194 | lints: 195 | dependency: transitive 196 | description: 197 | name: lints 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "2.0.1" 201 | matcher: 202 | dependency: transitive 203 | description: 204 | name: matcher 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "0.12.12" 208 | material_color_utilities: 209 | dependency: transitive 210 | description: 211 | name: material_color_utilities 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "0.1.5" 215 | meta: 216 | dependency: transitive 217 | description: 218 | name: meta 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.8.0" 222 | mime: 223 | dependency: transitive 224 | description: 225 | name: mime 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.0.3" 229 | nested: 230 | dependency: transitive 231 | description: 232 | name: nested 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.0.0" 236 | octo_image: 237 | dependency: transitive 238 | description: 239 | name: octo_image 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "1.0.2" 243 | path: 244 | dependency: transitive 245 | description: 246 | name: path 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "1.8.2" 250 | path_provider: 251 | dependency: transitive 252 | description: 253 | name: path_provider 254 | url: "https://pub.dartlang.org" 255 | source: hosted 256 | version: "2.0.11" 257 | path_provider_android: 258 | dependency: transitive 259 | description: 260 | name: path_provider_android 261 | url: "https://pub.dartlang.org" 262 | source: hosted 263 | version: "2.0.22" 264 | path_provider_ios: 265 | dependency: transitive 266 | description: 267 | name: path_provider_ios 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "2.0.11" 271 | path_provider_linux: 272 | dependency: transitive 273 | description: 274 | name: path_provider_linux 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "2.1.7" 278 | path_provider_macos: 279 | dependency: transitive 280 | description: 281 | name: path_provider_macos 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "2.0.6" 285 | path_provider_platform_interface: 286 | dependency: transitive 287 | description: 288 | name: path_provider_platform_interface 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "2.0.5" 292 | path_provider_windows: 293 | dependency: transitive 294 | description: 295 | name: path_provider_windows 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "2.1.3" 299 | pedantic: 300 | dependency: transitive 301 | description: 302 | name: pedantic 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.11.1" 306 | platform: 307 | dependency: transitive 308 | description: 309 | name: platform 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "3.1.0" 313 | plugin_platform_interface: 314 | dependency: transitive 315 | description: 316 | name: plugin_platform_interface 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "2.1.3" 320 | process: 321 | dependency: transitive 322 | description: 323 | name: process 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "4.2.4" 327 | provider: 328 | dependency: transitive 329 | description: 330 | name: provider 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "6.0.5" 334 | rxdart: 335 | dependency: transitive 336 | description: 337 | name: rxdart 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "0.27.7" 341 | share_plus: 342 | dependency: "direct main" 343 | description: 344 | name: share_plus 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "6.3.0" 348 | share_plus_platform_interface: 349 | dependency: transitive 350 | description: 351 | name: share_plus_platform_interface 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "3.2.0" 355 | shimmer: 356 | dependency: "direct main" 357 | description: 358 | name: shimmer 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "2.0.0" 362 | sky_engine: 363 | dependency: transitive 364 | description: flutter 365 | source: sdk 366 | version: "0.0.99" 367 | source_span: 368 | dependency: transitive 369 | description: 370 | name: source_span 371 | url: "https://pub.dartlang.org" 372 | source: hosted 373 | version: "1.9.0" 374 | sqflite: 375 | dependency: transitive 376 | description: 377 | name: sqflite 378 | url: "https://pub.dartlang.org" 379 | source: hosted 380 | version: "2.2.2" 381 | sqflite_common: 382 | dependency: transitive 383 | description: 384 | name: sqflite_common 385 | url: "https://pub.dartlang.org" 386 | source: hosted 387 | version: "2.4.0+2" 388 | stack_trace: 389 | dependency: transitive 390 | description: 391 | name: stack_trace 392 | url: "https://pub.dartlang.org" 393 | source: hosted 394 | version: "1.10.0" 395 | stream_channel: 396 | dependency: transitive 397 | description: 398 | name: stream_channel 399 | url: "https://pub.dartlang.org" 400 | source: hosted 401 | version: "2.1.0" 402 | string_scanner: 403 | dependency: transitive 404 | description: 405 | name: string_scanner 406 | url: "https://pub.dartlang.org" 407 | source: hosted 408 | version: "1.1.1" 409 | synchronized: 410 | dependency: transitive 411 | description: 412 | name: synchronized 413 | url: "https://pub.dartlang.org" 414 | source: hosted 415 | version: "3.0.0+3" 416 | term_glyph: 417 | dependency: transitive 418 | description: 419 | name: term_glyph 420 | url: "https://pub.dartlang.org" 421 | source: hosted 422 | version: "1.2.1" 423 | test_api: 424 | dependency: transitive 425 | description: 426 | name: test_api 427 | url: "https://pub.dartlang.org" 428 | source: hosted 429 | version: "0.4.12" 430 | typed_data: 431 | dependency: transitive 432 | description: 433 | name: typed_data 434 | url: "https://pub.dartlang.org" 435 | source: hosted 436 | version: "1.3.1" 437 | url_launcher_linux: 438 | dependency: transitive 439 | description: 440 | name: url_launcher_linux 441 | url: "https://pub.dartlang.org" 442 | source: hosted 443 | version: "3.0.1" 444 | url_launcher_platform_interface: 445 | dependency: transitive 446 | description: 447 | name: url_launcher_platform_interface 448 | url: "https://pub.dartlang.org" 449 | source: hosted 450 | version: "2.1.1" 451 | url_launcher_web: 452 | dependency: transitive 453 | description: 454 | name: url_launcher_web 455 | url: "https://pub.dartlang.org" 456 | source: hosted 457 | version: "2.0.13" 458 | url_launcher_windows: 459 | dependency: transitive 460 | description: 461 | name: url_launcher_windows 462 | url: "https://pub.dartlang.org" 463 | source: hosted 464 | version: "3.0.1" 465 | uuid: 466 | dependency: transitive 467 | description: 468 | name: uuid 469 | url: "https://pub.dartlang.org" 470 | source: hosted 471 | version: "3.0.7" 472 | vector_math: 473 | dependency: transitive 474 | description: 475 | name: vector_math 476 | url: "https://pub.dartlang.org" 477 | source: hosted 478 | version: "2.1.2" 479 | win32: 480 | dependency: transitive 481 | description: 482 | name: win32 483 | url: "https://pub.dartlang.org" 484 | source: hosted 485 | version: "3.1.3" 486 | xdg_directories: 487 | dependency: transitive 488 | description: 489 | name: xdg_directories 490 | url: "https://pub.dartlang.org" 491 | source: hosted 492 | version: "0.2.0+2" 493 | sdks: 494 | dart: ">=2.18.5 <3.0.0" 495 | flutter: ">=3.3.0" 496 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_chatgpt 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | # In Windows, build-name is used as the major, minor, and patch parts 19 | # of the product and file versions while build-number is used as the build suffix. 20 | version: 1.0.0+1 21 | 22 | environment: 23 | sdk: '>=2.18.5 <3.0.0' 24 | 25 | # Dependencies specify other packages that your package needs in order to work. 26 | # To automatically upgrade your package dependencies to the latest versions 27 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 28 | # dependencies can be manually updated by changing the version numbers below to 29 | # the latest version available on pub.dev. To see which dependencies have newer 30 | # versions available, run `flutter pub outdated`. 31 | dependencies: 32 | flutter: 33 | sdk: flutter 34 | flutter_bloc: ^8.0.0 35 | equatable: ^2.0.3 36 | http: ^0.13.5 37 | get_it: ^7.2.0 38 | flutter_staggered_grid_view: ^0.6.1 39 | cached_network_image: 3.2.3 40 | share_plus: ^6.3.0 41 | shimmer: ^2.0.0 42 | 43 | # The following adds the Cupertino Icons font to your application. 44 | # Use with the CupertinoIcons class for iOS style icons. 45 | cupertino_icons: ^1.0.2 46 | 47 | dev_dependencies: 48 | flutter_test: 49 | sdk: flutter 50 | 51 | # The "flutter_lints" package below contains a set of recommended lints to 52 | # encourage good coding practices. The lint set provided by the package is 53 | # activated in the `analysis_options.yaml` file located at the root of your 54 | # package. See that file for information about deactivating specific lint 55 | # rules and activating additional ones. 56 | flutter_lints: ^2.0.0 57 | 58 | # For information on the generic Dart part of this file, see the 59 | # following page: https://dart.dev/tools/pub/pubspec 60 | 61 | # The following section is specific to Flutter packages. 62 | flutter: 63 | 64 | # The following line ensures that the Material Icons font is 65 | # included with your application, so that you can use the icons in 66 | # the material Icons class. 67 | uses-material-design: true 68 | 69 | # To add assets to your application, add an assets section, like this: 70 | # assets: 71 | # - images/a_dot_burr.jpeg 72 | # - images/a_dot_ham.jpeg 73 | 74 | # An image asset can refer to one or more resolution-specific "variants", see 75 | # https://flutter.dev/assets-and-images/#resolution-aware 76 | 77 | # For details regarding adding assets from package dependencies, see 78 | # https://flutter.dev/assets-and-images/#from-packages 79 | 80 | # To add custom fonts to your application, add a fonts section here, 81 | # in this "flutter" section. Each entry in this list should have a 82 | # "family" key with the font family name, and a "fonts" key with a 83 | # list giving the asset and other descriptors for the font. For 84 | # example: 85 | # fonts: 86 | # - family: Schyler 87 | # fonts: 88 | # - asset: fonts/Schyler-Regular.ttf 89 | # - asset: fonts/Schyler-Italic.ttf 90 | # style: italic 91 | # - family: Trajan Pro 92 | # fonts: 93 | # - asset: fonts/TrajanPro.ttf 94 | # - asset: fonts/TrajanPro_Bold.ttf 95 | # weight: 700 96 | # 97 | # For details regarding fonts from package dependencies, 98 | # see https://flutter.dev/custom-fonts/#from-packages 99 | assets: 100 | - assets/app_logo.png 101 | - assets/loading.gif 102 | - assets/openai-avatar.png 103 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // // This is a basic Flutter widget test. 2 | // // 3 | // // To perform an interaction with a widget in your test, use the WidgetTester 4 | // // utility in the flutter_test package. For example, you can send tap and scroll 5 | // // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // // tree, read text, and verify that the values of widget properties are correct. 7 | // 8 | // import 'package:flutter/material.dart'; 9 | // import 'package:flutter_test/flutter_test.dart'; 10 | // 11 | // import 'package:flutter_chatgpt/main.dart'; 12 | // 13 | // void main() { 14 | // testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // // Build our app and trigger a frame. 16 | // await tester.pumpWidget(const MyApp()); 17 | // 18 | // // Verify that our counter starts at 0. 19 | // expect(find.text('0'), findsOneWidget); 20 | // expect(find.text('1'), findsNothing); 21 | // 22 | // // Tap the '+' icon and trigger a frame. 23 | // await tester.tap(find.byIcon(Icons.add)); 24 | // await tester.pump(); 25 | // 26 | // // Verify that our counter has incremented. 27 | // expect(find.text('0'), findsNothing); 28 | // expect(find.text('1'), findsOneWidget); 29 | // }); 30 | // } 31 | --------------------------------------------------------------------------------