├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── fionicholas │ │ │ │ └── movie_bloc_retrofit │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ ├── launch_background.xml │ │ │ └── movie_logo.png │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets └── icons │ └── ic_star.svg ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── 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 ├── bloc │ ├── crew │ │ ├── crew_movie_bloc.dart │ │ ├── crew_movie_event.dart │ │ └── crew_movie_state.dart │ ├── listmoviesfavorite │ │ ├── listmovies_favorite_bloc.dart │ │ ├── listmovies_favorite_event.dart │ │ └── listmovies_favorite_state.dart │ ├── movie_bloc_observer.dart │ ├── moviesfavorite │ │ ├── movies_favorite_bloc.dart │ │ ├── movies_favorite_event.dart │ │ └── movies_favorite_state.dart │ ├── popular │ │ ├── movies_popular_bloc.dart │ │ ├── movies_popular_event.dart │ │ └── movies_popular_state.dart │ └── upcoming │ │ ├── movies_upcoming_bloc.dart │ │ ├── movies_upcoming_event.dart │ │ └── movies_upcoming_state.dart ├── data │ ├── movies │ │ ├── movie_data_source.dart │ │ ├── movie_repository.dart │ │ └── remote │ │ │ ├── movie_api_client.dart │ │ │ ├── movie_api_client.g.dart │ │ │ └── response │ │ │ ├── crew.dart │ │ │ ├── crew.g.dart │ │ │ ├── genres.dart │ │ │ ├── movie_result.dart │ │ │ ├── movie_result.g.dart │ │ │ ├── movies_item.dart │ │ │ └── movies_item.g.dart │ └── moviesfavorite │ │ ├── local │ │ ├── movies_dao.dart │ │ └── response │ │ │ └── movies_favorite_entity.dart │ │ ├── movies_favorite_data_source.dart │ │ └── movies_favorite_repository.dart ├── database │ └── db_provider.dart ├── main.dart └── ui │ ├── detail │ └── detail_screen.dart │ ├── detailnew │ ├── components │ │ ├── backdrop_rating.dart │ │ ├── body.dart │ │ ├── cast_crew.dart │ │ ├── overview.dart │ │ └── title_date_favorite.dart │ └── detail_new_screen.dart │ ├── favorite │ └── movies_favorite_screen.dart │ ├── home │ ├── components │ │ ├── list_movie_popular.dart │ │ └── list_movie_upcoming.dart │ ├── movie_home_screen.dart │ └── movie_main_pages.dart │ ├── popular │ ├── components │ │ └── body.dart │ └── movie_popular_pages.dart │ ├── upcoming │ ├── components │ │ └── body.dart │ └── movie_upcoming_pages.dart │ └── utils │ ├── components │ ├── ErrorImage.dart │ ├── LoadingIndicator.dart │ ├── build_list_movie.dart │ ├── card_list_favorite.dart │ ├── card_movie_home.dart │ ├── chip_genre_movies.dart │ ├── rating_bar.dart │ ├── shimmer_movies.dart │ └── snackbar.dart │ └── ext │ └── common_ext.dart ├── pubspec.lock ├── pubspec.yaml ├── screenshot ├── movie.png ├── movie_detail.png ├── movie_popular_all.png └── new_detail_movie.png └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: bbfbf1770cca2da7c82e887e4e4af910034800b6 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Fiorent Nicholas Yehardi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Movie Flutter 2 | 3 | movie-flutter 4 | 5 | ## Features 6 | - Popular Movie List 7 | - UpComing Movie List 8 | - Detail Movie 9 | - Favorite Movies 10 | 11 | ## Tech Stack 12 | - Dart 13 | - Flutter BLoC 14 | - Hero Animation 15 | - Shimmer 16 | - JSON Serializable 17 | - Sqflite 18 | - DIO 19 | - Retrofit 20 | 21 | ## Screenshots 22 |
23 | ss-movie-homess-movie-listss-new-movie-detailss-movie-detail
24 | 
25 | 26 | ## Todo 27 | * [x] New Detail Movies 28 | * [x] Favorite Movies 29 | * [ ] Infinite Scroll 30 | 31 | ## Get Started 32 | 1. Get api_key from https://www.themoviedb.org/ and paste into `var apiKey = "PASTE_YOUR_API_KEY"` on file `movie_repository.dart` 33 | 34 | 2. Generate file *.g.dart, you can use this command on terminal : 35 | 36 | ``` 37 | flutter pub run build_runner build 38 | ``` 39 | 40 | ## Don't Forget to 41 | 42 | - Star the Repository [⭐](https://github.com/fionicholas/Movie-Flutter) 43 | - Follow [My Github Account](https://github.com/fionicholas/) 44 | 45 | ## License 46 | ``` 47 | MIT License 48 | 49 | Copyright (c) 2020 Fiorent Nicholas Yehardi 50 | 51 | Permission is hereby granted, free of charge, to any person obtaining a copy 52 | of this software and associated documentation files (the "Software"), to deal 53 | in the Software without restriction, including without limitation the rights 54 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 55 | copies of the Software, and to permit persons to whom the Software is 56 | furnished to do so, subject to the following conditions: 57 | 58 | The above copyright notice and this permission notice shall be included in all 59 | copies or substantial portions of the Software. 60 | 61 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 62 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 63 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 64 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 65 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 66 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 67 | SOFTWARE. 68 | ``` 69 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | def keystoreProperties = new Properties() 29 | def keystorePropertiesFile = rootProject.file('key.properties') 30 | if (keystorePropertiesFile.exists()) { 31 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 32 | } 33 | android { 34 | compileSdkVersion 28 35 | 36 | sourceSets { 37 | main.java.srcDirs += 'src/main/kotlin' 38 | } 39 | 40 | lintOptions { 41 | disable 'InvalidPackage' 42 | } 43 | 44 | defaultConfig { 45 | applicationId "com.fionicholas.movie_bloc_retrofit" 46 | minSdkVersion 16 47 | targetSdkVersion 28 48 | versionCode flutterVersionCode.toInteger() 49 | versionName flutterVersionName 50 | } 51 | 52 | signingConfigs { 53 | release { 54 | keyAlias keystoreProperties['keyAlias'] 55 | keyPassword keystoreProperties['keyPassword'] 56 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 57 | storePassword keystoreProperties['storePassword'] 58 | } 59 | } 60 | buildTypes { 61 | release { 62 | signingConfig signingConfigs.release 63 | } 64 | } 65 | } 66 | 67 | flutter { 68 | source '../..' 69 | } 70 | 71 | dependencies { 72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 73 | } 74 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 9 | 10 | 11 | 15 | 22 | 26 | 30 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/fionicholas/movie_bloc_retrofit/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.fionicholas.movie_bloc_retrofit 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/movie_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/android/app/src/main/res/drawable/movie_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 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.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /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-5.6.2-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 | -------------------------------------------------------------------------------- /assets/icons/ic_star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 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 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.fionicholas.movieBlocRetrofit; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.fionicholas.movieBlocRetrofit; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.fionicholas.movieBlocRetrofit; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /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 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/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 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | movie_bloc_retrofit 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/bloc/crew/crew_movie_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/crew/crew_movie_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/crew/crew_movie_state.dart'; 6 | import 'package:movie_bloc_retrofit/data/movies/movie_data_source.dart'; 7 | 8 | class CrewMovieBloc extends Bloc { 9 | final MovieDataSource repository; 10 | 11 | CrewMovieBloc({@required this.repository}) : super(InitialCrewMovieState()); 12 | 13 | @override 14 | Stream mapEventToState(CrewMovieEvent event) async* { 15 | if (event is LoadCrewMovie) { 16 | yield* _mapLoadCrewMovieToState(event.id); 17 | } 18 | } 19 | 20 | Stream _mapLoadCrewMovieToState(String id) async* { 21 | try { 22 | yield CrewMovieLoading(); 23 | var crews = await repository.getCrewMovie(id); 24 | if (crews.crew.isEmpty) { 25 | yield CrewMovieNoData("Crew Not Found"); 26 | } else { 27 | yield CrewMovieHasData(crews); 28 | } 29 | } on DioError catch (e) { 30 | if (e.type == DioErrorType.CONNECT_TIMEOUT || 31 | e.type == DioErrorType.RECEIVE_TIMEOUT) { 32 | yield CrewMovieNoInternetConnection("No Internet Connection"); 33 | } else if (e.type == DioErrorType.DEFAULT) { 34 | yield CrewMovieNoInternetConnection("No Internet Connection"); 35 | } else { 36 | yield CrewMovieError(e.toString()); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/bloc/crew/crew_movie_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | abstract class CrewMovieEvent extends Equatable { 4 | final String id; 5 | 6 | const CrewMovieEvent(this.id); 7 | 8 | @override 9 | List get props => [id]; 10 | } 11 | 12 | class LoadCrewMovie extends CrewMovieEvent { 13 | LoadCrewMovie(String id) : super(id); 14 | } 15 | -------------------------------------------------------------------------------- /lib/bloc/crew/crew_movie_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/crew.dart'; 3 | 4 | abstract class CrewMovieState extends Equatable { 5 | const CrewMovieState(); 6 | 7 | @override 8 | List get props => []; 9 | } 10 | 11 | class InitialCrewMovieState extends CrewMovieState {} 12 | 13 | class CrewMovieLoading extends CrewMovieState {} 14 | 15 | class CrewMovieHasData extends CrewMovieState { 16 | final ResultCrew crewList; 17 | 18 | const CrewMovieHasData([this.crewList]); 19 | 20 | @override 21 | List get props => [crewList]; 22 | } 23 | 24 | class CrewMovieNoData extends CrewMovieState { 25 | final String message; 26 | 27 | const CrewMovieNoData(this.message); 28 | 29 | List get props => [message]; 30 | 31 | @override 32 | String toString() => 'Crew No Data (message : $message)'; 33 | } 34 | 35 | class CrewMovieNoInternetConnection extends CrewMovieState { 36 | final String message; 37 | 38 | const CrewMovieNoInternetConnection(this.message); 39 | 40 | @override 41 | List get props => [message]; 42 | 43 | @override 44 | String toString() => 'Crew No Internet(message : $message)'; 45 | } 46 | 47 | class CrewMovieError extends CrewMovieState { 48 | final String errorMessage; 49 | 50 | const CrewMovieError(this.errorMessage); 51 | 52 | @override 53 | List get props => [errorMessage]; 54 | 55 | @override 56 | String toString() => 'Crew Failure --> message: $errorMessage'; 57 | } -------------------------------------------------------------------------------- /lib/bloc/listmoviesfavorite/listmovies_favorite_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_event.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_state.dart'; 5 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 6 | import 'package:movie_bloc_retrofit/data/moviesfavorite/movies_favorite_repository.dart'; 7 | 8 | class ListMoviesFavoriteBloc extends Bloc{ 9 | final MoviesFavoriteRepository moviesFavoriteRepository; 10 | 11 | ListMoviesFavoriteBloc({@required this.moviesFavoriteRepository}) : super(InitialListMoviesFavoriteState()); 12 | 13 | @override 14 | Stream mapEventToState(ListMoviesFavoriteEvent event) async* { 15 | yield ListMoviesFavoriteLoading(); 16 | if(event is GetListMoviesFavorite) { 17 | try { 18 | List listMoviesFavorite = await moviesFavoriteRepository.getAllMoviesFavorite(query: event.query); 19 | yield ListMoviesFavoriteHasData(listMoviesFavorite: listMoviesFavorite); 20 | }catch(e) { 21 | yield ListMoviesFavoriteError(e.toString()); 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /lib/bloc/listmoviesfavorite/listmovies_favorite_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | abstract class ListMoviesFavoriteEvent extends Equatable { 4 | final String query; 5 | 6 | const ListMoviesFavoriteEvent({this.query}); 7 | 8 | @override 9 | List get props => [query]; 10 | } 11 | 12 | class GetListMoviesFavorite extends ListMoviesFavoriteEvent { 13 | GetListMoviesFavorite({String query}) : super(query: query); 14 | } 15 | -------------------------------------------------------------------------------- /lib/bloc/listmoviesfavorite/listmovies_favorite_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 3 | 4 | abstract class ListMoviesFavoriteState extends Equatable { 5 | const ListMoviesFavoriteState(); 6 | 7 | @override 8 | List get props => []; 9 | } 10 | 11 | class InitialListMoviesFavoriteState extends ListMoviesFavoriteState {} 12 | 13 | class ListMoviesFavoriteLoading extends ListMoviesFavoriteState {} 14 | 15 | class ListMoviesFavoriteError extends ListMoviesFavoriteState { 16 | final String errorMessage; 17 | 18 | const ListMoviesFavoriteError(this.errorMessage); 19 | 20 | @override 21 | List get props => [errorMessage]; 22 | 23 | @override 24 | String toString() => 25 | 'Movies Favorite List Failure ->> message : $errorMessage'; 26 | } 27 | 28 | class ListMoviesFavoriteHasData extends ListMoviesFavoriteState { 29 | final List listMoviesFavorite; 30 | 31 | const ListMoviesFavoriteHasData({this.listMoviesFavorite}); 32 | 33 | @override 34 | List get props => [listMoviesFavorite]; 35 | } 36 | -------------------------------------------------------------------------------- /lib/bloc/movie_bloc_observer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_bloc/flutter_bloc.dart'; 2 | 3 | class MovieBlocObserver extends BlocObserver { 4 | 5 | @override 6 | void onEvent(Bloc bloc, Object event) { 7 | print('bloc: ${bloc.runtimeType}, event: $event'); 8 | super.onEvent(bloc, event); 9 | } 10 | 11 | @override 12 | void onChange(Cubit cubit, Change change) { 13 | print('cubit: ${cubit.runtimeType}, change: $change'); 14 | super.onChange(cubit, change); 15 | } 16 | 17 | @override 18 | void onTransition(Bloc bloc, Transition transition) { 19 | print('bloc: ${bloc.runtimeType}, transition: $transition'); 20 | super.onTransition(bloc, transition); 21 | } 22 | 23 | @override 24 | void onError(Cubit cubit, Object error, StackTrace stackTrace) { 25 | print('cubit: ${cubit.runtimeType}, error: $error'); 26 | super.onError(cubit, error, stackTrace); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /lib/bloc/moviesfavorite/movies_favorite_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/moviesfavorite/movies_favorite_event.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/moviesfavorite/movies_favorite_state.dart'; 5 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 6 | import 'package:movie_bloc_retrofit/data/moviesfavorite/movies_favorite_repository.dart'; 7 | 8 | class MoviesFavoriteBloc 9 | extends Bloc { 10 | final MoviesFavoriteRepository moviesFavoriteRepository; 11 | 12 | MoviesFavoriteBloc({@required this.moviesFavoriteRepository}) 13 | : super(InitialMoviesFavoriteState()); 14 | 15 | @override 16 | Stream mapEventToState( 17 | MoviesFavoriteEvent event) async* { 18 | if (event is GetMoviesFavoriteById) { 19 | try { 20 | MoviesFavoriteEntity moviesFavorite = await moviesFavoriteRepository.getMoviesFavoriteById(id: event.moviesFavoriteEntity?.id); 21 | yield MoviesFavoriteHasData(moviesFavoriteEntity: moviesFavorite, isFavorite: moviesFavorite?.id != null ? true : false); 22 | } catch (e) { 23 | yield MoviesFavoriteError(e.toString()); 24 | } 25 | } else if (event is AddMoviesFavorite) { 26 | try { 27 | await moviesFavoriteRepository 28 | .addMoviesFavorite(event.moviesFavoriteEntity); 29 | yield MoviesFavoriteSuccess( 30 | successMessage: 31 | event.moviesFavoriteEntity.title + ' add to favorite'); 32 | } catch (e) { 33 | yield MoviesFavoriteError(e.toString()); 34 | } 35 | } else if (event is DeleteMoviesFavorite) { 36 | try { 37 | await moviesFavoriteRepository 38 | .deleteMoviesFavorite(event.moviesFavoriteEntity?.id); 39 | yield MoviesFavoriteSuccess( 40 | successMessage: 41 | event.moviesFavoriteEntity.title + ' removed from favorite'); 42 | } catch (e) { 43 | yield MoviesFavoriteError(e.toString()); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/bloc/moviesfavorite/movies_favorite_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 4 | 5 | abstract class MoviesFavoriteEvent extends Equatable { 6 | final MoviesFavoriteEntity moviesFavoriteEntity; 7 | 8 | const MoviesFavoriteEvent({this.moviesFavoriteEntity}); 9 | 10 | @override 11 | List get props => [moviesFavoriteEntity]; 12 | } 13 | 14 | class GetMoviesFavoriteById extends MoviesFavoriteEvent { 15 | GetMoviesFavoriteById({MoviesFavoriteEntity moviesFavoriteEntity}) 16 | : super(moviesFavoriteEntity: moviesFavoriteEntity); 17 | } 18 | 19 | class AddMoviesFavorite extends MoviesFavoriteEvent { 20 | AddMoviesFavorite({@required MoviesFavoriteEntity moviesFavoriteEntity}) 21 | : super(moviesFavoriteEntity: moviesFavoriteEntity); 22 | } 23 | 24 | class DeleteMoviesFavorite extends MoviesFavoriteEvent { 25 | DeleteMoviesFavorite({@required MoviesFavoriteEntity moviesFavoriteEntity}) 26 | : super(moviesFavoriteEntity: moviesFavoriteEntity); 27 | } 28 | -------------------------------------------------------------------------------- /lib/bloc/moviesfavorite/movies_favorite_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 4 | 5 | abstract class MoviesFavoriteState extends Equatable { 6 | final String message; 7 | final MoviesFavoriteEntity moviesFavoriteEntity; 8 | final bool isFavorite; 9 | 10 | const MoviesFavoriteState( 11 | {this.message, this.moviesFavoriteEntity, this.isFavorite}); 12 | 13 | @override 14 | List get props => []; 15 | } 16 | 17 | class InitialMoviesFavoriteState extends MoviesFavoriteState {} 18 | 19 | class MoviesFavoriteError extends MoviesFavoriteState { 20 | final String errorMessage; 21 | 22 | const MoviesFavoriteError(this.errorMessage); 23 | 24 | List get props => [errorMessage]; 25 | 26 | @override 27 | String toString() => 'Movies Favorite No Data (message : $errorMessage)'; 28 | } 29 | 30 | class MoviesFavoriteHasData extends MoviesFavoriteState { 31 | const MoviesFavoriteHasData( 32 | {@required MoviesFavoriteEntity moviesFavoriteEntity, bool isFavorite}) 33 | : super( 34 | moviesFavoriteEntity: moviesFavoriteEntity, isFavorite: isFavorite); 35 | } 36 | 37 | class MoviesFavoriteSuccess extends MoviesFavoriteState { 38 | MoviesFavoriteSuccess({@required String successMessage}) 39 | : super(message: successMessage); 40 | } 41 | -------------------------------------------------------------------------------- /lib/bloc/popular/movies_popular_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_event.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_state.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | import 'package:movie_bloc_retrofit/data/movies/movie_data_source.dart'; 7 | 8 | class MoviePopularBloc extends Bloc { 9 | final MovieDataSource repository; 10 | 11 | MoviePopularBloc({@required this.repository}) 12 | : super(InitialMoviesPopularState()); 13 | 14 | @override 15 | Stream mapEventToState(MoviesPopularEvent event) async* { 16 | if (event is LoadPopularMovie) { 17 | yield* _mapLoadPopularMovieToState(); 18 | } 19 | } 20 | 21 | Stream _mapLoadPopularMovieToState() async* { 22 | try { 23 | yield MoviesPopularLoading(); 24 | var movies = await repository.getMoviePopular(); 25 | if (movies?.results?.isEmpty ?? true) { 26 | yield MoviesPopularNoData("Movies Not Found"); 27 | } else { 28 | yield MoviesPopularHasData(movies.results); 29 | } 30 | } on DioError catch (e) { 31 | if (e.type == DioErrorType.CONNECT_TIMEOUT || 32 | e.type == DioErrorType.RECEIVE_TIMEOUT) { 33 | yield MoviesPopularNoInternetConnection("No Internet Connection"); 34 | } else if (e.type == DioErrorType.DEFAULT) { 35 | yield MoviesPopularNoInternetConnection("No Internet Connection"); 36 | } else { 37 | yield MoviesPopularError(e.toString()); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/bloc/popular/movies_popular_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | abstract class MoviesPopularEvent extends Equatable { 4 | const MoviesPopularEvent(); 5 | 6 | @override 7 | List get props => []; 8 | } 9 | 10 | class LoadPopularMovie extends MoviesPopularEvent {} -------------------------------------------------------------------------------- /lib/bloc/popular/movies_popular_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | 4 | abstract class MoviesPopularState extends Equatable { 5 | const MoviesPopularState(); 6 | 7 | @override 8 | List get props => []; 9 | } 10 | 11 | class InitialMoviesPopularState extends MoviesPopularState {} 12 | 13 | class MoviesPopularLoading extends MoviesPopularState {} 14 | 15 | class MoviesPopularHasData extends MoviesPopularState { 16 | final List movieList; 17 | 18 | const MoviesPopularHasData([this.movieList]); 19 | 20 | @override 21 | List get props => [movieList]; 22 | } 23 | 24 | class MoviesPopularNoData extends MoviesPopularState { 25 | final String message; 26 | 27 | const MoviesPopularNoData(this.message); 28 | 29 | List get props => [message]; 30 | 31 | @override 32 | String toString() => 'Movies No Data (message : $message)'; 33 | } 34 | 35 | class MoviesPopularNoInternetConnection extends MoviesPopularState { 36 | final String message; 37 | 38 | const MoviesPopularNoInternetConnection(this.message); 39 | 40 | @override 41 | List get props => [message]; 42 | 43 | @override 44 | String toString() => 'Movies No Internet(message : $message)'; 45 | } 46 | 47 | class MoviesPopularError extends MoviesPopularState { 48 | final String errorMessage; 49 | 50 | const MoviesPopularError(this.errorMessage); 51 | 52 | @override 53 | List get props => [errorMessage]; 54 | 55 | @override 56 | String toString() => 'Movies Failure --> message: $errorMessage'; 57 | } -------------------------------------------------------------------------------- /lib/bloc/upcoming/movies_upcoming_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_state.dart'; 6 | import 'package:movie_bloc_retrofit/data/movies/movie_data_source.dart'; 7 | 8 | class MovieUpComingBloc extends Bloc { 9 | final MovieDataSource repository; 10 | 11 | MovieUpComingBloc({@required this.repository}) 12 | : super(InitialMoviesUpComingState()); 13 | 14 | @override 15 | Stream mapEventToState( 16 | MoviesUpComingEvent event) async* { 17 | if (event is LoadUpComingMovie) { 18 | yield* _mapLoadUpComingMovieToState(); 19 | } 20 | } 21 | 22 | Stream _mapLoadUpComingMovieToState() async* { 23 | try { 24 | yield MoviesUpComingLoading(); 25 | var movies = await repository.getMovieUpComing(); 26 | if (movies?.results?.isEmpty ?? true) { 27 | yield MoviesUpComingNoData("Movies Not Found"); 28 | } else { 29 | yield MoviesUpComingHasData(movies.results); 30 | } 31 | } on DioError catch (e) { 32 | if (e.type == DioErrorType.CONNECT_TIMEOUT || 33 | e.type == DioErrorType.RECEIVE_TIMEOUT) { 34 | yield MoviesUpComingNoInternetConnection("No Internet Connection"); 35 | } else if (e.type == DioErrorType.DEFAULT) { 36 | yield MoviesUpComingNoInternetConnection("No Internet Connection"); 37 | } else { 38 | yield MoviesUpComingError(e.toString()); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/bloc/upcoming/movies_upcoming_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | abstract class MoviesUpComingEvent extends Equatable { 4 | const MoviesUpComingEvent(); 5 | 6 | @override 7 | List get props => []; 8 | } 9 | 10 | class LoadUpComingMovie extends MoviesUpComingEvent {} -------------------------------------------------------------------------------- /lib/bloc/upcoming/movies_upcoming_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | 4 | abstract class MoviesUpComingState extends Equatable { 5 | const MoviesUpComingState(); 6 | 7 | @override 8 | List get props => []; 9 | } 10 | 11 | class InitialMoviesUpComingState extends MoviesUpComingState {} 12 | 13 | class MoviesUpComingLoading extends MoviesUpComingState {} 14 | 15 | class MoviesUpComingHasData extends MoviesUpComingState { 16 | final List movieList; 17 | 18 | const MoviesUpComingHasData([this.movieList]); 19 | 20 | @override 21 | List get props => [movieList]; 22 | } 23 | 24 | class MoviesUpComingNoData extends MoviesUpComingState { 25 | final String message; 26 | 27 | const MoviesUpComingNoData(this.message); 28 | 29 | List get props => [message]; 30 | 31 | @override 32 | String toString() => 'Movies No Data (message : $message)'; 33 | } 34 | 35 | class MoviesUpComingNoInternetConnection extends MoviesUpComingState { 36 | final String message; 37 | 38 | const MoviesUpComingNoInternetConnection(this.message); 39 | 40 | @override 41 | List get props => [message]; 42 | 43 | @override 44 | String toString() => 'Movies No Internet(message : $message)'; 45 | } 46 | 47 | class MoviesUpComingError extends MoviesUpComingState { 48 | final String errorMessage; 49 | 50 | const MoviesUpComingError(this.errorMessage); 51 | 52 | @override 53 | List get props => [errorMessage]; 54 | 55 | @override 56 | String toString() => 'Movies Failure --> message: $errorMessage'; 57 | } -------------------------------------------------------------------------------- /lib/data/movies/movie_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movie_result.dart'; 2 | import 'remote/response/crew.dart'; 3 | 4 | abstract class MovieDataSource { 5 | Future getMoviePopular(); 6 | Future getMovieUpComing(); 7 | Future getCrewMovie(String id); 8 | } -------------------------------------------------------------------------------- /lib/data/movies/movie_repository.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:dio/dio.dart'; 3 | import 'package:movie_bloc_retrofit/data/movies/movie_data_source.dart'; 4 | import 'package:movie_bloc_retrofit/data/movies/remote/movie_api_client.dart'; 5 | import 'package:movie_bloc_retrofit/data/movies/remote/response/crew.dart'; 6 | 7 | import 'remote/response/movie_result.dart'; 8 | 9 | class MovieRepository extends MovieDataSource { 10 | Dio _dio = Dio(); 11 | MovieApiClient _apiClient; 12 | 13 | var apiKey = "PASTE_YOUR_API_KEY"; 14 | 15 | MovieRepository() { 16 | _dio = Dio(); 17 | _apiClient = MovieApiClient(_dio); 18 | } 19 | 20 | @override 21 | Future getMoviePopular() { 22 | return _apiClient.getMoviePopular(apiKey); 23 | } 24 | 25 | @override 26 | Future getMovieUpComing() { 27 | return _apiClient.getMovieUpComing(apiKey); 28 | } 29 | 30 | @override 31 | Future getCrewMovie(String id) { 32 | return _apiClient.getCrewMovie(id, apiKey); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lib/data/movies/remote/movie_api_client.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/crew.dart'; 3 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movie_result.dart'; 4 | import 'package:retrofit/retrofit.dart'; 5 | 6 | part 'movie_api_client.g.dart'; 7 | 8 | @RestApi(baseUrl : "https://api.themoviedb.org/3/") 9 | abstract class MovieApiClient { 10 | factory MovieApiClient(Dio dio, {String baseUrl}) = _MovieApiClient; 11 | 12 | @GET("movie/popular") 13 | Future getMoviePopular(@Query("api_key") String apiKey); 14 | 15 | @GET("movie/upcoming") 16 | Future getMovieUpComing(@Query("api_key") String apiKey); 17 | 18 | @GET("movie/{id}/credits") 19 | Future getCrewMovie(@Path("id")String id, @Query("api_key") String apiKey); 20 | } -------------------------------------------------------------------------------- /lib/data/movies/remote/movie_api_client.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_api_client.dart'; 4 | 5 | // ************************************************************************** 6 | // RetrofitGenerator 7 | // ************************************************************************** 8 | 9 | class _MovieApiClient implements MovieApiClient { 10 | _MovieApiClient(this._dio, {this.baseUrl}) { 11 | ArgumentError.checkNotNull(_dio, '_dio'); 12 | this.baseUrl ??= 'https://api.themoviedb.org/3/'; 13 | } 14 | 15 | final Dio _dio; 16 | 17 | String baseUrl; 18 | 19 | @override 20 | getMoviePopular(apiKey) async { 21 | ArgumentError.checkNotNull(apiKey, 'apiKey'); 22 | const _extra = {}; 23 | final queryParameters = {r'api_key': apiKey}; 24 | final _data = {}; 25 | final Response> _result = await _dio.request( 26 | 'movie/popular', 27 | queryParameters: queryParameters, 28 | options: RequestOptions( 29 | method: 'GET', 30 | headers: {}, 31 | extra: _extra, 32 | baseUrl: baseUrl), 33 | data: _data); 34 | final value = MovieResult.fromJson(_result.data); 35 | return value; 36 | } 37 | 38 | @override 39 | getMovieUpComing(apiKey) async { 40 | ArgumentError.checkNotNull(apiKey, 'apiKey'); 41 | const _extra = {}; 42 | final queryParameters = {r'api_key': apiKey}; 43 | final _data = {}; 44 | final Response> _result = await _dio.request( 45 | 'movie/upcoming', 46 | queryParameters: queryParameters, 47 | options: RequestOptions( 48 | method: 'GET', 49 | headers: {}, 50 | extra: _extra, 51 | baseUrl: baseUrl), 52 | data: _data); 53 | final value = MovieResult.fromJson(_result.data); 54 | return value; 55 | } 56 | 57 | @override 58 | getCrewMovie(id, apiKey) async { 59 | ArgumentError.checkNotNull(id, 'id'); 60 | ArgumentError.checkNotNull(apiKey, 'apiKey'); 61 | const _extra = {}; 62 | final queryParameters = {r'api_key': apiKey}; 63 | final _data = {}; 64 | final Response> _result = await _dio.request( 65 | 'movie/$id/credits', 66 | queryParameters: queryParameters, 67 | options: RequestOptions( 68 | method: 'GET', 69 | headers: {}, 70 | extra: _extra, 71 | baseUrl: baseUrl), 72 | data: _data); 73 | final value = ResultCrew.fromJson(_result.data); 74 | return value; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/data/movies/remote/response/crew.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | 4 | part 'crew.g.dart'; 5 | 6 | @JsonSerializable() 7 | class ResultCrew extends Equatable { 8 | @JsonKey(name: 'cast') 9 | final List crew; 10 | 11 | const ResultCrew([this.crew = const []]); 12 | 13 | @override 14 | List get props => [crew]; 15 | 16 | factory ResultCrew.fromJson(Map json) => 17 | _$ResultCrewFromJson(json); 18 | 19 | Map toJson() => _$ResultCrewToJson(this); 20 | } 21 | 22 | @JsonSerializable() 23 | class Crew extends Equatable { 24 | @JsonKey(name: 'name') 25 | final String realName; 26 | 27 | @JsonKey(name: 'character') 28 | final String characterName; 29 | 30 | @JsonKey(name: 'profile_path') 31 | final String profile; 32 | 33 | Crew(this.realName, this.characterName, this.profile); 34 | 35 | @override 36 | List get props => [realName, characterName, profile]; 37 | 38 | factory Crew.fromJson(Map json) => _$CrewFromJson(json); 39 | 40 | Map toJson() => _$CrewToJson(this); 41 | } -------------------------------------------------------------------------------- /lib/data/movies/remote/response/crew.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'crew.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ResultCrew _$ResultCrewFromJson(Map json) { 10 | return ResultCrew( 11 | (json['cast'] as List) 12 | ?.map( 13 | (e) => e == null ? null : Crew.fromJson(e as Map)) 14 | ?.toList(), 15 | ); 16 | } 17 | 18 | Map _$ResultCrewToJson(ResultCrew instance) => 19 | { 20 | 'cast': instance.crew, 21 | }; 22 | 23 | Crew _$CrewFromJson(Map json) { 24 | return Crew( 25 | json['name'] as String, 26 | json['character'] as String, 27 | json['profile_path'] as String, 28 | ); 29 | } 30 | 31 | Map _$CrewToJson(Crew instance) => { 32 | 'name': instance.realName, 33 | 'character': instance.characterName, 34 | 'profile_path': instance.profile, 35 | }; 36 | -------------------------------------------------------------------------------- /lib/data/movies/remote/response/genres.dart: -------------------------------------------------------------------------------- 1 | class Genres { 2 | static Map genres = { 3 | 10759: "Action & Adventure", 4 | 16: "Animation", 5 | 35: "Comedy", 6 | 80: "Crime", 7 | 99: "Documentary", 8 | 18: "Drama", 9 | 10751: "Family", 10 | 10762: "Kids", 11 | 9648: "Mystery", 12 | 10763: "News", 13 | 10764: "Reality", 14 | 10765: "Sci-Fi & Fantasy", 15 | 10766: "Soap", 16 | 10767: "Talk", 17 | 10768: "War & Politics", 18 | 37: "Western", 19 | 28: "Action", 20 | 12: "Adventure", 21 | 14: "Fantasy", 22 | 36: "History", 23 | 27: "Horror", 24 | 10402: "Music", 25 | 10749: "Romance", 26 | 878: "Science Fiction", 27 | 10770: "TV Movie", 28 | 53: "Thriller", 29 | 10752: "War", 30 | }; 31 | } -------------------------------------------------------------------------------- /lib/data/movies/remote/response/movie_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 4 | 5 | part 'movie_result.g.dart'; 6 | 7 | @JsonSerializable() 8 | class MovieResult extends Equatable { 9 | @JsonKey(name: 'results') 10 | final List results; 11 | 12 | const MovieResult([this.results = const[]]); 13 | 14 | @override 15 | List get props => [results]; 16 | 17 | factory MovieResult.fromJson(Map json) => _$MovieResultFromJson(json); 18 | 19 | Map toJson() => _$MovieResultToJson(this); 20 | } -------------------------------------------------------------------------------- /lib/data/movies/remote/response/movie_result.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movie_result.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | MovieResult _$MovieResultFromJson(Map json) { 10 | return MovieResult( 11 | (json['results'] as List) 12 | ?.map((e) => 13 | e == null ? null : MoviesItem.fromJson(e as Map)) 14 | ?.toList(), 15 | ); 16 | } 17 | 18 | Map _$MovieResultToJson(MovieResult instance) => 19 | { 20 | 'results': instance.results, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/data/movies/remote/response/movies_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 4 | 5 | part 'movies_item.g.dart'; 6 | 7 | @JsonSerializable() 8 | class MoviesItem extends Equatable { 9 | @JsonKey(name: 'id') 10 | final int id; 11 | 12 | @JsonKey(name: 'title') 13 | final String title; 14 | 15 | @JsonKey(name: 'overview') 16 | final String overview; 17 | 18 | @JsonKey(name: 'release_date') 19 | final String releaseDate; 20 | 21 | @JsonKey(name: 'genre_ids') 22 | final List genreIds; 23 | 24 | @JsonKey(name: 'vote_average') 25 | final double voteAverage; 26 | 27 | @JsonKey(name: 'popularity') 28 | final double popularity; 29 | 30 | @JsonKey(name: 'poster_path') 31 | final String posterPath; 32 | 33 | @JsonKey(name: 'backdrop_path') 34 | final String backdropPath; 35 | 36 | @JsonKey(name: 'original_name') 37 | final String tvName; 38 | 39 | @JsonKey(name: 'first_air_date') 40 | final String tvRelease; 41 | 42 | @JsonKey(name: 'vote_count') 43 | final int voteCount; 44 | 45 | @JsonKey(name: 'original_language') 46 | final String originalLanguage; 47 | 48 | MoviesItem( 49 | this.id, 50 | this.title, 51 | this.overview, 52 | this.releaseDate, 53 | this.genreIds, 54 | this.voteAverage, 55 | this.popularity, 56 | this.posterPath, 57 | this.backdropPath, 58 | this.tvName, 59 | this.tvRelease, 60 | this.voteCount, 61 | this.originalLanguage); 62 | 63 | MoviesFavoriteEntity toFavoriteMovie() { 64 | return MoviesFavoriteEntity( 65 | id: id, 66 | title: title, 67 | overview: overview, 68 | releaseDate: releaseDate, 69 | voteAverage: voteAverage.toString(), 70 | popularity: popularity.toString(), 71 | posterPath: posterPath, 72 | backdropPath: backdropPath, 73 | tvName: tvName, 74 | tvRelease: tvRelease, 75 | voteCount: voteCount, 76 | originalLanguage: originalLanguage, 77 | ); 78 | } 79 | 80 | @override 81 | List get props => [ 82 | id, 83 | title, 84 | overview, 85 | releaseDate, 86 | genreIds, 87 | voteAverage, 88 | popularity, 89 | posterPath, 90 | backdropPath, 91 | tvName, 92 | tvRelease, 93 | voteCount, 94 | originalLanguage, 95 | ]; 96 | 97 | factory MoviesItem.fromJson(Map json) => 98 | _$MoviesItemFromJson(json); 99 | 100 | Map toJson() => _$MoviesItemToJson(this); 101 | } 102 | -------------------------------------------------------------------------------- /lib/data/movies/remote/response/movies_item.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'movies_item.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | MoviesItem _$MoviesItemFromJson(Map json) { 10 | return MoviesItem( 11 | json['id'] as int, 12 | json['title'] as String, 13 | json['overview'] as String, 14 | json['release_date'] as String, 15 | (json['genre_ids'] as List)?.map((e) => e as int)?.toList(), 16 | (json['vote_average'] as num)?.toDouble(), 17 | (json['popularity'] as num)?.toDouble(), 18 | json['poster_path'] as String, 19 | json['backdrop_path'] as String, 20 | json['original_name'] as String, 21 | json['first_air_date'] as String, 22 | json['vote_count'] as int, 23 | json['original_language'] as String, 24 | ); 25 | } 26 | 27 | Map _$MoviesItemToJson(MoviesItem instance) => 28 | { 29 | 'id': instance.id, 30 | 'title': instance.title, 31 | 'overview': instance.overview, 32 | 'release_date': instance.releaseDate, 33 | 'genre_ids': instance.genreIds, 34 | 'vote_average': instance.voteAverage, 35 | 'popularity': instance.popularity, 36 | 'poster_path': instance.posterPath, 37 | 'backdrop_path': instance.backdropPath, 38 | 'original_name': instance.tvName, 39 | 'first_air_date': instance.tvRelease, 40 | 'vote_count': instance.voteCount, 41 | 'original_language': instance.originalLanguage, 42 | }; 43 | -------------------------------------------------------------------------------- /lib/data/moviesfavorite/local/movies_dao.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 2 | import 'package:movie_bloc_retrofit/database/db_provider.dart'; 3 | 4 | class MoviesDao { 5 | final dbProvider = DatabaseProvider.databaseProvider; 6 | 7 | Future addMoviesFavorite(MoviesFavoriteEntity moviesFavoriteEntity) async { 8 | final db = await dbProvider.database; 9 | var result = 10 | db.insert(moviesFavoriteTable, moviesFavoriteEntity.toDatabaseJson()); 11 | return result; 12 | } 13 | 14 | Future> getMovieFavorite( 15 | {List columns, String query}) async { 16 | final db = await dbProvider.database; 17 | 18 | List> result; 19 | if (query != null && query != '') { 20 | if (query.isNotEmpty) 21 | result = await db.query(moviesFavoriteTable, 22 | columns: columns, where: 'title LIKE ?', whereArgs: ["%$query%"]); 23 | } else { 24 | result = await db.query(moviesFavoriteTable, 25 | columns: columns, orderBy: 'id DESC'); 26 | } 27 | 28 | List moviesFavorite = result.isNotEmpty 29 | ? result 30 | .map((item) => MoviesFavoriteEntity.fromDatabaseJson(item)) 31 | .toList() 32 | : []; 33 | return moviesFavorite; 34 | } 35 | 36 | Future deleteMoviesFavorite(int id) async { 37 | final db = await dbProvider.database; 38 | var result = 39 | db.delete(moviesFavoriteTable, where: 'id = ?', whereArgs: [id]); 40 | 41 | return result; 42 | } 43 | 44 | Future getMoviesFavoriteById( 45 | {List columns, int id}) async { 46 | final db = await dbProvider.database; 47 | var result = await db.query(moviesFavoriteTable, 48 | columns: columns, where: 'id = ?', whereArgs: [id]); 49 | 50 | List moviesFavorite = result.isNotEmpty 51 | ? result 52 | .map((data) => MoviesFavoriteEntity.fromDatabaseJson(data)) 53 | .toList() 54 | : []; 55 | 56 | MoviesFavoriteEntity moviesFavoriteEntity = 57 | moviesFavorite.isNotEmpty ? moviesFavorite[0] : null; 58 | 59 | return moviesFavoriteEntity; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/data/moviesfavorite/local/response/movies_favorite_entity.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 2 | 3 | class MoviesFavoriteEntity { 4 | int id, voteCount; 5 | String title, 6 | overview, 7 | releaseDate, 8 | voteAverage, 9 | popularity, 10 | posterPath, 11 | backdropPath, 12 | tvName, 13 | tvRelease, 14 | originalLanguage; 15 | 16 | MoviesFavoriteEntity( 17 | {this.id, 18 | this.title, 19 | this.overview, 20 | this.releaseDate, 21 | this.voteAverage, 22 | this.popularity, 23 | this.posterPath, 24 | this.backdropPath, 25 | this.tvName, 26 | this.tvRelease, 27 | this.voteCount, 28 | this.originalLanguage}); 29 | 30 | MoviesItem toMovie() { 31 | return MoviesItem( 32 | id, 33 | title, 34 | overview, 35 | releaseDate, 36 | [], 37 | double.parse(voteAverage), 38 | double.parse(popularity), 39 | posterPath, 40 | backdropPath, 41 | tvName, 42 | tvRelease, 43 | voteCount, 44 | originalLanguage, 45 | ); 46 | } 47 | 48 | factory MoviesFavoriteEntity.fromDatabaseJson(Map data) => 49 | MoviesFavoriteEntity( 50 | id: data['id'] ?? 0, 51 | title: data['title'] ?? '', 52 | overview: data['overview'] ?? '', 53 | releaseDate: data['releaseDate'] ?? '', 54 | voteAverage: data['voteAverage'] ?? '', 55 | popularity: data['popularity'] ?? '', 56 | posterPath: data['posterPath'] ?? '', 57 | backdropPath: data['backdropPath'] ?? '', 58 | tvName: data['tvName'] ?? '', 59 | tvRelease: data['tvRelease'] ?? '', 60 | voteCount: data['voteCount'] ?? 0, 61 | originalLanguage: data['originalLanguage'] ?? '', 62 | ); 63 | 64 | Map toDatabaseJson() { 65 | var map = { 66 | "id": this.id ?? 0, 67 | "title": this.title ?? '', 68 | "overview": this.overview ?? '', 69 | "releaseDate": this.releaseDate ?? '', 70 | "voteAverage": this.voteAverage ?? '', 71 | "popularity": this.popularity ?? '', 72 | "posterPath": this.posterPath ?? '', 73 | "backdropPath": this.backdropPath ?? '', 74 | "tvName": this.tvName ?? '', 75 | "tvRelease": this.tvRelease ?? '', 76 | "voteCount": this.voteCount ?? 0, 77 | "originalLanguage": this.originalLanguage ?? '' 78 | }; 79 | 80 | if (map['id'] != null) map['id'] = this.id ?? ''; 81 | 82 | return map; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/data/moviesfavorite/movies_favorite_data_source.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 2 | 3 | abstract class MovieFavoriteDataSource { 4 | Future getAllMoviesFavorite({String query}); 5 | Future getMoviesFavoriteById({int id}); 6 | Future addMoviesFavorite(MoviesFavoriteEntity moviesFavoriteEntity); 7 | Future deleteMoviesFavorite(int id); 8 | } -------------------------------------------------------------------------------- /lib/data/moviesfavorite/movies_favorite_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/movies_dao.dart'; 2 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 3 | import 'package:movie_bloc_retrofit/data/moviesfavorite/movies_favorite_data_source.dart'; 4 | 5 | class MoviesFavoriteRepository extends MovieFavoriteDataSource { 6 | final moviesDao = MoviesDao(); 7 | 8 | @override 9 | Future addMoviesFavorite(MoviesFavoriteEntity moviesFavoriteEntity) { 10 | return moviesDao.addMoviesFavorite(moviesFavoriteEntity); 11 | } 12 | 13 | @override 14 | Future deleteMoviesFavorite(int id) { 15 | return moviesDao.deleteMoviesFavorite(id); 16 | } 17 | 18 | @override 19 | Future getAllMoviesFavorite({String query}) { 20 | return moviesDao.getMovieFavorite(query: query); 21 | } 22 | 23 | @override 24 | Future getMoviesFavoriteById({int id}) { 25 | return moviesDao.getMoviesFavoriteById(id: id); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /lib/database/db_provider.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:path_provider/path_provider.dart'; 5 | import 'package:sqflite/sqflite.dart'; 6 | import 'package:path/path.dart'; 7 | 8 | final moviesFavoriteTable = 'movies_favorite'; 9 | 10 | class DatabaseProvider { 11 | static final DatabaseProvider databaseProvider = DatabaseProvider(); 12 | 13 | Database _database; 14 | 15 | Future get database async { 16 | if (_database != null) return _database; 17 | _database = await _createDatabase(); 18 | return _database; 19 | } 20 | 21 | _createDatabase() async { 22 | Directory documentsDirectory = await getApplicationDocumentsDirectory(); 23 | String path = join(documentsDirectory.path, "db_movies.db"); 24 | 25 | var database = await openDatabase(path, 26 | version: 1, onCreate: _initDB, onUpgrade: _onUpgrade); 27 | return database; 28 | } 29 | 30 | void _initDB(Database database, int version) async { 31 | await database.execute("CREATE TABLE $moviesFavoriteTable (" 32 | "id INTEGER PRIMARY KEY," 33 | "title TEXT, " 34 | "overview TEXT, " 35 | "releaseDate TEXT, " 36 | "voteAverage TEXT, " 37 | "popularity TEXT, " 38 | "posterPath TEXT, " 39 | "backdropPath TEXT, " 40 | "tvName TEXT, " 41 | "tvRelease TEXT, " 42 | "voteCount INTEGER, " 43 | "originalLanguage TEXT " 44 | ")"); 45 | } 46 | 47 | void _onUpgrade(Database database, int oldVersion, int newVersion) { 48 | if (newVersion > oldVersion) {} 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:movie_bloc_retrofit/bloc/crew/crew_movie_bloc.dart'; 2 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/movie_bloc_observer.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/moviesfavorite/movies_favorite_bloc.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_bloc.dart'; 6 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_bloc.dart'; 7 | import 'package:movie_bloc_retrofit/data/movies/movie_repository.dart'; 8 | import 'package:movie_bloc_retrofit/data/moviesfavorite/movies_favorite_repository.dart'; 9 | import 'package:movie_bloc_retrofit/ui/detail/detail_screen.dart'; 10 | import 'package:movie_bloc_retrofit/ui/detailnew/detail_new_screen.dart'; 11 | import 'package:movie_bloc_retrofit/ui/home/movie_main_pages.dart'; 12 | import 'package:flutter/material.dart'; 13 | import 'package:flutter_bloc/flutter_bloc.dart'; 14 | import 'package:movie_bloc_retrofit/ui/popular/movie_popular_pages.dart'; 15 | import 'package:movie_bloc_retrofit/ui/upcoming/movie_upcoming_pages.dart'; 16 | 17 | void main() { 18 | Bloc.observer = MovieBlocObserver(); 19 | runApp(MyApp()); 20 | } 21 | 22 | class MyApp extends StatelessWidget { 23 | // This widget is the root of your application. 24 | @override 25 | Widget build(BuildContext context) { 26 | return MultiBlocProvider( 27 | providers: [ 28 | BlocProvider( 29 | create: (context) => CrewMovieBloc(repository: MovieRepository()), 30 | ), 31 | BlocProvider( 32 | create: (context) => ListMoviesFavoriteBloc( 33 | moviesFavoriteRepository: MoviesFavoriteRepository()), 34 | ), 35 | BlocProvider( 36 | create: (context) => MoviesFavoriteBloc( 37 | moviesFavoriteRepository: MoviesFavoriteRepository()), 38 | ), 39 | BlocProvider( 40 | create: (context) => MoviePopularBloc(repository: MovieRepository()), 41 | ), 42 | BlocProvider( 43 | create: (context) => MovieUpComingBloc(repository: MovieRepository()), 44 | ), 45 | ], 46 | child: MaterialApp( 47 | debugShowCheckedModeBanner: false, 48 | title: 'Flutter Movie App', 49 | theme: ThemeData( 50 | primarySwatch: Colors.blue, 51 | visualDensity: VisualDensity.adaptivePlatformDensity, 52 | ), 53 | routes: { 54 | MoviePopularPages.routeName: (context) => MoviePopularPages(), 55 | MovieUpComingPages.routeName: (context) => MovieUpComingPages(), 56 | DetailScreen.routeName: (context) => DetailScreen(), 57 | DetailNewScreen.routeName: (context) => DetailNewScreen(), 58 | }, 59 | home: MovieMainPages(), 60 | ), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/ui/detail/detail_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 4 | import 'package:movie_bloc_retrofit/ui/utils/components/ErrorImage.dart'; 5 | import 'package:movie_bloc_retrofit/ui/utils/components/LoadingIndicator.dart'; 6 | import 'package:movie_bloc_retrofit/ui/utils/components/chip_genre_movies.dart'; 7 | import 'package:movie_bloc_retrofit/ui/utils/components/rating_bar.dart'; 8 | 9 | class DetailScreen extends StatefulWidget { 10 | static const routeName = '/detail_movie'; 11 | 12 | @override 13 | _DetailScreenState createState() => _DetailScreenState(); 14 | } 15 | 16 | class _DetailScreenState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | var theme = Theme.of(context); 20 | final MoviesItem args = ModalRoute.of(context).settings.arguments; 21 | var movieInformation = Column( 22 | mainAxisSize: MainAxisSize.max, 23 | crossAxisAlignment: CrossAxisAlignment.start, 24 | mainAxisAlignment: MainAxisAlignment.start, 25 | children: [ 26 | Text( 27 | args.title, 28 | style: TextStyle( 29 | fontWeight: FontWeight.bold, 30 | ), 31 | ), 32 | SizedBox( 33 | height: 4.0, 34 | ), 35 | buildRatingBar(theme, context, args.voteAverage), 36 | Padding( 37 | padding: const EdgeInsets.symmetric(vertical: 8.0), 38 | child: SingleChildScrollView( 39 | scrollDirection: Axis.horizontal, 40 | child: Row( 41 | children: args.genreIds 42 | .take(3) 43 | .map(buildGenreChip) 44 | .toList(), 45 | ), 46 | ), 47 | ), 48 | ], 49 | ); 50 | return Scaffold( 51 | body: SingleChildScrollView( 52 | physics: ClampingScrollPhysics(), 53 | child: Column( 54 | children: [ 55 | Stack( 56 | children: [ 57 | Padding( 58 | padding: EdgeInsets.only(bottom: MediaQuery.of(context).size.width / 3), 59 | child: Container( 60 | width: MediaQuery.of(context).size.width, 61 | height: MediaQuery.of(context).size.width / 1.8, 62 | child: CachedNetworkImage( 63 | fit: BoxFit.cover, 64 | width: MediaQuery.of(context).size.width, 65 | height: MediaQuery.of(context).size.width / 2, 66 | imageUrl: 67 | "https://image.tmdb.org/t/p/original/${args.backdropPath}", 68 | placeholder: (context, url) => LoadingIndicator(), 69 | errorWidget: (context, url, error) => ErrorImage(), 70 | ), 71 | ), 72 | ), 73 | Positioned( 74 | bottom: 0.0, 75 | left: 16.0, 76 | right: 16.0, 77 | child: Row( 78 | crossAxisAlignment: CrossAxisAlignment.end, 79 | mainAxisAlignment: MainAxisAlignment.end, 80 | children: [ 81 | Hero( 82 | tag: 'poster-${args.id}', 83 | child: CachedNetworkImage( 84 | height : MediaQuery.of(context).size.width / 2, 85 | imageUrl: 86 | "https://image.tmdb.org/t/p/w185/${args.posterPath}", 87 | placeholder: (context, url) => LoadingIndicator(), 88 | errorWidget: (context, url, error) => ErrorImage(), 89 | ), 90 | ), 91 | SizedBox(width: 16.0), 92 | Expanded(child: movieInformation), 93 | ], 94 | ), 95 | ), 96 | ], 97 | ), 98 | Padding( 99 | padding: const EdgeInsets.all(12.0), 100 | child: Text( 101 | args.overview, 102 | textAlign: TextAlign.justify, 103 | ), 104 | ), 105 | Container( 106 | padding: EdgeInsets.symmetric(horizontal: 12.0), 107 | child: RaisedButton.icon( 108 | color: Colors.blue, 109 | onPressed: () { 110 | Navigator.pop(context); 111 | }, 112 | shape: StadiumBorder(), 113 | label: Text('Back', style: TextStyle(color: Colors.white),), 114 | icon: Icon( 115 | Icons.arrow_back, 116 | color: Colors.white, 117 | size: 24.0, 118 | ), 119 | ), 120 | ) 121 | ], 122 | ), 123 | )); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /lib/ui/detailnew/components/backdrop_rating.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 4 | import 'package:movie_bloc_retrofit/ui/utils/ext/common_ext.dart'; 5 | 6 | class BackDropRating extends StatelessWidget { 7 | const BackDropRating({Key key, @required this.size, @required this.movie}) 8 | : super(key: key); 9 | 10 | final Size size; 11 | final MoviesItem movie; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | height: size.height * 0.4, 17 | child: Stack(children: [ 18 | Container( 19 | height: size.height * 0.4 - 50, 20 | decoration: BoxDecoration( 21 | borderRadius: BorderRadius.only(bottomLeft: Radius.circular(50)), 22 | image: DecorationImage( 23 | fit: BoxFit.cover, 24 | image: NetworkImage( 25 | movie.backdropPath.toUrlImage, 26 | ))), 27 | ), 28 | Positioned( 29 | bottom: 0, 30 | right: 0, 31 | child: Container( 32 | width: size.width * 0.9, 33 | height: 100, 34 | decoration: BoxDecoration( 35 | color: Colors.white, 36 | borderRadius: BorderRadius.only( 37 | bottomLeft: Radius.circular(50), 38 | topLeft: Radius.circular(50)), 39 | boxShadow: [ 40 | BoxShadow( 41 | offset: Offset(0, 5), 42 | blurRadius: 50, 43 | color: Color(0xFF12153D).withOpacity(0.2)) 44 | ]), 45 | child: Padding( 46 | padding: const EdgeInsets.symmetric(horizontal: 20), 47 | child: Row( 48 | mainAxisAlignment: MainAxisAlignment.spaceAround, 49 | children: [ 50 | Column( 51 | mainAxisAlignment: MainAxisAlignment.center, 52 | children: [ 53 | SvgPicture.asset("assets/icons/ic_star.svg"), 54 | SizedBox( 55 | height: 4, 56 | ), 57 | Text(movie.voteAverage.toString()) 58 | ], 59 | ), 60 | Column( 61 | mainAxisAlignment: MainAxisAlignment.center, 62 | children: [ 63 | Text(movie.originalLanguage.toUpperCase(), 64 | style: TextStyle( 65 | fontWeight: FontWeight.bold, fontSize: 20)), 66 | SizedBox( 67 | height: 12, 68 | ), 69 | Text( 70 | 'Language', 71 | style: TextStyle(color: Colors.grey), 72 | ) 73 | ], 74 | ), 75 | Column( 76 | mainAxisAlignment: MainAxisAlignment.center, 77 | children: [ 78 | Container( 79 | child: Padding( 80 | padding: const EdgeInsets.all(6.0), 81 | child: Text( 82 | movie.voteCount.toString(), 83 | style: TextStyle( 84 | fontWeight: FontWeight.bold, 85 | fontSize: 20, 86 | color: Colors.white), 87 | ), 88 | ), 89 | decoration: BoxDecoration( 90 | borderRadius: BorderRadius.circular(6), 91 | color: Colors.blue), 92 | ), 93 | SizedBox( 94 | height: 4, 95 | ), 96 | Text( 97 | 'Vote Count', 98 | style: TextStyle(color: Colors.grey), 99 | ) 100 | ], 101 | ) 102 | ], 103 | )), 104 | ), 105 | ), 106 | SafeArea(child: BackButton()) 107 | ]), 108 | ); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /lib/ui/detailnew/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 3 | import 'package:movie_bloc_retrofit/ui/detailnew/components/backdrop_rating.dart'; 4 | import 'package:movie_bloc_retrofit/ui/detailnew/components/cast_crew.dart'; 5 | import 'package:movie_bloc_retrofit/ui/detailnew/components/overview.dart'; 6 | import 'package:movie_bloc_retrofit/ui/detailnew/components/title_date_favorite.dart'; 7 | import 'package:movie_bloc_retrofit/ui/utils/components/chip_genre_movies.dart'; 8 | 9 | class Body extends StatefulWidget { 10 | const Body({Key key, @required this.movie, this.scaffoldKey}) : super(key: key); 11 | 12 | final MoviesItem movie; 13 | final GlobalKey scaffoldKey; 14 | 15 | @override 16 | _BodyState createState() => _BodyState(); 17 | } 18 | 19 | class _BodyState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | Size size = MediaQuery.of(context).size; 23 | return SingleChildScrollView( 24 | child: Column( 25 | crossAxisAlignment: CrossAxisAlignment.start, 26 | children: [ 27 | BackDropRating(size: size, movie: widget.movie), 28 | SizedBox(height: 20,), 29 | TitleReleaseDateAndFavorite(moviesItem : widget.movie, scaffoldKey: widget.scaffoldKey,), 30 | Padding( 31 | padding: const EdgeInsets.symmetric(horizontal: 20.0), 32 | child: SingleChildScrollView( 33 | scrollDirection: Axis.horizontal, 34 | child: Row( 35 | children: widget.movie.genreIds 36 | .take(3) 37 | .map(buildGenreChip) 38 | .toList(), 39 | ), 40 | ), 41 | ), 42 | SizedBox(height: 20,), 43 | Overview(moviesItem: widget.movie,), 44 | CastCrew(id: widget.movie.id.toString(),) 45 | ], 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/ui/detailnew/components/cast_crew.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/crew/crew_movie_bloc.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/crew/crew_movie_event.dart'; 6 | import 'package:movie_bloc_retrofit/bloc/crew/crew_movie_state.dart'; 7 | import 'package:movie_bloc_retrofit/data/movies/remote/response/crew.dart'; 8 | import 'package:movie_bloc_retrofit/ui/utils/components/ErrorImage.dart'; 9 | import 'package:movie_bloc_retrofit/ui/utils/components/LoadingIndicator.dart'; 10 | import 'package:movie_bloc_retrofit/ui/utils/ext/common_ext.dart'; 11 | 12 | class CastCrew extends StatelessWidget { 13 | const CastCrew({Key key, @required this.id}) : super(key: key); 14 | 15 | final String id; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | Size size = MediaQuery.of(context).size; 20 | context.bloc().add(LoadCrewMovie(id)); 21 | return Padding( 22 | padding: const EdgeInsets.all(20.0), 23 | child: Column( 24 | crossAxisAlignment: CrossAxisAlignment.start, 25 | children: [ 26 | Text( 27 | 'Cast & Crew', 28 | style: Theme.of(context).textTheme.headline5, 29 | ), 30 | SizedBox( 31 | height: 8, 32 | ), 33 | SizedBox( 34 | height: 160, 35 | child: Container( 36 | width: size.width, 37 | height: size.width / 1.7, 38 | child: BlocBuilder( 39 | builder: (context, state) { 40 | if (state is CrewMovieHasData) { 41 | return ListView.builder( 42 | shrinkWrap: true, 43 | scrollDirection: Axis.horizontal, 44 | physics: ClampingScrollPhysics(), 45 | itemCount: state.crewList.crew.length, 46 | itemBuilder: (BuildContext context, int index) { 47 | Crew crew = state.crewList.crew[index]; 48 | return Container( 49 | margin: EdgeInsets.only(right: 20), 50 | child: Column( 51 | children: [ 52 | Container( 53 | child: ClipRRect( 54 | child: CachedNetworkImage( 55 | imageUrl : "${crew.profile.toUrlImage}", 56 | placeholder: (context, url) => LoadingIndicator(), 57 | errorWidget: (context, url, error) => ErrorImage(), 58 | ), 59 | borderRadius: BorderRadius.circular(10) , 60 | ), 61 | decoration: BoxDecoration( 62 | borderRadius: BorderRadius.circular(20) 63 | ), 64 | width: 80, 65 | ), 66 | SizedBox(height: 20 / 2), 67 | Text(crew.realName, textAlign: TextAlign.center,), 68 | ], 69 | ), 70 | ); 71 | }); 72 | } else if (state is CrewMovieLoading) { 73 | return LoadingIndicator(); 74 | } else if (state is CrewMovieError) { 75 | return Container( 76 | child: Center( 77 | child: Text(state.errorMessage), 78 | ), 79 | ); 80 | } else if (state is CrewMovieNoData) { 81 | return Container( 82 | child: Center( 83 | child: Text(state.message), 84 | ), 85 | ); 86 | } else if (state is CrewMovieNoInternetConnection) { 87 | return Container( 88 | child: Center( 89 | child: Text(state.message), 90 | ), 91 | ); 92 | } else { 93 | return Center(child: Text("")); 94 | } 95 | }, 96 | ), 97 | ), 98 | ) 99 | ], 100 | ), 101 | ); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /lib/ui/detailnew/components/overview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 3 | 4 | class Overview extends StatelessWidget { 5 | const Overview({Key key, @required this.moviesItem}) : super(key: key); 6 | 7 | final MoviesItem moviesItem; 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Padding( 12 | padding: EdgeInsets.symmetric(horizontal: 20), 13 | child: Column( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: [ 16 | Text( 17 | 'Overview', 18 | style: Theme.of(context).textTheme.headline5, 19 | ), 20 | SizedBox( 21 | height: 8, 22 | ), 23 | Text( 24 | moviesItem.overview, 25 | textAlign: TextAlign.justify, 26 | style: TextStyle(color: Colors.grey[600]), 27 | ) 28 | ], 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/ui/detailnew/components/title_date_favorite.dart: -------------------------------------------------------------------------------- 1 | import 'package:date_format/date_format.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/moviesfavorite/movies_favorite_bloc.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/moviesfavorite/movies_favorite_event.dart'; 6 | import 'package:movie_bloc_retrofit/bloc/moviesfavorite/movies_favorite_state.dart'; 7 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 8 | import 'package:movie_bloc_retrofit/ui/utils/components/snackbar.dart'; 9 | 10 | class TitleReleaseDateAndFavorite extends StatefulWidget { 11 | const TitleReleaseDateAndFavorite( 12 | {Key key, @required this.moviesItem, this.scaffoldKey}) 13 | : super(key: key); 14 | final MoviesItem moviesItem; 15 | final GlobalKey scaffoldKey; 16 | 17 | @override 18 | _TitleReleaseDateAndFavoriteState createState() => 19 | _TitleReleaseDateAndFavoriteState(); 20 | } 21 | 22 | class _TitleReleaseDateAndFavoriteState 23 | extends State { 24 | String convertDateFromString(String strDate) { 25 | DateTime date = DateTime.parse(strDate); 26 | return formatDate(date, [ 27 | dd, 28 | ' ', 29 | MM, 30 | ' ', 31 | yyyy, 32 | ]); 33 | } 34 | 35 | bool _isFavorite = false; 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | context.bloc().add(GetMoviesFavoriteById( 40 | moviesFavoriteEntity: widget.moviesItem.toFavoriteMovie())); 41 | return Padding( 42 | padding: EdgeInsets.all(20), 43 | child: Row( 44 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 45 | children: [ 46 | Expanded( 47 | flex: 4, 48 | child: Column( 49 | crossAxisAlignment: CrossAxisAlignment.start, 50 | children: [ 51 | Text( 52 | widget.moviesItem.title, 53 | style: Theme.of(context).textTheme.headline5, 54 | ), 55 | SizedBox(height: 8), 56 | Text( 57 | convertDateFromString(widget.moviesItem.releaseDate), 58 | style: TextStyle(color: Colors.grey), 59 | ) 60 | ], 61 | ), 62 | ), 63 | SizedBox( 64 | width: 10, 65 | ), 66 | Expanded( 67 | child: SizedBox( 68 | width: 64, 69 | height: 64, 70 | child: BlocListener( 71 | listenWhen: (previousState, state) { 72 | return state is MoviesFavoriteSuccess; 73 | }, 74 | listener: (context, state) { 75 | context.bloc().add( 76 | GetMoviesFavoriteById( 77 | moviesFavoriteEntity: 78 | widget.moviesItem.toFavoriteMovie())); 79 | }, 80 | child: BlocBuilder( 81 | builder: (context, state) { 82 | if (state is MoviesFavoriteHasData) { 83 | if (state.moviesFavoriteEntity?.id != null) { 84 | _isFavorite = true; 85 | } else { 86 | _isFavorite = false; 87 | } 88 | return _buildButtonFavorite(); 89 | } else if (state is MoviesFavoriteError) { 90 | return Container( 91 | child: Text(state.errorMessage), 92 | ); 93 | } 94 | return Container( 95 | child: Text(""), 96 | ); 97 | }), 98 | )), 99 | ) 100 | ], 101 | ), 102 | ); 103 | } 104 | 105 | Widget _buildButtonFavorite() { 106 | if (_isFavorite) { 107 | return FlatButton( 108 | shape: 109 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), 110 | color: Colors.pinkAccent, 111 | onPressed: () { 112 | setState(() => _isFavorite = false); 113 | widget.scaffoldKey.currentState 114 | .showSnackBar(snackBar('Removed from Favorite!')); 115 | context.bloc().add(DeleteMoviesFavorite( 116 | moviesFavoriteEntity: widget.moviesItem.toFavoriteMovie())); 117 | }, 118 | child: Icon( 119 | Icons.favorite, 120 | size: 28, 121 | color: Colors.white, 122 | )); 123 | } else { 124 | return FlatButton( 125 | shape: 126 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), 127 | color: Colors.pinkAccent, 128 | onPressed: () { 129 | setState(() => _isFavorite = true); 130 | widget.scaffoldKey.currentState 131 | .showSnackBar(snackBar('Add To Favorite!')); 132 | context.bloc().add(AddMoviesFavorite( 133 | moviesFavoriteEntity: widget.moviesItem.toFavoriteMovie())); 134 | }, 135 | child: Icon( 136 | Icons.favorite_border, 137 | size: 28, 138 | color: Colors.white, 139 | )); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /lib/ui/detailnew/detail_new_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 3 | import 'package:movie_bloc_retrofit/ui/detailnew/components/body.dart'; 4 | 5 | class DetailNewScreen extends StatelessWidget { 6 | static const routeName = '/detail_new_movie'; 7 | @override 8 | Widget build(BuildContext context) { 9 | final MoviesItem movie = ModalRoute.of(context).settings.arguments; 10 | final GlobalKey scaffoldKey = new GlobalKey(); 11 | return Scaffold( 12 | key: scaffoldKey, 13 | body: Body(movie: movie, scaffoldKey: scaffoldKey), 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/ui/favorite/movies_favorite_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_state.dart'; 6 | import 'package:movie_bloc_retrofit/ui/utils/components/card_list_favorite.dart'; 7 | import 'package:movie_bloc_retrofit/ui/utils/components/shimmer_movies.dart'; 8 | 9 | class MoviesFavoriteScreen extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | BlocProvider.of(context) 13 | .add(GetListMoviesFavorite()); 14 | return Scaffold( 15 | appBar: AppBar( 16 | title: Text("Favorite Movies"), 17 | ), 18 | body: BlocBuilder( 19 | builder: (context, state) { 20 | if (state is ListMoviesFavoriteHasData) { 21 | if (state.listMoviesFavorite.isEmpty) { 22 | return Center( 23 | child: Column( 24 | mainAxisAlignment: MainAxisAlignment.center, 25 | children: [ 26 | Icon( 27 | Icons.movie, 28 | color: Colors.blue, 29 | size: 50, 30 | ), 31 | SizedBox( 32 | height: 20, 33 | ), 34 | Text('Favorite Movies Not Found') 35 | ], 36 | )); 37 | } else { 38 | return CardListFavorite(listMovieFavorite: state.listMoviesFavorite); 39 | } 40 | } else if (state is ListMoviesFavoriteLoading) { 41 | return ShimmerMovies(); 42 | } else if (state is ListMoviesFavoriteError) { 43 | return Center( 44 | child: Text(state.errorMessage), 45 | ); 46 | } else { 47 | return Center(child: Text('')); 48 | } 49 | }), 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/ui/home/components/list_movie_popular.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_state.dart'; 6 | import 'package:movie_bloc_retrofit/ui/detailnew/detail_new_screen.dart'; 7 | import 'package:movie_bloc_retrofit/ui/popular/movie_popular_pages.dart'; 8 | import 'package:movie_bloc_retrofit/ui/utils/components/LoadingIndicator.dart'; 9 | import 'package:movie_bloc_retrofit/ui/utils/components/card_movie_home.dart'; 10 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 11 | 12 | class ListMoviePopular extends StatelessWidget { 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | BlocProvider.of(context).add(LoadPopularMovie()); 17 | return Column( 18 | children: [ 19 | Container( 20 | padding: EdgeInsets.only(left: 4.0), 21 | child: Row( 22 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 23 | children: [ 24 | Padding( 25 | padding: const EdgeInsets.symmetric(horizontal :8.0), 26 | child: Text( 27 | 'Popular Movie', 28 | style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), 29 | ), 30 | ), 31 | IconButton( 32 | icon: Icon( 33 | Icons.arrow_forward, 34 | size: 16.0, 35 | ), 36 | onPressed: () { 37 | Navigator.pushNamed(context, MoviePopularPages.routeName); 38 | }, 39 | ) 40 | ], 41 | ), 42 | ), 43 | Container( 44 | width: MediaQuery.of(context).size.width, 45 | height: MediaQuery.of(context).size.width / 1.8, 46 | child: BlocBuilder( 47 | builder: (context, state) { 48 | if (state is MoviesPopularHasData) { 49 | return ListView.builder( 50 | shrinkWrap: true, 51 | physics: ClampingScrollPhysics(), 52 | scrollDirection: Axis.horizontal, 53 | itemCount: state.movieList.length > 5 ? 5 : state.movieList.length, 54 | itemBuilder: (BuildContext context, int index) { 55 | MoviesItem movie = state.movieList[index]; 56 | return CardMovieHome( 57 | image: movie.posterPath, 58 | title: movie.title, 59 | voteAverage: movie.voteAverage, 60 | onTap: (){ 61 | Navigator.pushNamed( 62 | context, 63 | DetailNewScreen.routeName, 64 | arguments: movie 65 | ); 66 | } 67 | ); 68 | }); 69 | } else if (state is MoviesPopularLoading) { 70 | return LoadingIndicator(); 71 | } else if (state is MoviesPopularError) { 72 | return Container( 73 | child: Center( 74 | child: Text(state.errorMessage), 75 | ), 76 | ); 77 | } else if (state is MoviesPopularNoData) { 78 | return Container( 79 | child: Center( 80 | child: Text(state.message), 81 | ), 82 | ); 83 | } else if (state is MoviesPopularNoInternetConnection) { 84 | return Container( 85 | child: Center( 86 | child: Text(state.message), 87 | ), 88 | ); 89 | } else { 90 | return Container( 91 | child: Center( 92 | child: Text("Error"), 93 | ), 94 | ); 95 | } 96 | }, 97 | ), 98 | ) 99 | ], 100 | ); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /lib/ui/home/components/list_movie_upcoming.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_state.dart'; 6 | import 'package:movie_bloc_retrofit/ui/detailnew/detail_new_screen.dart'; 7 | import 'package:movie_bloc_retrofit/ui/upcoming/movie_upcoming_pages.dart'; 8 | import 'package:movie_bloc_retrofit/ui/utils/components/LoadingIndicator.dart'; 9 | import 'package:movie_bloc_retrofit/ui/utils/components/card_movie_home.dart'; 10 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 11 | 12 | class ListMovieUpComing extends StatelessWidget { 13 | @override 14 | Widget build(BuildContext context) { 15 | 16 | BlocProvider.of(context).add(LoadUpComingMovie()); 17 | 18 | return Column( 19 | children: [ 20 | Container( 21 | padding: EdgeInsets.only(left: 4.0), 22 | child: Row( 23 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 24 | children: [ 25 | Padding( 26 | padding: const EdgeInsets.symmetric(horizontal :8.0), 27 | child: Text( 28 | 'Up Coming Movie', 29 | style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), 30 | ), 31 | ), 32 | IconButton( 33 | icon: Icon( 34 | Icons.arrow_forward, 35 | size: 16.0, 36 | ), 37 | onPressed: () { 38 | Navigator.pushNamed(context, MovieUpComingPages.routeName); 39 | }, 40 | ) 41 | ], 42 | ), 43 | ), 44 | Container( 45 | width: MediaQuery.of(context).size.width, 46 | height: MediaQuery.of(context).size.width / 1.8, 47 | child: BlocBuilder( 48 | builder: (context, state) { 49 | if (state is MoviesUpComingHasData) { 50 | return ListView.builder( 51 | shrinkWrap: true, 52 | physics: ClampingScrollPhysics(), 53 | scrollDirection: Axis.horizontal, 54 | itemCount: state.movieList.length > 5 ? 5 : state.movieList.length, 55 | itemBuilder: (BuildContext context, int index) { 56 | MoviesItem movie = state.movieList[index]; 57 | return CardMovieHome( 58 | image: movie.posterPath, 59 | title: movie.title, 60 | voteAverage: movie.voteAverage, 61 | onTap: (){ 62 | Navigator.pushNamed( 63 | context, 64 | DetailNewScreen.routeName, arguments: movie 65 | ); 66 | } 67 | ); 68 | }); 69 | } else if (state is MoviesUpComingLoading) { 70 | return LoadingIndicator(); 71 | } else if (state is MoviesUpComingError) { 72 | return Container( 73 | child: Center( 74 | child: Text(state.errorMessage), 75 | ), 76 | ); 77 | } else if (state is MoviesUpComingNoData) { 78 | return Container( 79 | child: Center( 80 | child: Text(state.message), 81 | ), 82 | ); 83 | } else if (state is MoviesUpComingNoInternetConnection) { 84 | return Container( 85 | child: Center( 86 | child: Text(state.message), 87 | ), 88 | ); 89 | } else { 90 | return Container( 91 | child: Center( 92 | child: Text("Error"), 93 | ), 94 | ); 95 | } 96 | }, 97 | ), 98 | ) 99 | ], 100 | ); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /lib/ui/home/movie_home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/ui/home/components/list_movie_popular.dart'; 3 | import 'package:movie_bloc_retrofit/ui/home/components/list_movie_upcoming.dart'; 4 | 5 | class MovieHomeScreen extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text("Movie Catalogue"), 11 | ), 12 | body: SingleChildScrollView( 13 | physics: ClampingScrollPhysics(), 14 | child: Container( 15 | child: Column( 16 | children: [ 17 | ListMoviePopular(), 18 | ListMovieUpComing(), 19 | SizedBox( 20 | height: 16.0, 21 | ) 22 | ], 23 | ), 24 | )), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/ui/home/movie_main_pages.dart: -------------------------------------------------------------------------------- 1 | import 'package:curved_navigation_bar/curved_navigation_bar.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:movie_bloc_retrofit/ui/favorite/movies_favorite_screen.dart'; 5 | import 'package:movie_bloc_retrofit/ui/home/movie_home_screen.dart'; 6 | 7 | class MovieMainPages extends StatefulWidget { 8 | @override 9 | _MovieMainPagesState createState() => _MovieMainPagesState(); 10 | } 11 | 12 | class _MovieMainPagesState extends State { 13 | 14 | final MovieHomeScreen _movie = MovieHomeScreen(); 15 | final MoviesFavoriteScreen _favorite = MoviesFavoriteScreen(); 16 | 17 | Widget _showPages = new MovieHomeScreen(); 18 | 19 | Widget _pageChooser(int page) { 20 | switch (page) { 21 | case 0 : 22 | return _movie; 23 | break; 24 | case 1 : 25 | return _favorite; 26 | break; 27 | default : 28 | return new Container( 29 | child: Text('Page Not Found', 30 | style: TextStyle(fontSize: 30.0), 31 | ), 32 | ); 33 | } 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return Scaffold( 39 | backgroundColor: Colors.white, 40 | body: Center(child: _showPages,), 41 | bottomNavigationBar: CurvedNavigationBar( 42 | height: 60, 43 | backgroundColor: Colors.white, 44 | color: Colors.blue, 45 | items: [ 46 | Icon(Icons.movie, size: 30, color: Colors.white), 47 | Icon(Icons.favorite, size: 30, color: Colors.white), 48 | ], 49 | onTap: (index) { 50 | setState(() { 51 | _showPages = _pageChooser(index); 52 | }); 53 | }, 54 | ), 55 | ); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/ui/popular/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/popular/movies_popular_state.dart'; 6 | import 'package:movie_bloc_retrofit/ui/utils/components/build_list_movie.dart'; 7 | import 'package:movie_bloc_retrofit/ui/utils/components/shimmer_movies.dart'; 8 | 9 | class Body extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | BlocProvider.of(context).add(LoadPopularMovie()); 13 | return BlocBuilder( 14 | builder: (context, state) { 15 | if (state is MoviesPopularHasData) { 16 | return BuildListMovie(listMovie: state.movieList); 17 | } else if (state is MoviesPopularLoading) { 18 | return ShimmerMovies(); 19 | } else if (state is MoviesPopularNoData) { 20 | return Center( 21 | child: Text(state.message), 22 | ); 23 | } else if (state is MoviesPopularError) { 24 | return Center(child: Text(state.errorMessage)); 25 | } else if (state is MoviesPopularNoInternetConnection) { 26 | return Center( 27 | child: Text(state.message), 28 | ); 29 | } else { 30 | return Center(child: Text('')); 31 | } 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/ui/popular/movie_popular_pages.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/ui/popular/components/body.dart'; 3 | 4 | class MoviePopularPages extends StatelessWidget { 5 | static const routeName = '/popular_movie'; 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: Text('Movie Popular'), 12 | ), 13 | body: Body()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/ui/upcoming/components/body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_event.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/upcoming/movies_upcoming_state.dart'; 6 | import 'package:movie_bloc_retrofit/ui/utils/components/build_list_movie.dart'; 7 | import 'package:movie_bloc_retrofit/ui/utils/components/shimmer_movies.dart'; 8 | 9 | class Body extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | BlocProvider.of(context).add(LoadUpComingMovie()); 13 | return BlocBuilder( 14 | builder: (context, state) { 15 | if (state is MoviesUpComingHasData) { 16 | return BuildListMovie(listMovie: state.movieList); 17 | } else if (state is MoviesUpComingLoading) { 18 | return ShimmerMovies(); 19 | } else if (state is MoviesUpComingNoData) { 20 | return Center( 21 | child: Text(state.message), 22 | ); 23 | } else if (state is MoviesUpComingError) { 24 | return Center(child: Text(state.errorMessage)); 25 | } else if (state is MoviesUpComingNoInternetConnection) { 26 | return Center( 27 | child: Text(state.message), 28 | ); 29 | } else { 30 | return Center(child: Text('')); 31 | } 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/ui/upcoming/movie_upcoming_pages.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/ui/upcoming/components/body.dart'; 3 | 4 | class MovieUpComingPages extends StatelessWidget { 5 | static const routeName = '/upcoming_movie'; 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: Text('Movie Up Coming'), 12 | ), 13 | body: Body()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/ui/utils/components/ErrorImage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ErrorImage extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Center(child: Icon(Icons.error)); 7 | } 8 | } -------------------------------------------------------------------------------- /lib/ui/utils/components/LoadingIndicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LoadingIndicator extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Center(child: CircularProgressIndicator()); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /lib/ui/utils/components/build_list_movie.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/movies_item.dart'; 3 | import 'package:movie_bloc_retrofit/ui/detail/detail_screen.dart'; 4 | import 'package:movie_bloc_retrofit/ui/utils/components/chip_genre_movies.dart'; 5 | 6 | class BuildListMovie extends StatelessWidget { 7 | const BuildListMovie({Key key, this.listMovie}) : super(key: key); 8 | 9 | final List listMovie; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | child: ListView.builder( 15 | itemCount: listMovie.length, 16 | itemBuilder: (context, index) { 17 | MoviesItem movies = listMovie[index]; 18 | return Padding( 19 | padding: const EdgeInsets.all(8.0), 20 | child: InkWell( 21 | onTap: () { 22 | Navigator.pushNamed(context, DetailScreen.routeName, 23 | arguments: movies); 24 | }, 25 | child: Card( 26 | elevation: 4.0, 27 | child: Row( 28 | crossAxisAlignment: CrossAxisAlignment.start, 29 | children: [ 30 | Expanded( 31 | flex: 1, 32 | child: Padding( 33 | padding: const EdgeInsets.all(8.0), 34 | child: Hero( 35 | tag: 'poster-${movies.id}', 36 | child: Image.network( 37 | 'https://image.tmdb.org/t/p/w185/${movies.posterPath}'), 38 | ), 39 | ), 40 | ), 41 | Expanded( 42 | flex: 3, 43 | child: Column( 44 | mainAxisSize: MainAxisSize.max, 45 | crossAxisAlignment: CrossAxisAlignment.start, 46 | mainAxisAlignment: MainAxisAlignment.start, 47 | children: [ 48 | Padding( 49 | padding: const EdgeInsets.only(top: 8.0), 50 | child: Text( 51 | movies.title, 52 | style: TextStyle(fontWeight: FontWeight.bold), 53 | ), 54 | ), 55 | Padding( 56 | padding: const EdgeInsets.only( 57 | top: 8.0, right: 16.0, bottom: 8.0), 58 | child: SingleChildScrollView( 59 | scrollDirection: Axis.horizontal, 60 | child: Row( 61 | children: movies.genreIds 62 | .take(3) 63 | .map(buildGenreChip) 64 | .toList(), 65 | ), 66 | ), 67 | ), 68 | Padding( 69 | padding: const EdgeInsets.only( 70 | bottom: 8.0, right: 8.0), 71 | child: Text( 72 | movies.overview, 73 | maxLines: 3, 74 | overflow: TextOverflow.ellipsis, 75 | ), 76 | ), 77 | ], 78 | ), 79 | ) 80 | ], 81 | ), 82 | ), 83 | ), 84 | ); 85 | }), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/ui/utils/components/card_list_favorite.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_bloc.dart'; 5 | import 'package:movie_bloc_retrofit/bloc/listmoviesfavorite/listmovies_favorite_event.dart'; 6 | import 'package:movie_bloc_retrofit/data/moviesfavorite/local/response/movies_favorite_entity.dart'; 7 | import 'package:movie_bloc_retrofit/ui/detailnew/detail_new_screen.dart'; 8 | import 'package:movie_bloc_retrofit/ui/utils/components/ErrorImage.dart'; 9 | import 'package:movie_bloc_retrofit/ui/utils/components/LoadingIndicator.dart'; 10 | import 'package:movie_bloc_retrofit/ui/utils/ext/common_ext.dart'; 11 | import 'package:movie_bloc_retrofit/ui/utils/components/rating_bar.dart'; 12 | 13 | class CardListFavorite extends StatefulWidget { 14 | const CardListFavorite({Key key, this.listMovieFavorite}) : super(key: key); 15 | 16 | final List listMovieFavorite; 17 | 18 | @override 19 | _CardListFavoriteState createState() => _CardListFavoriteState(); 20 | } 21 | 22 | class _CardListFavoriteState extends State { 23 | @override 24 | Widget build(BuildContext context) { 25 | var theme = Theme.of(context); 26 | return Container( 27 | child: ListView.builder( 28 | itemCount: widget.listMovieFavorite.length, 29 | itemBuilder: (context, index) { 30 | MoviesFavoriteEntity movies = widget.listMovieFavorite[index]; 31 | return Padding( 32 | padding: const EdgeInsets.all(8.0), 33 | child: InkWell( 34 | onTap: () { 35 | Navigator.pushNamed(context, DetailNewScreen.routeName, 36 | arguments: movies.toMovie()).then((value) => setState(() { 37 | context.bloc().add(GetListMoviesFavorite()); 38 | })); 39 | }, 40 | child: Card( 41 | elevation: 4.0, 42 | child: Row( 43 | crossAxisAlignment: CrossAxisAlignment.start, 44 | children: [ 45 | Expanded( 46 | flex: 1, 47 | child: Padding( 48 | padding: const EdgeInsets.all(8.0), 49 | child: Hero( 50 | tag: 'poster-${movies.id}', 51 | child: CachedNetworkImage( imageUrl : "${movies.posterPath.toUrlImage}", 52 | placeholder: (context, url) => Padding( 53 | padding: const EdgeInsets.only(top: 8.0), 54 | child: LoadingIndicator(), 55 | ), 56 | errorWidget: (context, url, error) => ErrorImage(),), 57 | ), 58 | ), 59 | ), 60 | Expanded( 61 | flex: 3, 62 | child: Column( 63 | mainAxisSize: MainAxisSize.max, 64 | crossAxisAlignment: CrossAxisAlignment.start, 65 | mainAxisAlignment: MainAxisAlignment.start, 66 | children: [ 67 | Padding( 68 | padding: const EdgeInsets.only(top: 8.0), 69 | child: Text( 70 | movies.title, 71 | style: TextStyle(fontWeight: FontWeight.bold), 72 | ), 73 | ), 74 | Padding( 75 | padding: const EdgeInsets.only( 76 | top: 8.0, right: 16.0, bottom: 8.0), 77 | child: Row( 78 | children: [ 79 | buildRatingBar(theme, context, double.parse(movies.voteAverage)), 80 | SizedBox(width: 4,), 81 | Text(movies.voteAverage.toString()) 82 | ], 83 | ) 84 | ), 85 | Padding( 86 | padding: const EdgeInsets.only( 87 | bottom: 8.0, right: 8.0), 88 | child: Text( 89 | movies.overview, 90 | maxLines: 3, 91 | overflow: TextOverflow.ellipsis, 92 | ), 93 | ), 94 | ], 95 | ), 96 | ) 97 | ], 98 | ), 99 | ), 100 | ), 101 | ); 102 | }), 103 | ); 104 | } 105 | } -------------------------------------------------------------------------------- /lib/ui/utils/components/card_movie_home.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:movie_bloc_retrofit/ui/utils/components/ErrorImage.dart'; 4 | import 'package:movie_bloc_retrofit/ui/utils/components/LoadingIndicator.dart'; 5 | import 'package:movie_bloc_retrofit/ui/utils/components/rating_bar.dart'; 6 | 7 | class CardMovieHome extends StatelessWidget { 8 | final String image, title; 9 | final Function onTap; 10 | final double voteAverage; 11 | 12 | const CardMovieHome( 13 | {Key key, this.image, this.title, this.onTap, this.voteAverage}) 14 | : super(key: key); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | var theme = Theme.of(context); 19 | return Container( 20 | width: MediaQuery.of(context).size.width / 2.5, 21 | child: InkWell( 22 | onTap: onTap, 23 | child: Card( 24 | shape: RoundedRectangleBorder( 25 | borderRadius: BorderRadius.circular(10.0), 26 | ), 27 | child: Stack( 28 | children: [ 29 | Container( 30 | child: ClipRRect( 31 | borderRadius: BorderRadius.all(Radius.circular(10.0)), 32 | child: CachedNetworkImage( 33 | imageUrl: "https://image.tmdb.org/t/p/w185/$image", 34 | height: MediaQuery.of(context).size.width / 1.8, 35 | width: MediaQuery.of(context).size.width / 2.5, 36 | fit: BoxFit.cover, 37 | placeholder: (context, url) => LoadingIndicator(), 38 | errorWidget: (context, url, error) => ErrorImage(), 39 | ), 40 | ), 41 | ), 42 | 43 | //Stack 2 44 | Container( 45 | height: MediaQuery.of(context).size.width / 1.8, 46 | width: MediaQuery.of(context).size.width / 2.5, 47 | decoration: BoxDecoration( 48 | borderRadius: BorderRadius.all(Radius.circular(10.0)), 49 | gradient: LinearGradient( 50 | begin: Alignment.topCenter, 51 | end: Alignment.bottomCenter, 52 | stops: [0.1, 0.98], 53 | colors: [Colors.transparent, Colors.grey[900]])), 54 | ), 55 | 56 | //Stack 3 57 | Positioned( 58 | left: 0, 59 | bottom: 0, 60 | child: Container( 61 | width: MediaQuery.of(context).size.width / 2.5, 62 | decoration: BoxDecoration( 63 | borderRadius: BorderRadius.all(Radius.circular(10.0)), 64 | ), 65 | padding: EdgeInsets.only(left: 6.0, bottom: 5.0, right: 6.0), 66 | child: Column( 67 | crossAxisAlignment: CrossAxisAlignment.start, 68 | children: [ 69 | Text( 70 | title, 71 | overflow: TextOverflow.ellipsis, 72 | maxLines: 1, 73 | style: TextStyle( 74 | color: Colors.white, 75 | fontWeight: FontWeight.bold, 76 | fontSize: 14.0), 77 | ), 78 | SizedBox( 79 | height: 4.0, 80 | ), 81 | buildRatingBar(theme, context, voteAverage), 82 | SizedBox( 83 | height: 10.0, 84 | ), 85 | ], 86 | ), 87 | ), 88 | ) 89 | ], 90 | ), 91 | ), 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/ui/utils/components/chip_genre_movies.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:movie_bloc_retrofit/data/movies/remote/response/genres.dart'; 3 | 4 | Widget buildGenreChip(int id) { 5 | return Container( 6 | margin: EdgeInsets.only(right: 10), 7 | padding: EdgeInsets.all(8), 8 | child: Text( 9 | Genres.genres[id], 10 | style: TextStyle(fontSize: 12), 11 | ), 12 | decoration: BoxDecoration( 13 | border: Border.all(color: Colors.grey), 14 | borderRadius: BorderRadius.circular(20), 15 | ), 16 | ); 17 | } -------------------------------------------------------------------------------- /lib/ui/utils/components/rating_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | Widget buildRatingBar(ThemeData theme, BuildContext context, double rating){ 5 | var stars = []; 6 | 7 | for(var i = 1; i <= 5; i++){ 8 | var color = i <= rating / 2 ? theme.accentColor : Colors.grey; 9 | var star = Icon( 10 | Icons.star, 11 | color: color, 12 | size: 18.0, 13 | ); 14 | stars.add(star); 15 | } 16 | return Row(mainAxisSize: MainAxisSize.min, children: stars); 17 | } -------------------------------------------------------------------------------- /lib/ui/utils/components/shimmer_movies.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shimmer/shimmer.dart'; 3 | 4 | class ShimmerMovies extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Container( 8 | width: double.infinity, 9 | padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), 10 | child: Shimmer.fromColors( 11 | baseColor: Colors.grey, 12 | highlightColor: Colors.white, 13 | child: ListView.builder( 14 | itemBuilder: (_, __) => Padding( 15 | padding: EdgeInsets.only(bottom: 8.0), 16 | child: Row( 17 | crossAxisAlignment: CrossAxisAlignment.start, 18 | children: [ 19 | // image 20 | Container( 21 | width: 150.0 / 3, 22 | height: 150.0 / 3, 23 | color: Colors.grey, 24 | ), 25 | Expanded( 26 | child: Padding( 27 | padding: EdgeInsets.symmetric(horizontal : 10.0), 28 | child: Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | Container( 32 | child: Row( 33 | mainAxisSize: MainAxisSize.max, 34 | crossAxisAlignment: CrossAxisAlignment.start, 35 | mainAxisAlignment: MainAxisAlignment.start, 36 | children: [ 37 | Expanded( 38 | child: Column( 39 | mainAxisAlignment: MainAxisAlignment.spaceAround, 40 | children: [ 41 | Container( 42 | width: double.infinity, 43 | height: 16.0, 44 | color: Colors.grey, 45 | ), 46 | ], 47 | ), 48 | ), 49 | ], 50 | ), 51 | ), 52 | SizedBox( 53 | height: 10.0, 54 | ), 55 | Row( 56 | mainAxisSize: MainAxisSize.max, 57 | children: [ 58 | Container( 59 | height: 30.0, 60 | width: 60, 61 | color: Colors.grey, 62 | ), 63 | SizedBox( 64 | width: 10.0, 65 | ), 66 | Container( 67 | height: 30.0, 68 | width: 60, 69 | color: Colors.white, 70 | ), 71 | ], 72 | ), 73 | SizedBox( 74 | height: 10.0, 75 | ), 76 | Container( 77 | width: double.infinity, 78 | height: 12.0, 79 | color: Colors.grey, 80 | ), 81 | SizedBox( 82 | height: 10.0, 83 | ), 84 | Container( 85 | width: double.infinity, 86 | height: 12.0, 87 | color: Colors.grey, 88 | ), 89 | SizedBox( 90 | height: 10.0, 91 | ), 92 | Container( 93 | width: double.infinity, 94 | height: 12.0, 95 | color: Colors.grey, 96 | ), 97 | SizedBox( 98 | height: 10.0, 99 | ), 100 | ], 101 | ), 102 | ), 103 | ) 104 | ], 105 | ), 106 | ), 107 | itemCount: 6, 108 | ), 109 | ), 110 | ); 111 | } 112 | } -------------------------------------------------------------------------------- /lib/ui/utils/components/snackbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | SnackBar snackBar(String message) { 4 | return SnackBar(content: Text(message), duration: (Duration(seconds: 1)),); 5 | } -------------------------------------------------------------------------------- /lib/ui/utils/ext/common_ext.dart: -------------------------------------------------------------------------------- 1 | extension StringExtension on String{ 2 | String get toUrlImage { 3 | return 'https://image.tmdb.org/t/p/original$this'; 4 | } 5 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "6.0.0" 11 | analyzer: 12 | dependency: "direct overridden" 13 | description: 14 | name: analyzer 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "0.39.14" 18 | args: 19 | dependency: transitive 20 | description: 21 | name: args 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.6.0" 25 | async: 26 | dependency: transitive 27 | description: 28 | name: async 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "2.4.2" 32 | bloc: 33 | dependency: transitive 34 | description: 35 | name: bloc 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "6.0.2" 39 | boolean_selector: 40 | dependency: transitive 41 | description: 42 | name: boolean_selector 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "2.0.0" 46 | build: 47 | dependency: transitive 48 | description: 49 | name: build 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.3.0" 53 | build_config: 54 | dependency: transitive 55 | description: 56 | name: build_config 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "0.4.2" 60 | build_daemon: 61 | dependency: transitive 62 | description: 63 | name: build_daemon 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.4" 67 | build_resolvers: 68 | dependency: transitive 69 | description: 70 | name: build_resolvers 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.3.11" 74 | build_runner: 75 | dependency: "direct dev" 76 | description: 77 | name: build_runner 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.10.1" 81 | build_runner_core: 82 | dependency: transitive 83 | description: 84 | name: build_runner_core 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "6.0.1" 88 | built_collection: 89 | dependency: transitive 90 | description: 91 | name: built_collection 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "4.3.2" 95 | built_value: 96 | dependency: transitive 97 | description: 98 | name: built_value 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "7.1.0" 102 | cached_network_image: 103 | dependency: "direct main" 104 | description: 105 | name: cached_network_image 106 | url: "https://pub.dartlang.org" 107 | source: hosted 108 | version: "2.2.0+1" 109 | characters: 110 | dependency: transitive 111 | description: 112 | name: characters 113 | url: "https://pub.dartlang.org" 114 | source: hosted 115 | version: "1.0.0" 116 | charcode: 117 | dependency: transitive 118 | description: 119 | name: charcode 120 | url: "https://pub.dartlang.org" 121 | source: hosted 122 | version: "1.1.3" 123 | checked_yaml: 124 | dependency: transitive 125 | description: 126 | name: checked_yaml 127 | url: "https://pub.dartlang.org" 128 | source: hosted 129 | version: "1.0.2" 130 | cli_util: 131 | dependency: transitive 132 | description: 133 | name: cli_util 134 | url: "https://pub.dartlang.org" 135 | source: hosted 136 | version: "0.1.4" 137 | clock: 138 | dependency: transitive 139 | description: 140 | name: clock 141 | url: "https://pub.dartlang.org" 142 | source: hosted 143 | version: "1.0.1" 144 | code_builder: 145 | dependency: transitive 146 | description: 147 | name: code_builder 148 | url: "https://pub.dartlang.org" 149 | source: hosted 150 | version: "3.4.1" 151 | collection: 152 | dependency: transitive 153 | description: 154 | name: collection 155 | url: "https://pub.dartlang.org" 156 | source: hosted 157 | version: "1.14.13" 158 | convert: 159 | dependency: transitive 160 | description: 161 | name: convert 162 | url: "https://pub.dartlang.org" 163 | source: hosted 164 | version: "2.1.1" 165 | crypto: 166 | dependency: transitive 167 | description: 168 | name: crypto 169 | url: "https://pub.dartlang.org" 170 | source: hosted 171 | version: "2.1.5" 172 | csslib: 173 | dependency: transitive 174 | description: 175 | name: csslib 176 | url: "https://pub.dartlang.org" 177 | source: hosted 178 | version: "0.16.2" 179 | cupertino_icons: 180 | dependency: "direct main" 181 | description: 182 | name: cupertino_icons 183 | url: "https://pub.dartlang.org" 184 | source: hosted 185 | version: "0.1.3" 186 | curved_navigation_bar: 187 | dependency: "direct main" 188 | description: 189 | name: curved_navigation_bar 190 | url: "https://pub.dartlang.org" 191 | source: hosted 192 | version: "0.3.4" 193 | dart_style: 194 | dependency: transitive 195 | description: 196 | name: dart_style 197 | url: "https://pub.dartlang.org" 198 | source: hosted 199 | version: "1.3.6" 200 | date_format: 201 | dependency: "direct main" 202 | description: 203 | name: date_format 204 | url: "https://pub.dartlang.org" 205 | source: hosted 206 | version: "1.0.8" 207 | dio: 208 | dependency: "direct main" 209 | description: 210 | name: dio 211 | url: "https://pub.dartlang.org" 212 | source: hosted 213 | version: "3.0.10" 214 | equatable: 215 | dependency: "direct main" 216 | description: 217 | name: equatable 218 | url: "https://pub.dartlang.org" 219 | source: hosted 220 | version: "1.2.3" 221 | fake_async: 222 | dependency: transitive 223 | description: 224 | name: fake_async 225 | url: "https://pub.dartlang.org" 226 | source: hosted 227 | version: "1.1.0" 228 | file: 229 | dependency: transitive 230 | description: 231 | name: file 232 | url: "https://pub.dartlang.org" 233 | source: hosted 234 | version: "5.2.1" 235 | fixnum: 236 | dependency: transitive 237 | description: 238 | name: fixnum 239 | url: "https://pub.dartlang.org" 240 | source: hosted 241 | version: "0.10.11" 242 | flutter: 243 | dependency: "direct main" 244 | description: flutter 245 | source: sdk 246 | version: "0.0.0" 247 | flutter_bloc: 248 | dependency: "direct main" 249 | description: 250 | name: flutter_bloc 251 | url: "https://pub.dartlang.org" 252 | source: hosted 253 | version: "6.0.1" 254 | flutter_cache_manager: 255 | dependency: transitive 256 | description: 257 | name: flutter_cache_manager 258 | url: "https://pub.dartlang.org" 259 | source: hosted 260 | version: "1.4.1" 261 | flutter_svg: 262 | dependency: "direct main" 263 | description: 264 | name: flutter_svg 265 | url: "https://pub.dartlang.org" 266 | source: hosted 267 | version: "0.18.1" 268 | flutter_test: 269 | dependency: "direct dev" 270 | description: flutter 271 | source: sdk 272 | version: "0.0.0" 273 | glob: 274 | dependency: transitive 275 | description: 276 | name: glob 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "1.2.0" 280 | graphs: 281 | dependency: transitive 282 | description: 283 | name: graphs 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "0.2.0" 287 | html: 288 | dependency: transitive 289 | description: 290 | name: html 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "0.14.0+3" 294 | http: 295 | dependency: transitive 296 | description: 297 | name: http 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "0.12.2" 301 | http_multi_server: 302 | dependency: transitive 303 | description: 304 | name: http_multi_server 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "2.2.0" 308 | http_parser: 309 | dependency: transitive 310 | description: 311 | name: http_parser 312 | url: "https://pub.dartlang.org" 313 | source: hosted 314 | version: "3.1.4" 315 | intl: 316 | dependency: transitive 317 | description: 318 | name: intl 319 | url: "https://pub.dartlang.org" 320 | source: hosted 321 | version: "0.16.1" 322 | io: 323 | dependency: transitive 324 | description: 325 | name: io 326 | url: "https://pub.dartlang.org" 327 | source: hosted 328 | version: "0.3.4" 329 | js: 330 | dependency: transitive 331 | description: 332 | name: js 333 | url: "https://pub.dartlang.org" 334 | source: hosted 335 | version: "0.6.2" 336 | json_annotation: 337 | dependency: transitive 338 | description: 339 | name: json_annotation 340 | url: "https://pub.dartlang.org" 341 | source: hosted 342 | version: "3.0.1" 343 | json_serializable: 344 | dependency: "direct main" 345 | description: 346 | name: json_serializable 347 | url: "https://pub.dartlang.org" 348 | source: hosted 349 | version: "3.4.0" 350 | logger: 351 | dependency: "direct main" 352 | description: 353 | name: logger 354 | url: "https://pub.dartlang.org" 355 | source: hosted 356 | version: "0.9.2" 357 | logging: 358 | dependency: transitive 359 | description: 360 | name: logging 361 | url: "https://pub.dartlang.org" 362 | source: hosted 363 | version: "0.11.4" 364 | matcher: 365 | dependency: transitive 366 | description: 367 | name: matcher 368 | url: "https://pub.dartlang.org" 369 | source: hosted 370 | version: "0.12.8" 371 | meta: 372 | dependency: transitive 373 | description: 374 | name: meta 375 | url: "https://pub.dartlang.org" 376 | source: hosted 377 | version: "1.1.8" 378 | mime: 379 | dependency: transitive 380 | description: 381 | name: mime 382 | url: "https://pub.dartlang.org" 383 | source: hosted 384 | version: "0.9.7" 385 | nested: 386 | dependency: transitive 387 | description: 388 | name: nested 389 | url: "https://pub.dartlang.org" 390 | source: hosted 391 | version: "0.0.4" 392 | node_interop: 393 | dependency: transitive 394 | description: 395 | name: node_interop 396 | url: "https://pub.dartlang.org" 397 | source: hosted 398 | version: "1.1.1" 399 | node_io: 400 | dependency: transitive 401 | description: 402 | name: node_io 403 | url: "https://pub.dartlang.org" 404 | source: hosted 405 | version: "1.1.1" 406 | package_config: 407 | dependency: transitive 408 | description: 409 | name: package_config 410 | url: "https://pub.dartlang.org" 411 | source: hosted 412 | version: "1.9.3" 413 | path: 414 | dependency: transitive 415 | description: 416 | name: path 417 | url: "https://pub.dartlang.org" 418 | source: hosted 419 | version: "1.7.0" 420 | path_drawing: 421 | dependency: transitive 422 | description: 423 | name: path_drawing 424 | url: "https://pub.dartlang.org" 425 | source: hosted 426 | version: "0.4.1+1" 427 | path_parsing: 428 | dependency: transitive 429 | description: 430 | name: path_parsing 431 | url: "https://pub.dartlang.org" 432 | source: hosted 433 | version: "0.1.4" 434 | path_provider: 435 | dependency: "direct main" 436 | description: 437 | name: path_provider 438 | url: "https://pub.dartlang.org" 439 | source: hosted 440 | version: "1.6.11" 441 | path_provider_linux: 442 | dependency: transitive 443 | description: 444 | name: path_provider_linux 445 | url: "https://pub.dartlang.org" 446 | source: hosted 447 | version: "0.0.1+2" 448 | path_provider_macos: 449 | dependency: transitive 450 | description: 451 | name: path_provider_macos 452 | url: "https://pub.dartlang.org" 453 | source: hosted 454 | version: "0.0.4+3" 455 | path_provider_platform_interface: 456 | dependency: transitive 457 | description: 458 | name: path_provider_platform_interface 459 | url: "https://pub.dartlang.org" 460 | source: hosted 461 | version: "1.0.3" 462 | pedantic: 463 | dependency: transitive 464 | description: 465 | name: pedantic 466 | url: "https://pub.dartlang.org" 467 | source: hosted 468 | version: "1.9.0" 469 | petitparser: 470 | dependency: transitive 471 | description: 472 | name: petitparser 473 | url: "https://pub.dartlang.org" 474 | source: hosted 475 | version: "3.0.4" 476 | platform: 477 | dependency: transitive 478 | description: 479 | name: platform 480 | url: "https://pub.dartlang.org" 481 | source: hosted 482 | version: "2.2.1" 483 | plugin_platform_interface: 484 | dependency: transitive 485 | description: 486 | name: plugin_platform_interface 487 | url: "https://pub.dartlang.org" 488 | source: hosted 489 | version: "1.0.2" 490 | pool: 491 | dependency: transitive 492 | description: 493 | name: pool 494 | url: "https://pub.dartlang.org" 495 | source: hosted 496 | version: "1.4.0" 497 | process: 498 | dependency: transitive 499 | description: 500 | name: process 501 | url: "https://pub.dartlang.org" 502 | source: hosted 503 | version: "3.0.13" 504 | provider: 505 | dependency: transitive 506 | description: 507 | name: provider 508 | url: "https://pub.dartlang.org" 509 | source: hosted 510 | version: "4.3.2" 511 | pub_semver: 512 | dependency: transitive 513 | description: 514 | name: pub_semver 515 | url: "https://pub.dartlang.org" 516 | source: hosted 517 | version: "1.4.4" 518 | pubspec_parse: 519 | dependency: transitive 520 | description: 521 | name: pubspec_parse 522 | url: "https://pub.dartlang.org" 523 | source: hosted 524 | version: "0.1.5" 525 | quiver: 526 | dependency: transitive 527 | description: 528 | name: quiver 529 | url: "https://pub.dartlang.org" 530 | source: hosted 531 | version: "2.1.3" 532 | retrofit: 533 | dependency: "direct main" 534 | description: 535 | name: retrofit 536 | url: "https://pub.dartlang.org" 537 | source: hosted 538 | version: "1.3.4" 539 | retrofit_generator: 540 | dependency: "direct dev" 541 | description: 542 | name: retrofit_generator 543 | url: "https://pub.dartlang.org" 544 | source: hosted 545 | version: "1.3.7+5" 546 | rxdart: 547 | dependency: transitive 548 | description: 549 | name: rxdart 550 | url: "https://pub.dartlang.org" 551 | source: hosted 552 | version: "0.24.1" 553 | shelf: 554 | dependency: transitive 555 | description: 556 | name: shelf 557 | url: "https://pub.dartlang.org" 558 | source: hosted 559 | version: "0.7.9" 560 | shelf_web_socket: 561 | dependency: transitive 562 | description: 563 | name: shelf_web_socket 564 | url: "https://pub.dartlang.org" 565 | source: hosted 566 | version: "0.2.3" 567 | shimmer: 568 | dependency: "direct main" 569 | description: 570 | name: shimmer 571 | url: "https://pub.dartlang.org" 572 | source: hosted 573 | version: "1.1.1" 574 | sky_engine: 575 | dependency: transitive 576 | description: flutter 577 | source: sdk 578 | version: "0.0.99" 579 | source_gen: 580 | dependency: transitive 581 | description: 582 | name: source_gen 583 | url: "https://pub.dartlang.org" 584 | source: hosted 585 | version: "0.9.6" 586 | source_span: 587 | dependency: transitive 588 | description: 589 | name: source_span 590 | url: "https://pub.dartlang.org" 591 | source: hosted 592 | version: "1.7.0" 593 | sqflite: 594 | dependency: "direct main" 595 | description: 596 | name: sqflite 597 | url: "https://pub.dartlang.org" 598 | source: hosted 599 | version: "1.3.1+1" 600 | sqflite_common: 601 | dependency: transitive 602 | description: 603 | name: sqflite_common 604 | url: "https://pub.dartlang.org" 605 | source: hosted 606 | version: "1.0.2+1" 607 | stack_trace: 608 | dependency: transitive 609 | description: 610 | name: stack_trace 611 | url: "https://pub.dartlang.org" 612 | source: hosted 613 | version: "1.9.5" 614 | stream_channel: 615 | dependency: transitive 616 | description: 617 | name: stream_channel 618 | url: "https://pub.dartlang.org" 619 | source: hosted 620 | version: "2.0.0" 621 | stream_transform: 622 | dependency: transitive 623 | description: 624 | name: stream_transform 625 | url: "https://pub.dartlang.org" 626 | source: hosted 627 | version: "1.2.0" 628 | string_scanner: 629 | dependency: transitive 630 | description: 631 | name: string_scanner 632 | url: "https://pub.dartlang.org" 633 | source: hosted 634 | version: "1.0.5" 635 | synchronized: 636 | dependency: transitive 637 | description: 638 | name: synchronized 639 | url: "https://pub.dartlang.org" 640 | source: hosted 641 | version: "2.2.0+2" 642 | term_glyph: 643 | dependency: transitive 644 | description: 645 | name: term_glyph 646 | url: "https://pub.dartlang.org" 647 | source: hosted 648 | version: "1.1.0" 649 | test_api: 650 | dependency: transitive 651 | description: 652 | name: test_api 653 | url: "https://pub.dartlang.org" 654 | source: hosted 655 | version: "0.2.17" 656 | timing: 657 | dependency: transitive 658 | description: 659 | name: timing 660 | url: "https://pub.dartlang.org" 661 | source: hosted 662 | version: "0.1.1+2" 663 | tuple: 664 | dependency: transitive 665 | description: 666 | name: tuple 667 | url: "https://pub.dartlang.org" 668 | source: hosted 669 | version: "1.0.3" 670 | typed_data: 671 | dependency: transitive 672 | description: 673 | name: typed_data 674 | url: "https://pub.dartlang.org" 675 | source: hosted 676 | version: "1.2.0" 677 | uuid: 678 | dependency: transitive 679 | description: 680 | name: uuid 681 | url: "https://pub.dartlang.org" 682 | source: hosted 683 | version: "2.2.0" 684 | vector_math: 685 | dependency: transitive 686 | description: 687 | name: vector_math 688 | url: "https://pub.dartlang.org" 689 | source: hosted 690 | version: "2.0.8" 691 | watcher: 692 | dependency: transitive 693 | description: 694 | name: watcher 695 | url: "https://pub.dartlang.org" 696 | source: hosted 697 | version: "0.9.7+15" 698 | web_socket_channel: 699 | dependency: transitive 700 | description: 701 | name: web_socket_channel 702 | url: "https://pub.dartlang.org" 703 | source: hosted 704 | version: "1.1.0" 705 | xdg_directories: 706 | dependency: transitive 707 | description: 708 | name: xdg_directories 709 | url: "https://pub.dartlang.org" 710 | source: hosted 711 | version: "0.1.0" 712 | xml: 713 | dependency: transitive 714 | description: 715 | name: xml 716 | url: "https://pub.dartlang.org" 717 | source: hosted 718 | version: "4.2.0" 719 | yaml: 720 | dependency: transitive 721 | description: 722 | name: yaml 723 | url: "https://pub.dartlang.org" 724 | source: hosted 725 | version: "2.2.1" 726 | sdks: 727 | dart: ">=2.9.0-14.0.dev <3.0.0" 728 | flutter: ">=1.18.0-6.0.pre <2.0.0" 729 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: movie_bloc_retrofit 2 | description: Simple Movie App with BLOC + Retrofit 3 | 4 | publish_to: 5 | version: 1.0.0+1 6 | 7 | environment: 8 | sdk: ">=2.7.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | cupertino_icons: ^0.1.3 14 | dio: 3.0.10 15 | shimmer: ^1.1.1 16 | flutter_bloc: ^6.0.1 17 | equatable: ^1.2.3 18 | retrofit: any 19 | json_serializable: ^3.3.0 20 | logger: any 21 | cached_network_image: ^2.2.0+1 22 | flutter_svg: ^0.18.0 23 | date_format: ^1.0.8 24 | sqflite: ^1.3.1+1 25 | path_provider: ^1.3.0 26 | curved_navigation_bar: ^0.3.2 27 | 28 | dev_dependencies: 29 | flutter_test: 30 | sdk: flutter 31 | retrofit_generator: any 32 | build_runner: any 33 | 34 | dependency_overrides: 35 | analyzer: '0.39.14' 36 | 37 | flutter: 38 | uses-material-design: true 39 | 40 | assets: 41 | - assets/icons/ 42 | 43 | # An image asset can refer to one or more resolution-specific "variants", see 44 | # https://flutter.dev/assets-and-images/#resolution-aware. 45 | 46 | # For details regarding adding assets from package dependencies, see 47 | # https://flutter.dev/assets-and-images/#from-packages 48 | 49 | # To add custom fonts to your application, add a fonts section here, 50 | # in this "flutter" section. Each entry in this list should have a 51 | # "family" key with the font family name, and a "fonts" key with a 52 | # list giving the asset and other descriptors for the font. For 53 | # example: 54 | # fonts: 55 | # - family: Schyler 56 | # fonts: 57 | # - asset: fonts/Schyler-Regular.ttf 58 | # - asset: fonts/Schyler-Italic.ttf 59 | # style: italic 60 | # - family: Trajan Pro 61 | # fonts: 62 | # - asset: fonts/TrajanPro.ttf 63 | # - asset: fonts/TrajanPro_Bold.ttf 64 | # weight: 700 65 | # 66 | # For details regarding fonts from package dependencies, 67 | # see https://flutter.dev/custom-fonts/#from-packages 68 | -------------------------------------------------------------------------------- /screenshot/movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/screenshot/movie.png -------------------------------------------------------------------------------- /screenshot/movie_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/screenshot/movie_detail.png -------------------------------------------------------------------------------- /screenshot/movie_popular_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/screenshot/movie_popular_all.png -------------------------------------------------------------------------------- /screenshot/new_detail_movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fionicholas/Movie-Flutter/7af35308653a6c903e7778cc9ea0307ebb4c5951/screenshot/new_detail_movie.png -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:movie_bloc_retrofit/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------