├── .github └── workflows │ └── popular_movies.yml ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── popular_movies │ │ │ │ └── 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 ├── 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 │ ├── extention │ │ ├── list_extentions.dart │ │ └── movie_db_image_extention.dart │ ├── movie_data_factory.dart │ ├── network_error.dart │ └── services │ │ └── connectivity_service.dart ├── data │ ├── mapper │ │ ├── movie_domain_mapper.dart │ │ └── movie_domain_mapper.mapper.g.dart │ ├── repository │ │ └── movie_repository_impl.dart │ └── source │ │ ├── local │ │ ├── database │ │ │ ├── dao │ │ │ │ └── movie_dao.dart │ │ │ ├── db │ │ │ │ ├── movie_database.dart │ │ │ │ └── movie_database.g.dart │ │ │ └── model │ │ │ │ └── movie_entity.dart │ │ └── movie_local_data_source.dart │ │ ├── movie_data_store_factory.dart │ │ ├── movie_local_data_source.dart │ │ ├── movie_remote_data_source.dart │ │ └── remote │ │ ├── model │ │ ├── error_model.dart │ │ ├── error_model.g.dart │ │ ├── movie_list_response_model.dart │ │ ├── movie_list_response_model.g.dart │ │ ├── movie_response_model.dart │ │ ├── movie_response_model.g.dart │ │ ├── video_response.dart │ │ └── video_response.g.dart │ │ ├── movie_remote_data_source.dart │ │ ├── network_error_handler.dart │ │ └── service │ │ ├── movie_api_service.dart │ │ └── movie_api_service.g.dart ├── di │ ├── di.config.dart │ ├── di.dart │ └── module │ │ ├── database_module.dart │ │ └── network_module.dart ├── domain │ ├── model │ │ ├── movie.dart │ │ ├── movie_details.dart │ │ └── video.dart │ ├── repository │ │ └── movie_repository.dart │ └── usecases │ │ ├── get_movie_detail_use_case.dart │ │ ├── get_movie_videos_use_case.dart │ │ ├── get_movies_use_case.dart │ │ └── impl │ │ ├── get_movie_detail_use_case_impl.dart │ │ ├── get_movie_videos_use_case_impl.dart │ │ └── get_movies_use_case_impl.dart ├── main.dart ├── main_app.dart ├── presentation │ ├── features │ │ ├── movie_detail │ │ │ ├── state │ │ │ │ ├── movie_details_state.dart │ │ │ │ └── movie_details_state.freezed.dart │ │ │ ├── view │ │ │ │ └── movie_details_screen.dart │ │ │ └── view_model │ │ │ │ └── movie_details_view_model.dart │ │ └── movies │ │ │ ├── state │ │ │ ├── movie_state.dart │ │ │ └── movie_state.freezed.dart │ │ │ ├── view │ │ │ └── movies_screen.dart │ │ │ └── view_model │ │ │ └── movies_view_model.dart │ └── view │ │ └── base_view.dart └── res │ └── constants.dart ├── pubspec.yaml ├── screenshots ├── movie_details.png └── movies_screen.png └── test └── data └── repository ├── movie_repository_impl_test.dart └── movie_repository_impl_test.mocks.dart /.github/workflows/popular_movies.yml: -------------------------------------------------------------------------------- 1 | name: popular_movies 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | runs-on: macos-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: actions/setup-java@v2 15 | with: 16 | distribution: 'zulu' 17 | java-version: '11' 18 | - uses: subosito/flutter-action@v2 19 | with: 20 | flutter-version: '3.0.1' 21 | channel: 'stable' 22 | - run: flutter pub get 23 | - run: flutter packages pub run build_runner build --delete-conflicting-outputs 24 | - run: flutter analyze 25 | - run: flutter test 26 | - run: flutter build apk 27 | -------------------------------------------------------------------------------- /.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 | # Web related 36 | lib/generated_plugin_registrant.dart 37 | 38 | # Symbolication related 39 | app.*.symbols 40 | 41 | # Obfuscation related 42 | app.*.map.json 43 | 44 | # Android Studio will place build artifacts here 45 | /android/app/debug 46 | /android/app/profile 47 | /android/app/release 48 | -------------------------------------------------------------------------------- /.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: fb57da5f945d02ef4f98dfd9409a72b7cce74268 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: fb57da5f945d02ef4f98dfd9409a72b7cce74268 17 | base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 18 | - platform: android 19 | create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 20 | base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 21 | - platform: ios 22 | create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 23 | base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 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-Popular Movies | Clean Architecture 2 | ![CI](https://github.com/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture/workflows/popular_movies/badge.svg) 3 | [![GitHub stars](https://img.shields.io/github/stars/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture?style=social)](https://github.com/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture) 4 | ![GitHub forks](https://img.shields.io/github/forks/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture?style=social) 5 | ![GitHub pull requests](https://img.shields.io/github/issues-pr/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture) 6 | ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture) 7 | ![GitHub last commit](https://img.shields.io/github/last-commit/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture) 8 | ![GitHub issues](https://img.shields.io/github/issues-raw/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture) 9 | [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/ashishrawat2911/Flutter-PopularMovies-CleanArchitecture) 10 | 11 | The purpose of this repository is to follow up Clean Architecture principles by bringing them to Flutter. 12 | 13 | ### ScreenShots 14 | 15 | 16 | 17 | ## Created & Maintained By 18 | [Ashish Rawat](https://linktr.ee/ashishrawat2911) -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | analyzer: 3 | exclude: 4 | - lib/**.g.dart 5 | - lib/**.freezed.dart 6 | linter: 7 | rules: 8 | -------------------------------------------------------------------------------- /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.popular_movies" 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/popular_movies/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.popular_movies 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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 9.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, '9.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 | - connectivity_plus (0.0.1): 3 | - Flutter 4 | - ReachabilitySwift 5 | - Flutter (1.0.0) 6 | - FMDB (2.7.5): 7 | - FMDB/standard (= 2.7.5) 8 | - FMDB/standard (2.7.5) 9 | - path_provider_ios (0.0.1): 10 | - Flutter 11 | - ReachabilitySwift (5.0.0) 12 | - sqflite (0.0.2): 13 | - Flutter 14 | - FMDB (>= 2.7.5) 15 | 16 | DEPENDENCIES: 17 | - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) 18 | - Flutter (from `Flutter`) 19 | - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) 20 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 21 | 22 | SPEC REPOS: 23 | trunk: 24 | - FMDB 25 | - ReachabilitySwift 26 | 27 | EXTERNAL SOURCES: 28 | connectivity_plus: 29 | :path: ".symlinks/plugins/connectivity_plus/ios" 30 | Flutter: 31 | :path: Flutter 32 | path_provider_ios: 33 | :path: ".symlinks/plugins/path_provider_ios/ios" 34 | sqflite: 35 | :path: ".symlinks/plugins/sqflite/ios" 36 | 37 | SPEC CHECKSUMS: 38 | connectivity_plus: 413a8857dd5d9f1c399a39130850d02fe0feaf7e 39 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a 40 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 41 | path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 42 | ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 43 | sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 44 | 45 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 46 | 47 | COCOAPODS: 1.11.3 48 | -------------------------------------------------------------------------------- /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 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | BFA3D83718C7BB34251FCDD4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BED859A4616186D7C65D6DA5 /* Pods_Runner.framework */; }; 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 | 476621E2E3059742C73D2CED /* 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 = ""; }; 37 | 5AC32C339C9B22BCA8BE188A /* 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 = ""; }; 38 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 39 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 41 | 85E2D9048FC929A0A7ADEA4B /* 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 = ""; }; 42 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 43 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 44 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | BED859A4616186D7C65D6DA5 /* 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 | BFA3D83718C7BB34251FCDD4 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 41CFB13D5A12A8F261B55DE3 /* Frameworks */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | BED859A4616186D7C65D6DA5 /* Pods_Runner.framework */, 68 | ); 69 | name = Frameworks; 70 | sourceTree = ""; 71 | }; 72 | 618BD33CDEC1FDC8D7FFB32A /* Pods */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 476621E2E3059742C73D2CED /* Pods-Runner.debug.xcconfig */, 76 | 85E2D9048FC929A0A7ADEA4B /* Pods-Runner.release.xcconfig */, 77 | 5AC32C339C9B22BCA8BE188A /* Pods-Runner.profile.xcconfig */, 78 | ); 79 | name = Pods; 80 | path = Pods; 81 | sourceTree = ""; 82 | }; 83 | 9740EEB11CF90186004384FC /* Flutter */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 87 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 88 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 89 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 90 | ); 91 | name = Flutter; 92 | sourceTree = ""; 93 | }; 94 | 97C146E51CF9000F007C117D = { 95 | isa = PBXGroup; 96 | children = ( 97 | 9740EEB11CF90186004384FC /* Flutter */, 98 | 97C146F01CF9000F007C117D /* Runner */, 99 | 97C146EF1CF9000F007C117D /* Products */, 100 | 618BD33CDEC1FDC8D7FFB32A /* Pods */, 101 | 41CFB13D5A12A8F261B55DE3 /* Frameworks */, 102 | ); 103 | sourceTree = ""; 104 | }; 105 | 97C146EF1CF9000F007C117D /* Products */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 97C146EE1CF9000F007C117D /* Runner.app */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 97C146F01CF9000F007C117D /* Runner */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 117 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 118 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 119 | 97C147021CF9000F007C117D /* Info.plist */, 120 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 121 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 122 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 123 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 124 | ); 125 | path = Runner; 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 | E137E8415170A9AA812FC98D /* [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 | EC1E0D933D069B1937413535 /* [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 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | ); 208 | name = "Thin Binary"; 209 | outputPaths = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | shellPath = /bin/sh; 213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 214 | }; 215 | 9740EEB61CF901F6004384FC /* Run Script */ = { 216 | isa = PBXShellScriptBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | inputPaths = ( 221 | ); 222 | name = "Run Script"; 223 | outputPaths = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | shellPath = /bin/sh; 227 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 228 | }; 229 | E137E8415170A9AA812FC98D /* [CP] Check Pods Manifest.lock */ = { 230 | isa = PBXShellScriptBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | inputFileListPaths = ( 235 | ); 236 | inputPaths = ( 237 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 238 | "${PODS_ROOT}/Manifest.lock", 239 | ); 240 | name = "[CP] Check Pods Manifest.lock"; 241 | outputFileListPaths = ( 242 | ); 243 | outputPaths = ( 244 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | shellPath = /bin/sh; 248 | 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"; 249 | showEnvVarsInLog = 0; 250 | }; 251 | EC1E0D933D069B1937413535 /* [CP] Embed Pods Frameworks */ = { 252 | isa = PBXShellScriptBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | inputFileListPaths = ( 257 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 258 | ); 259 | name = "[CP] Embed Pods Frameworks"; 260 | outputFileListPaths = ( 261 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 266 | showEnvVarsInLog = 0; 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 = 9.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 | ENABLE_BITCODE = NO; 360 | INFOPLIST_FILE = Runner/Info.plist; 361 | LD_RUNPATH_SEARCH_PATHS = ( 362 | "$(inherited)", 363 | "@executable_path/Frameworks", 364 | ); 365 | PRODUCT_BUNDLE_IDENTIFIER = com.example.popularMovies; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 368 | SWIFT_VERSION = 5.0; 369 | VERSIONING_SYSTEM = "apple-generic"; 370 | }; 371 | name = Profile; 372 | }; 373 | 97C147031CF9000F007C117D /* Debug */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ALWAYS_SEARCH_USER_PATHS = NO; 377 | CLANG_ANALYZER_NONNULL = YES; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = YES; 382 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 383 | CLANG_WARN_BOOL_CONVERSION = YES; 384 | CLANG_WARN_COMMA = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_EMPTY_BODY = YES; 389 | CLANG_WARN_ENUM_CONVERSION = YES; 390 | CLANG_WARN_INFINITE_RECURSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 397 | CLANG_WARN_STRICT_PROTOTYPES = YES; 398 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 399 | CLANG_WARN_UNREACHABLE_CODE = YES; 400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 402 | COPY_PHASE_STRIP = NO; 403 | DEBUG_INFORMATION_FORMAT = dwarf; 404 | ENABLE_STRICT_OBJC_MSGSEND = YES; 405 | ENABLE_TESTABILITY = YES; 406 | GCC_C_LANGUAGE_STANDARD = gnu99; 407 | GCC_DYNAMIC_NO_PIC = NO; 408 | GCC_NO_COMMON_BLOCKS = YES; 409 | GCC_OPTIMIZATION_LEVEL = 0; 410 | GCC_PREPROCESSOR_DEFINITIONS = ( 411 | "DEBUG=1", 412 | "$(inherited)", 413 | ); 414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 415 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 416 | GCC_WARN_UNDECLARED_SELECTOR = YES; 417 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 418 | GCC_WARN_UNUSED_FUNCTION = YES; 419 | GCC_WARN_UNUSED_VARIABLE = YES; 420 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 421 | MTL_ENABLE_DEBUG_INFO = YES; 422 | ONLY_ACTIVE_ARCH = YES; 423 | SDKROOT = iphoneos; 424 | TARGETED_DEVICE_FAMILY = "1,2"; 425 | }; 426 | name = Debug; 427 | }; 428 | 97C147041CF9000F007C117D /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ANALYZER_NONNULL = YES; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_COMMA = YES; 440 | CLANG_WARN_CONSTANT_CONVERSION = YES; 441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 443 | CLANG_WARN_EMPTY_BODY = YES; 444 | CLANG_WARN_ENUM_CONVERSION = YES; 445 | CLANG_WARN_INFINITE_RECURSION = YES; 446 | CLANG_WARN_INT_CONVERSION = YES; 447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 448 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 452 | CLANG_WARN_STRICT_PROTOTYPES = YES; 453 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 454 | CLANG_WARN_UNREACHABLE_CODE = YES; 455 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 456 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 457 | COPY_PHASE_STRIP = NO; 458 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 459 | ENABLE_NS_ASSERTIONS = NO; 460 | ENABLE_STRICT_OBJC_MSGSEND = YES; 461 | GCC_C_LANGUAGE_STANDARD = gnu99; 462 | GCC_NO_COMMON_BLOCKS = YES; 463 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 464 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 465 | GCC_WARN_UNDECLARED_SELECTOR = YES; 466 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 467 | GCC_WARN_UNUSED_FUNCTION = YES; 468 | GCC_WARN_UNUSED_VARIABLE = YES; 469 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 470 | MTL_ENABLE_DEBUG_INFO = NO; 471 | SDKROOT = iphoneos; 472 | SUPPORTED_PLATFORMS = iphoneos; 473 | SWIFT_COMPILATION_MODE = wholemodule; 474 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 475 | TARGETED_DEVICE_FAMILY = "1,2"; 476 | VALIDATE_PRODUCT = YES; 477 | }; 478 | name = Release; 479 | }; 480 | 97C147061CF9000F007C117D /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 483 | buildSettings = { 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | CLANG_ENABLE_MODULES = YES; 486 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 487 | ENABLE_BITCODE = NO; 488 | INFOPLIST_FILE = Runner/Info.plist; 489 | LD_RUNPATH_SEARCH_PATHS = ( 490 | "$(inherited)", 491 | "@executable_path/Frameworks", 492 | ); 493 | PRODUCT_BUNDLE_IDENTIFIER = com.example.popularMovies; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 496 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 497 | SWIFT_VERSION = 5.0; 498 | VERSIONING_SYSTEM = "apple-generic"; 499 | }; 500 | name = Debug; 501 | }; 502 | 97C147071CF9000F007C117D /* Release */ = { 503 | isa = XCBuildConfiguration; 504 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 505 | buildSettings = { 506 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 507 | CLANG_ENABLE_MODULES = YES; 508 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 509 | ENABLE_BITCODE = NO; 510 | INFOPLIST_FILE = Runner/Info.plist; 511 | LD_RUNPATH_SEARCH_PATHS = ( 512 | "$(inherited)", 513 | "@executable_path/Frameworks", 514 | ); 515 | PRODUCT_BUNDLE_IDENTIFIER = com.example.popularMovies; 516 | PRODUCT_NAME = "$(TARGET_NAME)"; 517 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 518 | SWIFT_VERSION = 5.0; 519 | VERSIONING_SYSTEM = "apple-generic"; 520 | }; 521 | name = Release; 522 | }; 523 | /* End XCBuildConfiguration section */ 524 | 525 | /* Begin XCConfigurationList section */ 526 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | 97C147031CF9000F007C117D /* Debug */, 530 | 97C147041CF9000F007C117D /* Release */, 531 | 249021D3217E4FDB00AE95B9 /* Profile */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 97C147061CF9000F007C117D /* Debug */, 540 | 97C147071CF9000F007C117D /* Release */, 541 | 249021D4217E4FDB00AE95B9 /* Profile */, 542 | ); 543 | defaultConfigurationIsVisible = 0; 544 | defaultConfigurationName = Release; 545 | }; 546 | /* End XCConfigurationList section */ 547 | }; 548 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 549 | } 550 | -------------------------------------------------------------------------------- /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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ashishrawat2911/Flutter-Clean-Architecture/e2fc8c61d24dab070a06da714ef64fef63b619a4/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 | Popular Movies 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | popular_movies 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 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/core/extention/list_extentions.dart: -------------------------------------------------------------------------------- 1 | extension ListExt on List { 2 | List mapToList(T Function(E e) toElement) => map(toElement).toList(); 3 | } 4 | -------------------------------------------------------------------------------- /lib/core/extention/movie_db_image_extention.dart: -------------------------------------------------------------------------------- 1 | import 'package:popular_movies/res/constants.dart'; 2 | 3 | extension MovieDbImage on String { 4 | String get getMovieDBImage => Constants.movieImagePath + this; 5 | 6 | String get getYoutubeWatchBaseURL => Constants.youtubeWatchBaseURL + this; 7 | 8 | String get getYoutubeThumbnailBaseURl => 9 | Constants.youtubeThumbnailBaseURl + this + Constants.youtubeThumbnailImageQuality; 10 | } 11 | -------------------------------------------------------------------------------- /lib/core/movie_data_factory.dart: -------------------------------------------------------------------------------- 1 | import 'package:faker/faker.dart'; 2 | import 'package:popular_movies/domain/model/movie_details.dart'; 3 | 4 | import 'network_error.dart'; 5 | 6 | class MovieDataFactory { 7 | static final RandomGenerator _randomGenerator = RandomGenerator(); 8 | 9 | static MovieDetails getMovieDetails() { 10 | return MovieDetails( 11 | _randomGenerator.string(10), 12 | _randomGenerator.string(10), 13 | _randomGenerator.decimal(), 14 | _randomGenerator.string(10), 15 | ); 16 | } 17 | 18 | static NetworkError getNetworkError() { 19 | return NetworkError(_randomGenerator.string(10), _randomGenerator.integer(10)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/core/network_error.dart: -------------------------------------------------------------------------------- 1 | class NetworkError { 2 | String errorMessage; 3 | int status; 4 | 5 | NetworkError(this.errorMessage, this.status); 6 | 7 | @override 8 | String toString() { 9 | return 'NetworkError{errorMessage: $errorMessage, status: $status}'; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/core/services/connectivity_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:connectivity_plus/connectivity_plus.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | 7 | @Singleton() 8 | class ConnectivityService { 9 | final Connectivity _connectivity; 10 | 11 | ConnectivityService(this._connectivity); 12 | 13 | Stream get onConnectionChange => 14 | _connectivity.onConnectivityChanged.map((event) => _isConnectedToInternet(event)); 15 | 16 | bool _isConnectedToInternet(ConnectivityResult event) { 17 | return event == ConnectivityResult.mobile || 18 | event == ConnectivityResult.ethernet || 19 | event == ConnectivityResult.mobile; 20 | } 21 | 22 | Future checkInternetConnection() async { 23 | bool hasConnection = false; 24 | try { 25 | final result = await InternetAddress.lookup('google.com'); 26 | if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { 27 | hasConnection = true; 28 | } else { 29 | hasConnection = false; 30 | } 31 | } on SocketException catch (_) { 32 | hasConnection = false; 33 | } 34 | return hasConnection; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/data/mapper/movie_domain_mapper.dart: -------------------------------------------------------------------------------- 1 | import 'package:popular_movies/data/source/local/database/model/movie_entity.dart'; 2 | import 'package:popular_movies/data/source/remote/model/video_response.dart'; 3 | import 'package:popular_movies/domain/model/movie.dart'; 4 | import 'package:popular_movies/domain/model/movie_details.dart'; 5 | import 'package:popular_movies/domain/model/video.dart'; 6 | import 'package:smartstruct/smartstruct.dart'; 7 | import 'package:injectable/injectable.dart'; 8 | import '../source/remote/model/movie_response_model.dart'; 9 | 10 | part 'movie_domain_mapper.mapper.g.dart'; 11 | 12 | @Mapper(useInjection: true) 13 | abstract class MovieDomainMapper { 14 | MovieDetails movieEntityToMovieDetails(MovieEntity movieEntity); 15 | 16 | Movie movieEntityToMovie(MovieEntity movieEntity); 17 | 18 | MovieDetails movieResponseToMovieDetails(MovieResponseModel movieResponseModel); 19 | 20 | MovieEntity movieResponseToMovieEntity(MovieResponseModel movieResponseModel); 21 | 22 | Movie movieResponseToMovie(MovieResponseModel movieResponseModel); 23 | 24 | Video videoResponseToVideo(VideoResponse videoResponse); 25 | } 26 | -------------------------------------------------------------------------------- /lib/data/mapper/movie_domain_mapper.mapper.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_domain_mapper.dart'; 4 | 5 | // ************************************************************************** 6 | // MapperGenerator 7 | // ************************************************************************** 8 | 9 | @LazySingleton(as: MovieDomainMapper) 10 | class MovieDomainMapperImpl extends MovieDomainMapper { 11 | MovieDomainMapperImpl() : super(); 12 | 13 | @override 14 | MovieDetails movieEntityToMovieDetails(MovieEntity movieEntity) { 15 | final moviedetails = MovieDetails(movieEntity.backdropPath, 16 | movieEntity.title, movieEntity.voteAverage, movieEntity.overview); 17 | return moviedetails; 18 | } 19 | 20 | @override 21 | Movie movieEntityToMovie(MovieEntity movieEntity) { 22 | final movie = Movie(movieEntity.id, movieEntity.posterPath, 23 | movieEntity.title, movieEntity.voteAverage, movieEntity.overview); 24 | return movie; 25 | } 26 | 27 | @override 28 | MovieDetails movieResponseToMovieDetails( 29 | MovieResponseModel movieResponseModel) { 30 | final moviedetails = MovieDetails( 31 | movieResponseModel.backdropPath, 32 | movieResponseModel.title, 33 | movieResponseModel.voteAverage, 34 | movieResponseModel.overview); 35 | return moviedetails; 36 | } 37 | 38 | @override 39 | MovieEntity movieResponseToMovieEntity( 40 | MovieResponseModel movieResponseModel) { 41 | final movieentity = MovieEntity( 42 | movieResponseModel.id, 43 | movieResponseModel.posterPath, 44 | movieResponseModel.backdropPath, 45 | movieResponseModel.title, 46 | movieResponseModel.voteAverage, 47 | movieResponseModel.overview); 48 | return movieentity; 49 | } 50 | 51 | @override 52 | Movie movieResponseToMovie(MovieResponseModel movieResponseModel) { 53 | final movie = Movie( 54 | movieResponseModel.id, 55 | movieResponseModel.posterPath, 56 | movieResponseModel.title, 57 | movieResponseModel.voteAverage, 58 | movieResponseModel.overview); 59 | return movie; 60 | } 61 | 62 | @override 63 | Video videoResponseToVideo(VideoResponse videoResponse) { 64 | final video = Video(videoResponse.id, videoResponse.key, videoResponse.name, 65 | videoResponse.site, videoResponse.size, videoResponse.type); 66 | return video; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/data/repository/movie_repository_impl.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:popular_movies/core/network_error.dart'; 4 | import 'package:popular_movies/data/source/movie_data_store_factory.dart'; 5 | import 'package:popular_movies/data/source/remote/network_error_handler.dart'; 6 | import 'package:popular_movies/domain/model/movie.dart'; 7 | import 'package:popular_movies/domain/model/movie_details.dart'; 8 | import 'package:popular_movies/domain/model/video.dart'; 9 | import 'package:popular_movies/domain/repository/movie_repository.dart'; 10 | 11 | @Injectable(as: MovieRepository) 12 | class MovieRepositoryImpl extends MovieRepository { 13 | final MovieDataStoreFactory _movieDataStoreFactory; 14 | final NetworkErrorHandler _networkErrorHandler; 15 | 16 | MovieRepositoryImpl(this._movieDataStoreFactory, this._networkErrorHandler); 17 | 18 | @override 19 | Future> getMovieDetail(int id) async { 20 | try { 21 | final movie = await _movieDataStoreFactory.getMovieDetails(id); 22 | return Right(movie); 23 | } catch (e) { 24 | return Left(_networkErrorHandler.getNetworkError(e)); 25 | } 26 | } 27 | 28 | @override 29 | Future>> getPopularMovies() async { 30 | try { 31 | final movies = await _movieDataStoreFactory.getMovies(); 32 | return Right(movies); 33 | } catch (e) { 34 | return Left(_networkErrorHandler.getNetworkError(e)); 35 | } 36 | } 37 | 38 | @override 39 | Future>> getMovieVideos(int id) async { 40 | try { 41 | final videos = await _movieDataStoreFactory.getMovieVideos(id); 42 | return Right(videos); 43 | } catch (e) { 44 | return Left(_networkErrorHandler.getNetworkError(e)); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/data/source/local/database/dao/movie_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | import 'package:popular_movies/data/source/local/database/model/movie_entity.dart'; 3 | 4 | @dao 5 | abstract class MovieDao { 6 | @Query('SELECT * FROM MovieEntity') 7 | Future> findAllMovies(); 8 | 9 | @Query('SELECT * FROM MovieEntity WHERE id = :id') 10 | Future findMovieById(int id); 11 | 12 | @Insert(onConflict: OnConflictStrategy.replace) 13 | Future insertMovie(MovieEntity movie); 14 | 15 | @Insert(onConflict: OnConflictStrategy.replace) 16 | Future insertMovies(List movie); 17 | } 18 | -------------------------------------------------------------------------------- /lib/data/source/local/database/db/movie_database.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:floor/floor.dart'; 4 | import 'package:sqflite/sqflite.dart' as sqflite; 5 | 6 | import '../dao/movie_dao.dart'; 7 | import '../model/movie_entity.dart'; 8 | 9 | part 'movie_database.g.dart'; // the generated code will be there 10 | 11 | @Database(version: 1, entities: [MovieEntity]) 12 | abstract class MovieDatabase extends FloorDatabase { 13 | MovieDao get movieDao; 14 | } 15 | -------------------------------------------------------------------------------- /lib/data/source/local/database/db/movie_database.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_database.dart'; 4 | 5 | // ************************************************************************** 6 | // FloorGenerator 7 | // ************************************************************************** 8 | 9 | // ignore: avoid_classes_with_only_static_members 10 | class $FloorMovieDatabase { 11 | /// Creates a database builder for a persistent database. 12 | /// Once a database is built, you should keep a reference to it and re-use it. 13 | static _$MovieDatabaseBuilder databaseBuilder(String name) => 14 | _$MovieDatabaseBuilder(name); 15 | 16 | /// Creates a database builder for an in memory database. 17 | /// Information stored in an in memory database disappears when the process is killed. 18 | /// Once a database is built, you should keep a reference to it and re-use it. 19 | static _$MovieDatabaseBuilder inMemoryDatabaseBuilder() => 20 | _$MovieDatabaseBuilder(null); 21 | } 22 | 23 | class _$MovieDatabaseBuilder { 24 | _$MovieDatabaseBuilder(this.name); 25 | 26 | final String? name; 27 | 28 | final List _migrations = []; 29 | 30 | Callback? _callback; 31 | 32 | /// Adds migrations to the builder. 33 | _$MovieDatabaseBuilder addMigrations(List migrations) { 34 | _migrations.addAll(migrations); 35 | return this; 36 | } 37 | 38 | /// Adds a database [Callback] to the builder. 39 | _$MovieDatabaseBuilder addCallback(Callback callback) { 40 | _callback = callback; 41 | return this; 42 | } 43 | 44 | /// Creates the database and initializes it. 45 | Future build() async { 46 | final path = name != null 47 | ? await sqfliteDatabaseFactory.getDatabasePath(name!) 48 | : ':memory:'; 49 | final database = _$MovieDatabase(); 50 | database.database = await database.open( 51 | path, 52 | _migrations, 53 | _callback, 54 | ); 55 | return database; 56 | } 57 | } 58 | 59 | class _$MovieDatabase extends MovieDatabase { 60 | _$MovieDatabase([StreamController? listener]) { 61 | changeListener = listener ?? StreamController.broadcast(); 62 | } 63 | 64 | MovieDao? _movieDaoInstance; 65 | 66 | Future open(String path, List migrations, 67 | [Callback? callback]) async { 68 | final databaseOptions = sqflite.OpenDatabaseOptions( 69 | version: 1, 70 | onConfigure: (database) async { 71 | await database.execute('PRAGMA foreign_keys = ON'); 72 | await callback?.onConfigure?.call(database); 73 | }, 74 | onOpen: (database) async { 75 | await callback?.onOpen?.call(database); 76 | }, 77 | onUpgrade: (database, startVersion, endVersion) async { 78 | await MigrationAdapter.runMigrations( 79 | database, startVersion, endVersion, migrations); 80 | 81 | await callback?.onUpgrade?.call(database, startVersion, endVersion); 82 | }, 83 | onCreate: (database, version) async { 84 | await database.execute( 85 | 'CREATE TABLE IF NOT EXISTS `MovieEntity` (`id` INTEGER NOT NULL, `posterPath` TEXT NOT NULL, `backdropPath` TEXT NOT NULL, `title` TEXT NOT NULL, `voteAverage` REAL NOT NULL, `overview` TEXT NOT NULL, PRIMARY KEY (`id`))'); 86 | 87 | await callback?.onCreate?.call(database, version); 88 | }, 89 | ); 90 | return sqfliteDatabaseFactory.openDatabase(path, options: databaseOptions); 91 | } 92 | 93 | @override 94 | MovieDao get movieDao { 95 | return _movieDaoInstance ??= _$MovieDao(database, changeListener); 96 | } 97 | } 98 | 99 | class _$MovieDao extends MovieDao { 100 | _$MovieDao(this.database, this.changeListener) 101 | : _queryAdapter = QueryAdapter(database), 102 | _movieEntityInsertionAdapter = InsertionAdapter( 103 | database, 104 | 'MovieEntity', 105 | (MovieEntity item) => { 106 | 'id': item.id, 107 | 'posterPath': item.posterPath, 108 | 'backdropPath': item.backdropPath, 109 | 'title': item.title, 110 | 'voteAverage': item.voteAverage, 111 | 'overview': item.overview 112 | }); 113 | 114 | final sqflite.DatabaseExecutor database; 115 | 116 | final StreamController changeListener; 117 | 118 | final QueryAdapter _queryAdapter; 119 | 120 | final InsertionAdapter _movieEntityInsertionAdapter; 121 | 122 | @override 123 | Future> findAllMovies() async { 124 | return _queryAdapter.queryList('SELECT * FROM MovieEntity', 125 | mapper: (Map row) => MovieEntity( 126 | row['id'] as int, 127 | row['posterPath'] as String, 128 | row['backdropPath'] as String, 129 | row['title'] as String, 130 | row['voteAverage'] as double, 131 | row['overview'] as String)); 132 | } 133 | 134 | @override 135 | Future findMovieById(int id) async { 136 | return _queryAdapter.query('SELECT * FROM MovieEntity WHERE id = ?1', 137 | mapper: (Map row) => MovieEntity( 138 | row['id'] as int, 139 | row['posterPath'] as String, 140 | row['backdropPath'] as String, 141 | row['title'] as String, 142 | row['voteAverage'] as double, 143 | row['overview'] as String), 144 | arguments: [id]); 145 | } 146 | 147 | @override 148 | Future insertMovie(MovieEntity movie) async { 149 | await _movieEntityInsertionAdapter.insert( 150 | movie, OnConflictStrategy.replace); 151 | } 152 | 153 | @override 154 | Future insertMovies(List movie) async { 155 | await _movieEntityInsertionAdapter.insertList( 156 | movie, OnConflictStrategy.replace); 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /lib/data/source/local/database/model/movie_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:floor/floor.dart'; 2 | 3 | @entity 4 | class MovieEntity { 5 | @primaryKey 6 | int id; 7 | String posterPath; 8 | String backdropPath; 9 | String title; 10 | double voteAverage; 11 | String overview; 12 | 13 | MovieEntity(this.id, this.posterPath, this.backdropPath, this.title, this.voteAverage, this.overview); 14 | } 15 | -------------------------------------------------------------------------------- /lib/data/source/local/movie_local_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:popular_movies/data/source/local/database/dao/movie_dao.dart'; 3 | import 'package:popular_movies/data/source/movie_local_data_source.dart'; 4 | 5 | import 'database/model/movie_entity.dart'; 6 | 7 | @Injectable(as: MovieLocalDataSource) 8 | class MovieLocalDataSourceImpl extends MovieLocalDataSource { 9 | final MovieDao _movieDao; 10 | 11 | MovieLocalDataSourceImpl( 12 | this._movieDao, 13 | ); 14 | 15 | @override 16 | Future> getMovies() async { 17 | return _movieDao.findAllMovies(); 18 | } 19 | 20 | @override 21 | Future movieDetails(int id) async { 22 | return _movieDao.findMovieById(id); 23 | } 24 | 25 | @override 26 | Future saveMovies(List movies) { 27 | return _movieDao.insertMovies(movies); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/data/source/movie_data_store_factory.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:popular_movies/core/extention/list_extentions.dart'; 3 | import 'package:popular_movies/core/services/connectivity_service.dart'; 4 | import 'package:popular_movies/data/mapper/movie_domain_mapper.dart'; 5 | import 'package:popular_movies/data/source/movie_local_data_source.dart'; 6 | import 'package:popular_movies/data/source/movie_remote_data_source.dart'; 7 | import 'package:popular_movies/domain/model/movie_details.dart'; 8 | import 'package:popular_movies/domain/model/video.dart'; 9 | 10 | import '../../domain/model/movie.dart'; 11 | 12 | @singleton 13 | class MovieDataStoreFactory { 14 | final MovieDomainMapper _movieMapper; 15 | final MovieLocalDataSource _movieLocalDataSource; 16 | final MovieRemoteDataSource _movieRemoteDataSource; 17 | final ConnectivityService connectivityService; 18 | 19 | MovieDataStoreFactory( 20 | this._movieMapper, 21 | this._movieLocalDataSource, 22 | this._movieRemoteDataSource, 23 | this.connectivityService, 24 | ); 25 | 26 | Future getMovieDetails(int id) async { 27 | /* 28 | Fetch the movie details from the DB, if not available then get it from API 29 | */ 30 | final cacheMovie = await _movieLocalDataSource.movieDetails(id); 31 | if (cacheMovie == null) { 32 | final movie = await _movieRemoteDataSource.getMovieDetails(id); 33 | return _movieMapper.movieResponseToMovieDetails(movie); 34 | } else { 35 | return _movieMapper.movieEntityToMovieDetails(cacheMovie); 36 | } 37 | } 38 | 39 | Future> getMovies() async { 40 | /* 41 | Check if there is no network connection then retrieve the data from the DB. 42 | */ 43 | if (await connectivityService.checkInternetConnection()) { 44 | final movies = await _movieRemoteDataSource.getMovies(); 45 | _movieLocalDataSource.saveMovies(movies.map((e) => _movieMapper.movieResponseToMovieEntity(e)).toList()); 46 | return movies.mapToList((e) => _movieMapper.movieResponseToMovie(e)); 47 | } else { 48 | final cacheMovies = await _movieLocalDataSource.getMovies(); 49 | return cacheMovies.mapToList((movieEntity) => _movieMapper.movieEntityToMovie(movieEntity)); 50 | } 51 | } 52 | 53 | Future> getMovieVideos(int id) async { 54 | final videos = await _movieRemoteDataSource.getMovieVideos(id); 55 | return videos.mapToList((e) => _movieMapper.videoResponseToVideo(e)); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/data/source/movie_local_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:popular_movies/data/source/local/database/model/movie_entity.dart'; 2 | 3 | abstract class MovieLocalDataSource { 4 | Future> getMovies(); 5 | 6 | Future movieDetails(int id); 7 | 8 | Future saveMovies(List movies); 9 | } 10 | -------------------------------------------------------------------------------- /lib/data/source/movie_remote_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:popular_movies/data/source/remote/model/movie_response_model.dart'; 2 | import 'package:popular_movies/data/source/remote/model/video_response.dart'; 3 | 4 | abstract class MovieRemoteDataSource { 5 | Future> getMovies(); 6 | 7 | Future getMovieDetails(int id); 8 | 9 | Future> getMovieVideos(int id); 10 | } 11 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/error_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'error_model.g.dart'; 4 | 5 | @JsonSerializable(fieldRename: FieldRename.snake) 6 | class ErrorModel { 7 | String statusMessage; 8 | int statusCode; 9 | 10 | ErrorModel(this.statusMessage, this.statusCode); 11 | factory ErrorModel.fromJson(json) => _$ErrorModelFromJson(json); 12 | } 13 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/error_model.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'error_model.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ErrorModel _$ErrorModelFromJson(Map json) => ErrorModel( 10 | json['status_message'] as String, 11 | json['status_code'] as int, 12 | ); 13 | 14 | Map _$ErrorModelToJson(ErrorModel instance) => 15 | { 16 | 'status_message': instance.statusMessage, 17 | 'status_code': instance.statusCode, 18 | }; 19 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/movie_list_response_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import 'movie_response_model.dart'; 4 | 5 | part 'movie_list_response_model.g.dart'; 6 | 7 | @JsonSerializable(fieldRename: FieldRename.snake) 8 | class MovieListResponseModel { 9 | int page; 10 | 11 | int totalResults; 12 | 13 | int totalPages; 14 | 15 | List results; 16 | 17 | MovieListResponseModel(this.page, this.totalResults, this.totalPages, this.results); 18 | 19 | factory MovieListResponseModel.fromJson(Map json) => _$MovieListResponseModelFromJson(json); 20 | 21 | Map toJson() => _$MovieListResponseModelToJson(this); 22 | } 23 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/movie_list_response_model.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_list_response_model.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | MovieListResponseModel _$MovieListResponseModelFromJson( 10 | Map json) => 11 | MovieListResponseModel( 12 | json['page'] as int, 13 | json['total_results'] as int, 14 | json['total_pages'] as int, 15 | (json['results'] as List) 16 | .map((e) => MovieResponseModel.fromJson(e as Map)) 17 | .toList(), 18 | ); 19 | 20 | Map _$MovieListResponseModelToJson( 21 | MovieListResponseModel instance) => 22 | { 23 | 'page': instance.page, 24 | 'total_results': instance.totalResults, 25 | 'total_pages': instance.totalPages, 26 | 'results': instance.results, 27 | }; 28 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/movie_response_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'movie_response_model.g.dart'; 4 | 5 | @JsonSerializable(fieldRename: FieldRename.snake) 6 | class MovieResponseModel { 7 | int id; 8 | String posterPath; 9 | String backdropPath; 10 | String title; 11 | double voteAverage; 12 | String overview; 13 | 14 | MovieResponseModel( 15 | this.id, 16 | this.posterPath, 17 | this.backdropPath, 18 | this.title, 19 | this.voteAverage, 20 | this.overview, 21 | ); 22 | 23 | factory MovieResponseModel.fromJson(Map json) => _$MovieResponseModelFromJson(json); 24 | 25 | Map toJson() => _$MovieResponseModelToJson(this); 26 | } 27 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/movie_response_model.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_response_model.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | MovieResponseModel _$MovieResponseModelFromJson(Map json) => 10 | MovieResponseModel( 11 | json['id'] as int, 12 | json['poster_path'] as String, 13 | json['backdrop_path'] as String, 14 | json['title'] as String, 15 | (json['vote_average'] as num).toDouble(), 16 | json['overview'] as String, 17 | ); 18 | 19 | Map _$MovieResponseModelToJson(MovieResponseModel instance) => 20 | { 21 | 'id': instance.id, 22 | 'poster_path': instance.posterPath, 23 | 'backdrop_path': instance.backdropPath, 24 | 'title': instance.title, 25 | 'vote_average': instance.voteAverage, 26 | 'overview': instance.overview, 27 | }; 28 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/video_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'video_response.g.dart'; 4 | 5 | @JsonSerializable() 6 | class VideosResponse { 7 | int id; 8 | @JsonKey(name: "results") 9 | List videos; 10 | 11 | VideosResponse(this.id, this.videos); 12 | 13 | factory VideosResponse.fromJson(Map json) => _$VideosResponseFromJson(json); 14 | 15 | Map toJson() => _$VideosResponseToJson(this); 16 | } 17 | 18 | @JsonSerializable() 19 | class VideoResponse { 20 | String id; 21 | @JsonKey(name: "key") 22 | String key; 23 | @JsonKey(name: "name") 24 | String name; 25 | @JsonKey(name: "site") 26 | String site; 27 | @JsonKey(name: "size") 28 | int size; 29 | @JsonKey(name: "type") 30 | String type; 31 | 32 | VideoResponse(this.id, this.key, this.name, this.site, this.size, this.type); 33 | 34 | factory VideoResponse.fromJson(Map json) => _$VideoResponseFromJson(json); 35 | 36 | Map toJson() => _$VideoResponseToJson(this); 37 | } 38 | -------------------------------------------------------------------------------- /lib/data/source/remote/model/video_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'video_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | VideosResponse _$VideosResponseFromJson(Map json) => 10 | VideosResponse( 11 | json['id'] as int, 12 | (json['results'] as List) 13 | .map((e) => VideoResponse.fromJson(e as Map)) 14 | .toList(), 15 | ); 16 | 17 | Map _$VideosResponseToJson(VideosResponse instance) => 18 | { 19 | 'id': instance.id, 20 | 'results': instance.videos, 21 | }; 22 | 23 | VideoResponse _$VideoResponseFromJson(Map json) => 24 | VideoResponse( 25 | json['id'] as String, 26 | json['key'] as String, 27 | json['name'] as String, 28 | json['site'] as String, 29 | json['size'] as int, 30 | json['type'] as String, 31 | ); 32 | 33 | Map _$VideoResponseToJson(VideoResponse instance) => 34 | { 35 | 'id': instance.id, 36 | 'key': instance.key, 37 | 'name': instance.name, 38 | 'site': instance.site, 39 | 'size': instance.size, 40 | 'type': instance.type, 41 | }; 42 | -------------------------------------------------------------------------------- /lib/data/source/remote/movie_remote_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:popular_movies/data/source/movie_remote_data_source.dart'; 3 | import 'package:popular_movies/data/source/remote/model/video_response.dart'; 4 | import 'package:popular_movies/data/source/remote/service/movie_api_service.dart'; 5 | 6 | import 'model/movie_response_model.dart'; 7 | 8 | @Injectable(as: MovieRemoteDataSource) 9 | class MovieRemoteDataSourceImpl extends MovieRemoteDataSource { 10 | final MovieApiService _movieApiService; 11 | 12 | MovieRemoteDataSourceImpl( 13 | this._movieApiService, 14 | ); 15 | 16 | @override 17 | Future getMovieDetails(int id) async { 18 | return _movieApiService.getMovieDetails(id); 19 | } 20 | 21 | @override 22 | Future> getMovies() async { 23 | final movies = await _movieApiService.getMovies(); 24 | return movies.results; 25 | } 26 | 27 | @override 28 | Future> getMovieVideos(int id) async { 29 | final videosResponse = await _movieApiService.getMovieVideos(id); 30 | return videosResponse.videos; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/data/source/remote/network_error_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | import 'package:popular_movies/core/network_error.dart'; 6 | import 'package:popular_movies/data/source/remote/model/error_model.dart'; 7 | 8 | @singleton 9 | class NetworkErrorHandler { 10 | NetworkError getNetworkError(dynamic error) { 11 | String networkExceptions; 12 | int statusCode = 0; 13 | if (error is Exception) { 14 | try { 15 | if (error is DioError) { 16 | switch (error.type) { 17 | case DioErrorType.cancel: 18 | networkExceptions = 'request_cancelled'; 19 | break; 20 | case DioErrorType.connectTimeout: 21 | networkExceptions = 'connection_request_timeout'; 22 | break; 23 | case DioErrorType.other: 24 | networkExceptions = 'no_internet_connection'; 25 | break; 26 | case DioErrorType.receiveTimeout: 27 | networkExceptions = 'receive_timeout'; 28 | break; 29 | case DioErrorType.response: 30 | final response = error.response; 31 | statusCode = response?.statusCode ?? 0; 32 | try { 33 | final errorModel = ErrorModel.fromJson(response!.data); 34 | networkExceptions = errorModel.statusMessage; 35 | } catch (e) { 36 | networkExceptions = "invalid_status_code: $statusCode"; 37 | } 38 | break; 39 | case DioErrorType.sendTimeout: 40 | networkExceptions = 'send_timeout'; 41 | break; 42 | } 43 | } else if (error is SocketException) { 44 | networkExceptions = 'no_internet_connection'; 45 | } else { 46 | networkExceptions = 'unexpected_error_occurred'; 47 | } 48 | } on FormatException catch (e) { 49 | networkExceptions = 'unexpected_error_occurred : ${e.message}'; 50 | } catch (e) { 51 | networkExceptions = 'unexpected_error_occurred : ${e.toString()}'; 52 | } 53 | } else { 54 | if (error.toString().contains("is not a subtype of")) { 55 | networkExceptions = 'unable_to_parse_response'; 56 | } else { 57 | networkExceptions = 'unexpected_error_occurred : ${error.toString()}'; 58 | } 59 | } 60 | return NetworkError(networkExceptions, statusCode); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /lib/data/source/remote/service/movie_api_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:popular_movies/data/source/remote/model/video_response.dart'; 3 | import 'package:retrofit/retrofit.dart'; 4 | 5 | import '../model/movie_list_response_model.dart'; 6 | import '../model/movie_response_model.dart'; 7 | 8 | part 'movie_api_service.g.dart'; 9 | 10 | @RestApi() 11 | abstract class MovieApiService { 12 | factory MovieApiService(Dio dio, String baseUrl) => _MovieApiService(dio, baseUrl: baseUrl); 13 | 14 | @GET("movie/popular") 15 | Future getMovies(); 16 | 17 | @GET("movie/{movie_id}") 18 | Future getMovieDetails(@Path("movie_id") int id); 19 | 20 | @GET("movie/{id}/videos") 21 | Future getMovieVideos(@Path("id") int movieId); 22 | } 23 | -------------------------------------------------------------------------------- /lib/data/source/remote/service/movie_api_service.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_api_service.dart'; 4 | 5 | // ************************************************************************** 6 | // RetrofitGenerator 7 | // ************************************************************************** 8 | 9 | class _MovieApiService implements MovieApiService { 10 | _MovieApiService(this._dio, {this.baseUrl}); 11 | 12 | final Dio _dio; 13 | 14 | String? baseUrl; 15 | 16 | @override 17 | Future getMovies() async { 18 | const _extra = {}; 19 | final queryParameters = {}; 20 | final _headers = {}; 21 | final _data = {}; 22 | final _result = await _dio.fetch>( 23 | _setStreamType( 24 | Options(method: 'GET', headers: _headers, extra: _extra) 25 | .compose(_dio.options, 'movie/popular', 26 | queryParameters: queryParameters, data: _data) 27 | .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); 28 | final value = MovieListResponseModel.fromJson(_result.data!); 29 | return value; 30 | } 31 | 32 | @override 33 | Future getMovieDetails(id) async { 34 | const _extra = {}; 35 | final queryParameters = {}; 36 | final _headers = {}; 37 | final _data = {}; 38 | final _result = await _dio.fetch>( 39 | _setStreamType( 40 | Options(method: 'GET', headers: _headers, extra: _extra) 41 | .compose(_dio.options, 'movie/${id}', 42 | queryParameters: queryParameters, data: _data) 43 | .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); 44 | final value = MovieResponseModel.fromJson(_result.data!); 45 | return value; 46 | } 47 | 48 | @override 49 | Future getMovieVideos(movieId) async { 50 | const _extra = {}; 51 | final queryParameters = {}; 52 | final _headers = {}; 53 | final _data = {}; 54 | final _result = await _dio.fetch>( 55 | _setStreamType( 56 | Options(method: 'GET', headers: _headers, extra: _extra) 57 | .compose(_dio.options, 'movie/${movieId}/videos', 58 | queryParameters: queryParameters, data: _data) 59 | .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); 60 | final value = VideosResponse.fromJson(_result.data!); 61 | return value; 62 | } 63 | 64 | RequestOptions _setStreamType(RequestOptions requestOptions) { 65 | if (T != dynamic && 66 | !(requestOptions.responseType == ResponseType.bytes || 67 | requestOptions.responseType == ResponseType.stream)) { 68 | if (T == String) { 69 | requestOptions.responseType = ResponseType.plain; 70 | } else { 71 | requestOptions.responseType = ResponseType.json; 72 | } 73 | } 74 | return requestOptions; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/di/di.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | // ignore_for_file: no_leading_underscores_for_library_prefixes 8 | import 'package:connectivity_plus/connectivity_plus.dart' as _i3; 9 | import 'package:dio/dio.dart' as _i5; 10 | import 'package:get_it/get_it.dart' as _i1; 11 | import 'package:injectable/injectable.dart' as _i2; 12 | 13 | import '../core/services/connectivity_service.dart' as _i4; 14 | import '../data/mapper/movie_domain_mapper.dart' as _i8; 15 | import '../data/repository/movie_repository_impl.dart' as _i17; 16 | import '../data/source/local/database/dao/movie_dao.dart' as _i12; 17 | import '../data/source/local/database/db/movie_database.dart' as _i7; 18 | import '../data/source/local/movie_local_data_source.dart' as _i14; 19 | import '../data/source/movie_data_store_factory.dart' as _i15; 20 | import '../data/source/movie_local_data_source.dart' as _i13; 21 | import '../data/source/movie_remote_data_source.dart' as _i9; 22 | import '../data/source/remote/movie_remote_data_source.dart' as _i10; 23 | import '../data/source/remote/network_error_handler.dart' as _i11; 24 | import '../data/source/remote/service/movie_api_service.dart' as _i6; 25 | import '../domain/repository/movie_repository.dart' as _i16; 26 | import '../domain/usecases/get_movie_detail_use_case.dart' as _i18; 27 | import '../domain/usecases/get_movie_videos_use_case.dart' as _i20; 28 | import '../domain/usecases/get_movies_use_case.dart' as _i22; 29 | import '../domain/usecases/impl/get_movie_detail_use_case_impl.dart' as _i19; 30 | import '../domain/usecases/impl/get_movie_videos_use_case_impl.dart' as _i21; 31 | import '../domain/usecases/impl/get_movies_use_case_impl.dart' as _i23; 32 | import '../presentation/features/movie_detail/view_model/movie_details_view_model.dart' 33 | as _i24; 34 | import '../presentation/features/movies/view_model/movies_view_model.dart' 35 | as _i25; 36 | import 'module/database_module.dart' as _i27; 37 | import 'module/network_module.dart' 38 | as _i26; // ignore_for_file: unnecessary_lambdas 39 | 40 | // ignore_for_file: lines_longer_than_80_chars 41 | /// initializes the registration of provided dependencies inside of [GetIt] 42 | Future<_i1.GetIt> $initGetIt(_i1.GetIt get, 43 | {String? environment, _i2.EnvironmentFilter? environmentFilter}) async { 44 | final gh = _i2.GetItHelper(get, environment, environmentFilter); 45 | final networkModule = _$NetworkModule(); 46 | final databaseModule = _$DatabaseModule(); 47 | gh.singleton<_i3.Connectivity>(networkModule.connectivity); 48 | gh.singleton<_i4.ConnectivityService>( 49 | _i4.ConnectivityService(get<_i3.Connectivity>())); 50 | gh.singleton<_i5.Dio>(networkModule.dio); 51 | gh.singleton<_i6.MovieApiService>( 52 | networkModule.movieApiService(get<_i5.Dio>())); 53 | await gh.singletonAsync<_i7.MovieDatabase>(() => databaseModule.movieDatabase, 54 | preResolve: true); 55 | gh.lazySingleton<_i8.MovieDomainMapper>(() => _i8.MovieDomainMapperImpl()); 56 | gh.factory<_i9.MovieRemoteDataSource>( 57 | () => _i10.MovieRemoteDataSourceImpl(get<_i6.MovieApiService>())); 58 | gh.singleton<_i11.NetworkErrorHandler>(_i11.NetworkErrorHandler()); 59 | gh.lazySingleton<_i12.MovieDao>( 60 | () => databaseModule.movieDao(get<_i7.MovieDatabase>())); 61 | gh.factory<_i13.MovieLocalDataSource>( 62 | () => _i14.MovieLocalDataSourceImpl(get<_i12.MovieDao>())); 63 | gh.singleton<_i15.MovieDataStoreFactory>(_i15.MovieDataStoreFactory( 64 | get<_i8.MovieDomainMapper>(), 65 | get<_i13.MovieLocalDataSource>(), 66 | get<_i9.MovieRemoteDataSource>(), 67 | get<_i4.ConnectivityService>())); 68 | gh.factory<_i16.MovieRepository>(() => _i17.MovieRepositoryImpl( 69 | get<_i15.MovieDataStoreFactory>(), get<_i11.NetworkErrorHandler>())); 70 | gh.factory<_i18.GetMovieDetailUseCase>( 71 | () => _i19.GetMovieDetailUseCaseImpl(get<_i16.MovieRepository>())); 72 | gh.factory<_i20.GetMovieVideosUseCase>( 73 | () => _i21.GetMovieVideosUseCaseImpl(get<_i16.MovieRepository>())); 74 | gh.factory<_i22.GetMoviesUseCase>( 75 | () => _i23.GetMoviesUseCaseImpl(get<_i16.MovieRepository>())); 76 | gh.factory<_i24.MoviesDetailsViewModel>(() => _i24.MoviesDetailsViewModel( 77 | get<_i18.GetMovieDetailUseCase>(), get<_i20.GetMovieVideosUseCase>())); 78 | gh.factory<_i25.MoviesViewModel>( 79 | () => _i25.MoviesViewModel(get<_i22.GetMoviesUseCase>())); 80 | return get; 81 | } 82 | 83 | class _$NetworkModule extends _i26.NetworkModule {} 84 | 85 | class _$DatabaseModule extends _i27.DatabaseModule {} 86 | -------------------------------------------------------------------------------- /lib/di/di.dart: -------------------------------------------------------------------------------- 1 | import 'package:get_it/get_it.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | 4 | import 'di.config.dart'; 5 | 6 | @InjectableInit() 7 | Future configureDependencies() => $initGetIt(_getIt); 8 | 9 | final GetIt _getIt = GetIt.I; 10 | 11 | T inject({ 12 | String? instanceName, 13 | dynamic param1, 14 | dynamic param2, 15 | }) => 16 | _getIt(instanceName: instanceName, param1: param1, param2: param2); 17 | -------------------------------------------------------------------------------- /lib/di/module/database_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:injectable/injectable.dart'; 2 | import 'package:popular_movies/data/source/local/database/dao/movie_dao.dart'; 3 | import 'package:popular_movies/data/source/local/database/db/movie_database.dart'; 4 | import 'package:popular_movies/res/constants.dart'; 5 | 6 | @module 7 | abstract class DatabaseModule { 8 | @preResolve 9 | @singleton 10 | Future get movieDatabase async { 11 | final db = await $FloorMovieDatabase.databaseBuilder(Constants.dbName).build(); 12 | return db; 13 | } 14 | 15 | @lazySingleton 16 | MovieDao movieDao(MovieDatabase movieDatabase) => movieDatabase.movieDao; 17 | } 18 | -------------------------------------------------------------------------------- /lib/di/module/network_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:connectivity_plus/connectivity_plus.dart'; 2 | import 'package:dio/dio.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | import 'package:popular_movies/data/source/remote/service/movie_api_service.dart'; 6 | import 'package:popular_movies/res/constants.dart'; 7 | 8 | @module 9 | abstract class NetworkModule { 10 | @singleton 11 | Dio get dio { 12 | final dio = Dio(); 13 | if (kDebugMode) { 14 | dio.interceptors.add(LogInterceptor( 15 | responseBody: true, 16 | error: true, 17 | requestHeader: true, 18 | responseHeader: false, 19 | request: true, 20 | requestBody: true)); 21 | } 22 | return dio; 23 | } 24 | 25 | @singleton 26 | Connectivity get connectivity => Connectivity(); 27 | 28 | @singleton 29 | MovieApiService movieApiService(Dio dio) { 30 | return MovieApiService( 31 | dio 32 | ..options.queryParameters = { 33 | Constants.apiKeyName: Constants.apiKey, 34 | }, 35 | Constants.apiBaseUrl, 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/domain/model/movie.dart: -------------------------------------------------------------------------------- 1 | class Movie { 2 | final int id; 3 | final String posterPath; 4 | final String title; 5 | final double voteAverage; 6 | final String overview; 7 | 8 | Movie( 9 | this.id, 10 | this.posterPath, 11 | this.title, 12 | this.voteAverage, 13 | this.overview, 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /lib/domain/model/movie_details.dart: -------------------------------------------------------------------------------- 1 | class MovieDetails { 2 | final String backdropPath; 3 | final String title; 4 | final double voteAverage; 5 | final String overview; 6 | 7 | MovieDetails( 8 | this.backdropPath, 9 | this.title, 10 | this.voteAverage, 11 | this.overview, 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /lib/domain/model/video.dart: -------------------------------------------------------------------------------- 1 | class Video { 2 | final String id; 3 | final String key; 4 | final String name; 5 | final String site; 6 | final int size; 7 | final String type; 8 | 9 | Video(this.id, this.key, this.name, this.site, this.size, this.type); 10 | } 11 | -------------------------------------------------------------------------------- /lib/domain/repository/movie_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:popular_movies/core/network_error.dart'; 3 | import 'package:popular_movies/domain/model/movie.dart'; 4 | import 'package:popular_movies/domain/model/video.dart'; 5 | 6 | import '../model/movie_details.dart'; 7 | 8 | abstract class MovieRepository { 9 | Future>> getPopularMovies(); 10 | 11 | Future> getMovieDetail(int id); 12 | 13 | Future>> getMovieVideos(int id); 14 | } 15 | -------------------------------------------------------------------------------- /lib/domain/usecases/get_movie_detail_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:popular_movies/core/network_error.dart'; 3 | import 'package:popular_movies/domain/model/movie_details.dart'; 4 | 5 | abstract class GetMovieDetailUseCase { 6 | Future> execute(int id); 7 | } 8 | -------------------------------------------------------------------------------- /lib/domain/usecases/get_movie_videos_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:popular_movies/core/network_error.dart'; 3 | import 'package:popular_movies/domain/model/video.dart'; 4 | 5 | abstract class GetMovieVideosUseCase { 6 | Future>> execute(int id); 7 | } 8 | -------------------------------------------------------------------------------- /lib/domain/usecases/get_movies_use_case.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:popular_movies/core/network_error.dart'; 3 | import 'package:popular_movies/domain/model/movie.dart'; 4 | 5 | abstract class GetMoviesUseCase { 6 | Future>> execute(); 7 | } 8 | -------------------------------------------------------------------------------- /lib/domain/usecases/impl/get_movie_detail_use_case_impl.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:popular_movies/core/network_error.dart'; 4 | import 'package:popular_movies/domain/model/movie_details.dart'; 5 | import 'package:popular_movies/domain/repository/movie_repository.dart'; 6 | import 'package:popular_movies/domain/usecases/get_movie_detail_use_case.dart'; 7 | 8 | @Injectable(as: GetMovieDetailUseCase) 9 | class GetMovieDetailUseCaseImpl extends GetMovieDetailUseCase { 10 | final MovieRepository _movieRepository; 11 | 12 | GetMovieDetailUseCaseImpl(this._movieRepository); 13 | 14 | @override 15 | Future> execute(int id) { 16 | return _movieRepository.getMovieDetail(id); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/domain/usecases/impl/get_movie_videos_use_case_impl.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:popular_movies/core/network_error.dart'; 4 | import 'package:popular_movies/domain/model/video.dart'; 5 | import 'package:popular_movies/domain/repository/movie_repository.dart'; 6 | import 'package:popular_movies/domain/usecases/get_movie_videos_use_case.dart'; 7 | 8 | @Injectable(as: GetMovieVideosUseCase) 9 | class GetMovieVideosUseCaseImpl extends GetMovieVideosUseCase { 10 | final MovieRepository _movieRepository; 11 | 12 | GetMovieVideosUseCaseImpl(this._movieRepository); 13 | 14 | @override 15 | Future>> execute(int id) { 16 | return _movieRepository.getMovieVideos(id); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/domain/usecases/impl/get_movies_use_case_impl.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:popular_movies/core/network_error.dart'; 4 | import 'package:popular_movies/domain/model/movie.dart'; 5 | import 'package:popular_movies/domain/repository/movie_repository.dart'; 6 | import 'package:popular_movies/domain/usecases/get_movies_use_case.dart'; 7 | 8 | @Injectable(as: GetMoviesUseCase) 9 | class GetMoviesUseCaseImpl extends GetMoviesUseCase { 10 | final MovieRepository _movieRepository; 11 | 12 | GetMoviesUseCaseImpl(this._movieRepository); 13 | 14 | @override 15 | Future>> execute() { 16 | return _movieRepository.getPopularMovies(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:popular_movies/di/di.dart'; 3 | import 'package:popular_movies/main_app.dart'; 4 | 5 | void main() async { 6 | WidgetsFlutterBinding.ensureInitialized(); 7 | await configureDependencies(); 8 | runApp(const MainApp()); 9 | } 10 | -------------------------------------------------------------------------------- /lib/main_app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:popular_movies/presentation/features/movies/view/movies_screen.dart'; 3 | 4 | class MainApp extends StatelessWidget { 5 | const MainApp({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const MaterialApp( 10 | home: MoviesScreen(), 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/presentation/features/movie_detail/state/movie_details_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | import 'package:popular_movies/core/network_error.dart'; 3 | import 'package:popular_movies/domain/model/video.dart'; 4 | 5 | import '../../../../domain/model/movie_details.dart'; 6 | 7 | part 'movie_details_state.freezed.dart'; 8 | 9 | @freezed 10 | class MovieDetailState with _$MovieDetailState { 11 | const factory MovieDetailState({ 12 | @Default("") String title, 13 | @Default([]) List