├── .gitignore
├── .idea
├── libraries
│ ├── Dart_SDK.xml
│ └── Flutter_for_Android.xml
├── modules.xml
├── runConfigurations
│ └── main_dart.xml
└── workspace.xml
├── .metadata
├── .vscode
└── launch.json
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── moviesearcher
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ └── launch_background.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── 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
│ └── main.m
├── lib
├── commonWidgets
│ └── placeholder_content.dart
├── data
│ ├── movie_data.dart
│ ├── movie_data_mock.dart
│ └── movie_data_prod.dart
├── dependency_injection.dart
├── main.dart
├── modules
│ └── movies_presenter.dart
├── network
│ └── network_image.dart
└── ui
│ └── movie_list_tile.dart
├── movie_searcher.iml
├── movie_searcher_android.iml
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/libraries/Flutter_for_Android.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.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: f9bb4289e9fd861d70ae78bcc3a042ef1b35cc9d
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Flutter",
9 | "request": "launch",
10 | "type": "dart"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # movie_searcher Flutter Future Builder with Pagination
2 |
3 | This is an example of how to work with Future Builder and show the result in GridView & how to use Pagination with Future Builder.Future Builder is a widget that returns another widget based on futures execution result. It builds itself based on the latest AsyncSnapshots
4 | you can find step by step tutorial here -> http://codinginfinite.com/flutter-future-builder-pagination/
5 |
6 | ## Getting Started
7 |
8 | For help getting started with Flutter, view our online
9 | [documentation](https://flutter.io/).
10 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/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 | apply plugin: 'com.android.application'
15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
16 |
17 | android {
18 | compileSdkVersion 27
19 |
20 | lintOptions {
21 | disable 'InvalidPackage'
22 | }
23 |
24 | defaultConfig {
25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
26 | applicationId "com.example.moviesearcher"
27 | minSdkVersion 16
28 | targetSdkVersion 27
29 | versionCode 1
30 | versionName "1.0"
31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
32 | }
33 |
34 | buildTypes {
35 | release {
36 | // TODO: Add your own signing config for the release build.
37 | // Signing with the debug keys for now, so `flutter run --release` works.
38 | signingConfig signingConfigs.debug
39 | }
40 | }
41 | }
42 |
43 | flutter {
44 | source '../..'
45 | }
46 |
47 | dependencies {
48 | testImplementation 'junit:junit:4.12'
49 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
51 | }
52 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/moviesearcher/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.moviesearcher;
2 |
3 | import android.os.Bundle;
4 |
5 | import io.flutter.app.FlutterActivity;
6 | import io.flutter.plugins.GeneratedPluginRegistrant;
7 |
8 | public class MainActivity extends FlutterActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | GeneratedPluginRegistrant.registerWith(this);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.0.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/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-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 | .symlinks/
46 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 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 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXCopyFilesBuildPhase section */
27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
28 | isa = PBXCopyFilesBuildPhase;
29 | buildActionMask = 2147483647;
30 | dstPath = "";
31 | dstSubfolderSpec = 10;
32 | files = (
33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
35 | );
36 | name = "Embed Frameworks";
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXCopyFilesBuildPhase section */
40 |
41 | /* Begin PBXFileReference section */
42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
44 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 9740EEB11CF90186004384FC /* Flutter */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
78 | 3B80C3931E831B6300D905FE /* App.framework */,
79 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
80 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
81 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
82 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
83 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
84 | );
85 | name = Flutter;
86 | sourceTree = "";
87 | };
88 | 97C146E51CF9000F007C117D = {
89 | isa = PBXGroup;
90 | children = (
91 | 9740EEB11CF90186004384FC /* Flutter */,
92 | 97C146F01CF9000F007C117D /* Runner */,
93 | 97C146EF1CF9000F007C117D /* Products */,
94 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
95 | );
96 | sourceTree = "";
97 | };
98 | 97C146EF1CF9000F007C117D /* Products */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 97C146EE1CF9000F007C117D /* Runner.app */,
102 | );
103 | name = Products;
104 | sourceTree = "";
105 | };
106 | 97C146F01CF9000F007C117D /* Runner */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
110 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
111 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
112 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
113 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
114 | 97C147021CF9000F007C117D /* Info.plist */,
115 | 97C146F11CF9000F007C117D /* Supporting Files */,
116 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
117 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
118 | );
119 | path = Runner;
120 | sourceTree = "";
121 | };
122 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 97C146F21CF9000F007C117D /* main.m */,
126 | );
127 | name = "Supporting Files";
128 | sourceTree = "";
129 | };
130 | /* End PBXGroup section */
131 |
132 | /* Begin PBXNativeTarget section */
133 | 97C146ED1CF9000F007C117D /* Runner */ = {
134 | isa = PBXNativeTarget;
135 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
136 | buildPhases = (
137 | 9740EEB61CF901F6004384FC /* Run Script */,
138 | 97C146EA1CF9000F007C117D /* Sources */,
139 | 97C146EB1CF9000F007C117D /* Frameworks */,
140 | 97C146EC1CF9000F007C117D /* Resources */,
141 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
142 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = Runner;
149 | productName = Runner;
150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | /* End PBXNativeTarget section */
154 |
155 | /* Begin PBXProject section */
156 | 97C146E61CF9000F007C117D /* Project object */ = {
157 | isa = PBXProject;
158 | attributes = {
159 | LastUpgradeCheck = 0910;
160 | ORGANIZATIONNAME = "The Chromium Authors";
161 | TargetAttributes = {
162 | 97C146ED1CF9000F007C117D = {
163 | CreatedOnToolsVersion = 7.3.1;
164 | };
165 | };
166 | };
167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
168 | compatibilityVersion = "Xcode 3.2";
169 | developmentRegion = English;
170 | hasScannedForEncodings = 0;
171 | knownRegions = (
172 | en,
173 | Base,
174 | );
175 | mainGroup = 97C146E51CF9000F007C117D;
176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
177 | projectDirPath = "";
178 | projectRoot = "";
179 | targets = (
180 | 97C146ED1CF9000F007C117D /* Runner */,
181 | );
182 | };
183 | /* End PBXProject section */
184 |
185 | /* Begin PBXResourcesBuildPhase section */
186 | 97C146EC1CF9000F007C117D /* Resources */ = {
187 | isa = PBXResourcesBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
191 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
193 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
194 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
195 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
196 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
197 | );
198 | runOnlyForDeploymentPostprocessing = 0;
199 | };
200 | /* End PBXResourcesBuildPhase section */
201 |
202 | /* Begin PBXShellScriptBuildPhase section */
203 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
204 | isa = PBXShellScriptBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | );
208 | inputPaths = (
209 | );
210 | name = "Thin Binary";
211 | outputPaths = (
212 | );
213 | runOnlyForDeploymentPostprocessing = 0;
214 | shellPath = /bin/sh;
215 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
216 | };
217 | 9740EEB61CF901F6004384FC /* Run Script */ = {
218 | isa = PBXShellScriptBuildPhase;
219 | buildActionMask = 2147483647;
220 | files = (
221 | );
222 | inputPaths = (
223 | );
224 | name = "Run Script";
225 | outputPaths = (
226 | );
227 | runOnlyForDeploymentPostprocessing = 0;
228 | shellPath = /bin/sh;
229 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
230 | };
231 | /* End PBXShellScriptBuildPhase section */
232 |
233 | /* Begin PBXSourcesBuildPhase section */
234 | 97C146EA1CF9000F007C117D /* Sources */ = {
235 | isa = PBXSourcesBuildPhase;
236 | buildActionMask = 2147483647;
237 | files = (
238 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
239 | 97C146F31CF9000F007C117D /* main.m in Sources */,
240 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
241 | );
242 | runOnlyForDeploymentPostprocessing = 0;
243 | };
244 | /* End PBXSourcesBuildPhase section */
245 |
246 | /* Begin PBXVariantGroup section */
247 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
248 | isa = PBXVariantGroup;
249 | children = (
250 | 97C146FB1CF9000F007C117D /* Base */,
251 | );
252 | name = Main.storyboard;
253 | sourceTree = "";
254 | };
255 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
256 | isa = PBXVariantGroup;
257 | children = (
258 | 97C147001CF9000F007C117D /* Base */,
259 | );
260 | name = LaunchScreen.storyboard;
261 | sourceTree = "";
262 | };
263 | /* End PBXVariantGroup section */
264 |
265 | /* Begin XCBuildConfiguration section */
266 | 97C147031CF9000F007C117D /* Debug */ = {
267 | isa = XCBuildConfiguration;
268 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
269 | buildSettings = {
270 | ALWAYS_SEARCH_USER_PATHS = NO;
271 | CLANG_ANALYZER_NONNULL = YES;
272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
273 | CLANG_CXX_LIBRARY = "libc++";
274 | CLANG_ENABLE_MODULES = YES;
275 | CLANG_ENABLE_OBJC_ARC = YES;
276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
277 | CLANG_WARN_BOOL_CONVERSION = YES;
278 | CLANG_WARN_COMMA = YES;
279 | CLANG_WARN_CONSTANT_CONVERSION = YES;
280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
281 | CLANG_WARN_EMPTY_BODY = YES;
282 | CLANG_WARN_ENUM_CONVERSION = YES;
283 | CLANG_WARN_INFINITE_RECURSION = YES;
284 | CLANG_WARN_INT_CONVERSION = YES;
285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
286 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
289 | CLANG_WARN_STRICT_PROTOTYPES = YES;
290 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
291 | CLANG_WARN_UNREACHABLE_CODE = YES;
292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
294 | COPY_PHASE_STRIP = NO;
295 | DEBUG_INFORMATION_FORMAT = dwarf;
296 | ENABLE_STRICT_OBJC_MSGSEND = YES;
297 | ENABLE_TESTABILITY = YES;
298 | GCC_C_LANGUAGE_STANDARD = gnu99;
299 | GCC_DYNAMIC_NO_PIC = NO;
300 | GCC_NO_COMMON_BLOCKS = YES;
301 | GCC_OPTIMIZATION_LEVEL = 0;
302 | GCC_PREPROCESSOR_DEFINITIONS = (
303 | "DEBUG=1",
304 | "$(inherited)",
305 | );
306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
308 | GCC_WARN_UNDECLARED_SELECTOR = YES;
309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
310 | GCC_WARN_UNUSED_FUNCTION = YES;
311 | GCC_WARN_UNUSED_VARIABLE = YES;
312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
313 | MTL_ENABLE_DEBUG_INFO = YES;
314 | ONLY_ACTIVE_ARCH = YES;
315 | SDKROOT = iphoneos;
316 | TARGETED_DEVICE_FAMILY = "1,2";
317 | };
318 | name = Debug;
319 | };
320 | 97C147041CF9000F007C117D /* Release */ = {
321 | isa = XCBuildConfiguration;
322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
323 | buildSettings = {
324 | ALWAYS_SEARCH_USER_PATHS = NO;
325 | CLANG_ANALYZER_NONNULL = YES;
326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
327 | CLANG_CXX_LIBRARY = "libc++";
328 | CLANG_ENABLE_MODULES = YES;
329 | CLANG_ENABLE_OBJC_ARC = YES;
330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
331 | CLANG_WARN_BOOL_CONVERSION = YES;
332 | CLANG_WARN_COMMA = YES;
333 | CLANG_WARN_CONSTANT_CONVERSION = YES;
334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335 | CLANG_WARN_EMPTY_BODY = YES;
336 | CLANG_WARN_ENUM_CONVERSION = YES;
337 | CLANG_WARN_INFINITE_RECURSION = YES;
338 | CLANG_WARN_INT_CONVERSION = YES;
339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
343 | CLANG_WARN_STRICT_PROTOTYPES = YES;
344 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
345 | CLANG_WARN_UNREACHABLE_CODE = YES;
346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
348 | COPY_PHASE_STRIP = NO;
349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
350 | ENABLE_NS_ASSERTIONS = NO;
351 | ENABLE_STRICT_OBJC_MSGSEND = YES;
352 | GCC_C_LANGUAGE_STANDARD = gnu99;
353 | GCC_NO_COMMON_BLOCKS = YES;
354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
356 | GCC_WARN_UNDECLARED_SELECTOR = YES;
357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
358 | GCC_WARN_UNUSED_FUNCTION = YES;
359 | GCC_WARN_UNUSED_VARIABLE = YES;
360 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
361 | MTL_ENABLE_DEBUG_INFO = NO;
362 | SDKROOT = iphoneos;
363 | TARGETED_DEVICE_FAMILY = "1,2";
364 | VALIDATE_PRODUCT = YES;
365 | };
366 | name = Release;
367 | };
368 | 97C147061CF9000F007C117D /* Debug */ = {
369 | isa = XCBuildConfiguration;
370 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
371 | buildSettings = {
372 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
373 | CURRENT_PROJECT_VERSION = 1;
374 | ENABLE_BITCODE = NO;
375 | FRAMEWORK_SEARCH_PATHS = (
376 | "$(inherited)",
377 | "$(PROJECT_DIR)/Flutter",
378 | );
379 | INFOPLIST_FILE = Runner/Info.plist;
380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
381 | LIBRARY_SEARCH_PATHS = (
382 | "$(inherited)",
383 | "$(PROJECT_DIR)/Flutter",
384 | );
385 | PRODUCT_BUNDLE_IDENTIFIER = com.example.movieSearcher;
386 | PRODUCT_NAME = "$(TARGET_NAME)";
387 | VERSIONING_SYSTEM = "apple-generic";
388 | };
389 | name = Debug;
390 | };
391 | 97C147071CF9000F007C117D /* Release */ = {
392 | isa = XCBuildConfiguration;
393 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
394 | buildSettings = {
395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
396 | CURRENT_PROJECT_VERSION = 1;
397 | ENABLE_BITCODE = NO;
398 | FRAMEWORK_SEARCH_PATHS = (
399 | "$(inherited)",
400 | "$(PROJECT_DIR)/Flutter",
401 | );
402 | INFOPLIST_FILE = Runner/Info.plist;
403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
404 | LIBRARY_SEARCH_PATHS = (
405 | "$(inherited)",
406 | "$(PROJECT_DIR)/Flutter",
407 | );
408 | PRODUCT_BUNDLE_IDENTIFIER = com.example.movieSearcher;
409 | PRODUCT_NAME = "$(TARGET_NAME)";
410 | VERSIONING_SYSTEM = "apple-generic";
411 | };
412 | name = Release;
413 | };
414 | /* End XCBuildConfiguration section */
415 |
416 | /* Begin XCConfigurationList section */
417 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
418 | isa = XCConfigurationList;
419 | buildConfigurations = (
420 | 97C147031CF9000F007C117D /* Debug */,
421 | 97C147041CF9000F007C117D /* Release */,
422 | );
423 | defaultConfigurationIsVisible = 0;
424 | defaultConfigurationName = Release;
425 | };
426 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
427 | isa = XCConfigurationList;
428 | buildConfigurations = (
429 | 97C147061CF9000F007C117D /* Debug */,
430 | 97C147071CF9000F007C117D /* Release */,
431 | );
432 | defaultConfigurationIsVisible = 0;
433 | defaultConfigurationName = Release;
434 | };
435 | /* End XCConfigurationList section */
436 | };
437 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
438 | }
439 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
7 | [GeneratedPluginRegistrant registerWithRegistry:self];
8 | // Override point for customization after application launch.
9 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
10 | }
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CodingInfinite/FutureBuilderWithPagination/9c1363d1d8d809505ac0ab00f23c574cb17c8f88/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 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | movie_searcher
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
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/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/commonWidgets/placeholder_content.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class PlaceHolderContent extends StatelessWidget {
4 | PlaceHolderContent({this.title, this.message, this.tryAgainButton});
5 | final String title;
6 | final String message;
7 | final ValueChanged tryAgainButton;
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return Center(
12 | child: Column(
13 | mainAxisAlignment: MainAxisAlignment.center,
14 | crossAxisAlignment: CrossAxisAlignment.center,
15 | children: [
16 | Text(
17 | title,
18 | textDirection: TextDirection.ltr,
19 | style: TextStyle(
20 | fontSize: 32.0,
21 | color: Colors.white70,
22 | ),
23 | textAlign: TextAlign.center,
24 | ),
25 | Text(
26 | message,
27 | textDirection: TextDirection.ltr,
28 | style: TextStyle(
29 | fontSize: 16.0,
30 | color: Colors.white70,
31 | ),
32 | textAlign: TextAlign.center,
33 | ),
34 | Padding(
35 | padding: EdgeInsets.only(top: 15.0),
36 | child: RaisedButton(
37 | padding: EdgeInsets.only(
38 | left: 25.0, right: 25.0, top: 12.0, bottom: 12.0),
39 | child: Text(
40 | "Try Again",
41 | textDirection: TextDirection.ltr,
42 | ),
43 | onPressed: () => tryAgainButton(true)),
44 | ),
45 | ]),
46 | );
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/data/movie_data.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | enum MovieLoadMoreStatus { LOADING, STABLE }
4 |
5 | class Movie {
6 | Movie(
7 | {this.title,
8 | this.posterPath,
9 | this.id,
10 | this.overview,
11 | this.voteAverage,
12 | this.favored});
13 |
14 | final String title, posterPath, id, overview;
15 | final String voteAverage;
16 | bool favored;
17 |
18 | factory Movie.fromJson(Map value) {
19 | return Movie(
20 | title: value['title'],
21 | posterPath: value['poster_path'],
22 | id: value['id'].toString(),
23 | overview: value['overview'],
24 | voteAverage: value['vote_average'].toString(),
25 | favored: false);
26 | }
27 | }
28 |
29 | class Movies {
30 | Movies({
31 | this.page,
32 | this.totalResults,
33 | this.totalPages,
34 | this.movies,
35 | });
36 |
37 | final int page;
38 | final int totalResults;
39 | final int totalPages;
40 | final List movies;
41 |
42 | call(String a, String b) => '$a $b';
43 |
44 | Movies.fromMap(Map value)
45 | : page = value['page'],
46 | totalResults = value['total_results'],
47 | totalPages = value['total_pages'],
48 | movies = new List.from(
49 | value['results'].map((movie) => Movie.fromJson(movie)));
50 | }
51 |
52 | // Callable classes
53 | // var movie = Movies();
54 | // movie("a","b"); This function calling call function in Movies class.
55 |
56 | abstract class MovieRepository {
57 | Future fetchMovies(int pageNumber);
58 | }
59 |
60 | class FetchMovieException implements Exception {
61 | final _message;
62 |
63 | FetchMovieException([this._message]);
64 |
65 | String toString() {
66 | if (_message == null) return "Exception";
67 | return "Exception : $_message";
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/data/movie_data_mock.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'movie_data.dart';
3 | import 'package:flutter/foundation.dart';
4 |
5 | class MovieMockRepository extends MovieRepository {
6 | @override
7 | Future fetchMovies(int pageNumber) async {
8 | print("Movie mocking called");
9 | return compute(createMovies, 100);
10 | }
11 | }
12 |
13 | Movies createMovies(int x) {
14 | return Movies(
15 | page: 2,
16 | totalPages: 10,
17 | totalResults: 100,
18 | movies: List.generate(x, (int i) {
19 | return Movie(
20 | title: "Deadpool $i",
21 | posterPath: "\/c9XxwwhPHdaImA2f1WEfEsbhaFB.jpg",
22 | id: i.toString(),
23 | overview: "Jurasic World movie is awesome!",
24 | voteAverage: "4.5",
25 | );
26 | }));
27 | }
28 |
--------------------------------------------------------------------------------
/lib/data/movie_data_prod.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'package:http/http.dart' as http;
3 | import 'movie_data.dart';
4 | import 'dart:convert';
5 | import 'package:flutter/foundation.dart';
6 |
7 | const MOVIE_API_KEY = "e5c7041343c99***********20e80c7";
8 | const BASE_URL = "https://api.themoviedb.org/3/movie/";
9 |
10 | class MovieProdRepository implements MovieRepository {
11 | @override
12 | Future fetchMovies(int pageNumber) async {
13 | http.Response response = await http.get(BASE_URL +
14 | "popular?api_key=" +
15 | MOVIE_API_KEY +
16 | "&page=" +
17 | pageNumber.toString());
18 | return compute(parseMovies, response.body);
19 | }
20 | }
21 |
22 | Movies parseMovies(String responseBody) {
23 | final Map moviesMap = JsonCodec().decode(responseBody);
24 | print(moviesMap);
25 | Movies movies = Movies.fromMap(moviesMap);
26 | if (movies == null) {
27 | throw new FetchMovieException("An error occurred : [ Status Code = ]");
28 | }
29 | return movies;
30 | }
31 |
--------------------------------------------------------------------------------
/lib/dependency_injection.dart:
--------------------------------------------------------------------------------
1 | import 'data/movie_data.dart';
2 | import 'data/movie_data_mock.dart';
3 | import 'data/movie_data_prod.dart';
4 |
5 | enum Flavor { MOCK, PROD }
6 |
7 | class Injector {
8 | static final Injector _instance = Injector.internal();
9 |
10 | static Flavor _flavor;
11 |
12 | static void configure(Flavor flavor) {
13 | _flavor = flavor;
14 | }
15 |
16 | factory Injector() => _instance;
17 |
18 | Injector.internal();
19 |
20 | MovieRepository get movieRepository {
21 | switch (_flavor) {
22 | case Flavor.MOCK:
23 | return new MovieMockRepository();
24 | default:
25 | return new MovieProdRepository();
26 | }
27 | }
28 | }
29 |
30 | class Logger {
31 | final String name;
32 | bool mute = false;
33 |
34 | // _cache is library-private, thanks to
35 | // the _ in front of its name.
36 |
37 | String get nameVar => name.toUpperCase();
38 |
39 | static final Map _cache = {};
40 |
41 | factory Logger(String name) {
42 | if (_cache.containsKey(name)) {
43 | return _cache[name];
44 | } else {
45 | final logger = Logger._internal(name);
46 | _cache[name] = logger;
47 | return logger;
48 | }
49 | }
50 |
51 | Logger._internal(this.name);
52 |
53 | void log(String msg) {
54 | if (!mute) print(msg);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:movie_searcher/ui/movie_list_tile.dart';
3 | import 'package:movie_searcher/data/movie_data.dart';
4 | import 'package:movie_searcher/dependency_injection.dart';
5 | import 'package:movie_searcher/commonWidgets/placeholder_content.dart';
6 |
7 | final Injector injector = Injector();
8 | const int FIRST_PAGE_MOVIE = 1;
9 |
10 | void main() {
11 | Injector.configure(Flavor.PROD);
12 | runApp(MyApp());
13 | }
14 |
15 | class MyApp extends StatelessWidget {
16 | @override
17 | Widget build(BuildContext context) {
18 | return new MaterialApp(
19 | title: "Movie Seacher",
20 | debugShowCheckedModeBanner: false,
21 | theme: ThemeData.dark(),
22 | home: new HomePage(),
23 | );
24 | }
25 | }
26 |
27 | class HomePage extends StatelessWidget {
28 | @override
29 | Widget build(BuildContext context) {
30 | print("Home page building block");
31 | return new Scaffold(
32 | appBar: new AppBar(
33 | title: new Text(
34 | "Movie Searcher",
35 | textDirection: TextDirection.ltr,
36 | ),
37 | ),
38 | body: MoviePage());
39 | }
40 | }
41 |
42 | class MoviePage extends StatefulWidget {
43 | @override
44 | _MoviePageState createState() => _MoviePageState();
45 | }
46 |
47 | class _MoviePageState extends State {
48 | @override
49 | Widget build(BuildContext context) {
50 | print("Building block");
51 | return new FutureBuilder(
52 | future: injector.movieRepository.fetchMovies(FIRST_PAGE_MOVIE),
53 | builder: (context, snapshots) {
54 | if (snapshots.hasError)
55 | return PlaceHolderContent(
56 | title: "Problem Occurred",
57 | message: "Internet not connect try again",
58 | tryAgainButton: _tryAgainButtonClick,
59 | );
60 | switch (snapshots.connectionState) {
61 | case ConnectionState.waiting:
62 | return Center(child: CircularProgressIndicator());
63 | case ConnectionState.done:
64 | return MovieTile(movies: snapshots.data);
65 | default:
66 | }
67 | });
68 | }
69 |
70 | _tryAgainButtonClick(bool _) => setState(() {});
71 | }
72 |
73 | class MovieTile extends StatefulWidget {
74 | final Movies movies;
75 |
76 | MovieTile({Key key, this.movies}) : super(key: key);
77 |
78 | @override
79 | State createState() => MovieTileState();
80 | }
81 |
82 | class MovieTileState extends State {
83 | MovieLoadMoreStatus loadMoreStatus = MovieLoadMoreStatus.STABLE;
84 | final ScrollController scrollController = new ScrollController();
85 | static const String IMAGE_BASE_URL = "http://image.tmdb.org/t/p/w185";
86 | List movies;
87 | int currentPageNumber;
88 |
89 | @override
90 | void initState() {
91 | movies = widget.movies.movies;
92 | currentPageNumber = widget.movies.page;
93 | super.initState();
94 | }
95 |
96 | @override
97 | void dispose() {
98 | scrollController.dispose();
99 | super.dispose();
100 | }
101 |
102 | @override
103 | Widget build(BuildContext context) {
104 | return NotificationListener(
105 | onNotification: onNotification,
106 | child: new GridView.builder(
107 | padding: EdgeInsets.only(top: 5.0),
108 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
109 | crossAxisCount: 2,
110 | childAspectRatio: 0.85,
111 | ),
112 | controller: scrollController,
113 | itemCount: movies.length,
114 | physics: const AlwaysScrollableScrollPhysics(),
115 | itemBuilder: (_, index) {
116 | return MovieListTile(movie: movies[index]);
117 | }));
118 | }
119 |
120 | bool onNotification(ScrollNotification notification) {
121 | if (notification is ScrollUpdateNotification) {
122 | if (scrollController.position.maxScrollExtent > scrollController.offset &&
123 | scrollController.position.maxScrollExtent - scrollController.offset <=
124 | 50) {
125 | if (loadMoreStatus != null &&
126 | loadMoreStatus == MovieLoadMoreStatus.STABLE) {
127 | loadMoreStatus = MovieLoadMoreStatus.LOADING;
128 | injector.movieRepository
129 | .fetchMovies(currentPageNumber + 1)
130 | .then((moviesObject) {
131 | currentPageNumber = moviesObject.page;
132 | loadMoreStatus = MovieLoadMoreStatus.STABLE;
133 | setState(() => movies.addAll(moviesObject.movies));
134 | });
135 | }
136 | }
137 | }
138 | return true;
139 | }
140 |
141 | var meg = function("Hello");
142 | }
143 |
144 | // high level Function
145 | var function = (String msg) => '!!!${msg.toUpperCase()}!!!';
146 |
--------------------------------------------------------------------------------
/lib/modules/movies_presenter.dart:
--------------------------------------------------------------------------------
1 | import '../data/movie_data.dart';
2 | import '../dependency_injection.dart';
3 |
4 | abstract class MovieListViewContract {
5 | void onMovies(List movies);
6 | void onLoadMoviesError();
7 | }
8 |
9 | class MovieListPresenter {
10 | final MovieListViewContract movieListViewContract;
11 | MovieRepository movieRepository;
12 |
13 | MovieListPresenter(this.movieListViewContract) {
14 | movieRepository = new Injector().movieRepository;
15 | }
16 |
17 | void loadMovies() {
18 | movieRepository
19 | .fetchMovies(1)
20 | .then((movies) => movieListViewContract.onMovies(movies.movies))
21 | .catchError((onError) => movieListViewContract.onLoadMoviesError());
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/network/network_image.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:io' as io;
3 | import 'dart:math' as math;
4 | import 'dart:typed_data';
5 | import 'dart:ui' as ui;
6 |
7 | import 'package:flutter/foundation.dart';
8 | import 'package:flutter/widgets.dart';
9 |
10 | /// Fetches the image from the given URL, associating it with the given scale.
11 | ///
12 | /// If [fetchStrategy] is specified, uses it instead of the
13 | /// [defaultFetchStrategy] to obtain instructions for fetching the URL.
14 | ///
15 | /// The image will be cached regardless of cache headers from the server.
16 |
17 | class NetworkImageWithRetry extends ImageProvider {
18 | /// Creates an object that fetches the image at the given [url].
19 | ///
20 | /// The arguments must not be null.
21 | const NetworkImageWithRetry(this.url,
22 | {this.scale: 1.0, this.fetchStrategy: defaultFetchStrategy})
23 | : assert(url != null),
24 | assert(scale != null),
25 | assert(fetchStrategy != null);
26 |
27 | /// The HTTP client used to download images.
28 | static final io.HttpClient _client = new io.HttpClient();
29 |
30 | /// The URL from which the image will be fetched.
31 | final String url;
32 |
33 | /// The scale to place in the [ImageInfo] object of the image.
34 | final double scale;
35 |
36 | /// The strategy used to fetch the [url] and retry when the fetch fails.
37 | ///
38 | /// This function is called at least once and may be called multiple times.
39 | /// The first time it is called, it is passed a null [FetchFailure], which
40 | /// indicates that this is the first attempt to fetch the [url]. Subsequent
41 | /// calls pass non-null [FetchFailure] values, which indicate that previous
42 | /// fetch attempts failed.
43 | final FetchStrategy fetchStrategy;
44 |
45 | /// Used by [defaultFetchStrategy].
46 | ///
47 | /// This indirection is necessary because [defaultFetchStrategy] is used as
48 | /// the default constructor argument value, which requires that it be a const
49 | /// expression.
50 | static final FetchStrategy _defaultFetchStrategyFunction =
51 | const FetchStrategyBuilder().build();
52 |
53 | /// The [FetchStrategy] that [NetworkImageWithRetry] uses by default.
54 | static Future defaultFetchStrategy(
55 | Uri uri, FetchFailure failure) {
56 | return _defaultFetchStrategyFunction(uri, failure);
57 | }
58 |
59 | @override
60 | Future obtainKey(ImageConfiguration configuration) {
61 | return new SynchronousFuture(this);
62 | }
63 |
64 | @override
65 | ImageStreamCompleter load(NetworkImageWithRetry key) {
66 | return new OneFrameImageStreamCompleter(_loadWithRetry(key),
67 | informationCollector: (StringBuffer information) {
68 | information.writeln('Image provider: $this');
69 | information.write('Image key: $key');
70 | });
71 | }
72 |
73 | void _debugCheckInstructions(FetchInstructions instructions) {
74 | assert(() {
75 | if (instructions == null) {
76 | if (fetchStrategy == defaultFetchStrategy) {
77 | throw new StateError(
78 | 'The default FetchStrategy returned null FetchInstructions. This\n'
79 | 'is likely a bug in $runtimeType. Please file a bug at\n'
80 | 'https://github.com/flutter/flutter/issues.');
81 | } else {
82 | throw new StateError(
83 | 'The custom FetchStrategy used to fetch $url returned null\n'
84 | 'FetchInstructions. FetchInstructions must never be null, but\n'
85 | 'instead instruct to either make another fetch attempt or give up.');
86 | }
87 | }
88 | return true;
89 | }());
90 | }
91 |
92 | Future _loadWithRetry(NetworkImageWithRetry key) async {
93 | assert(key == this);
94 |
95 | final Stopwatch stopwatch = new Stopwatch()..start();
96 | final Uri resolved = Uri.base.resolve(key.url);
97 | FetchInstructions instructions = await fetchStrategy(resolved, null);
98 | _debugCheckInstructions(instructions);
99 | int attemptCount = 0;
100 | FetchFailure lastFailure;
101 |
102 | while (!instructions.shouldGiveUp) {
103 | attemptCount += 1;
104 | io.HttpClientRequest request;
105 | try {
106 | request = await _client
107 | .getUrl(instructions.uri)
108 | .timeout(instructions.timeout);
109 | final io.HttpClientResponse response =
110 | await request.close().timeout(instructions.timeout);
111 |
112 | if (response == null || response.statusCode != 200) {
113 | throw new FetchFailure._(
114 | totalDuration: stopwatch.elapsed,
115 | attemptCount: attemptCount,
116 | httpStatusCode: response.statusCode,
117 | );
118 | }
119 |
120 | final _Uint8ListBuilder builder = await response
121 | .fold(
122 | new _Uint8ListBuilder(),
123 | (_Uint8ListBuilder buffer, List bytes) => buffer..add(bytes),
124 | )
125 | .timeout(instructions.timeout);
126 |
127 | final Uint8List bytes = builder.data;
128 |
129 | if (bytes.lengthInBytes == 0) return null;
130 |
131 | final ui.Image image = await decodeImageFromList(bytes);
132 | if (image == null) return null;
133 |
134 | return new ImageInfo(
135 | image: image,
136 | scale: key.scale,
137 | );
138 | } catch (error) {
139 | request?.close();
140 | lastFailure = error is FetchFailure
141 | ? error
142 | : new FetchFailure._(
143 | totalDuration: stopwatch.elapsed,
144 | attemptCount: attemptCount,
145 | originalException: error,
146 | );
147 | instructions = await fetchStrategy(instructions.uri, lastFailure);
148 | _debugCheckInstructions(instructions);
149 | }
150 | }
151 |
152 | if (instructions.alternativeImage != null)
153 | return instructions.alternativeImage;
154 |
155 | assert(lastFailure != null);
156 |
157 | FlutterError.onError(new FlutterErrorDetails(
158 | exception: lastFailure,
159 | library: 'package:flutter_image',
160 | context: '$runtimeType failed to load ${instructions.uri}',
161 | ));
162 |
163 | return null;
164 | }
165 |
166 | @override
167 | bool operator ==(dynamic other) {
168 | if (other.runtimeType != runtimeType) return false;
169 | final NetworkImageWithRetry typedOther = other;
170 | return url == typedOther.url && scale == typedOther.scale;
171 | }
172 |
173 | @override
174 | int get hashCode => hashValues(url, scale);
175 |
176 | @override
177 | String toString() => '$runtimeType("$url", scale: $scale)';
178 | }
179 |
180 | /// This function is called to get [FetchInstructions] to fetch an image.
181 | ///
182 | /// The instructions are executed as soon as possible after the returned
183 | /// [Future] resolves. If a delay in necessary between retries, use a delayed
184 | /// [Future], such as [new Future.delayed]. This is useful for implementing
185 | /// back-off strategies and for recovering from lack of connectivity.
186 | ///
187 | /// [uri] is the last requested image URI. A [FetchStrategy] may choose to use
188 | /// a different URI (see [FetchInstructions.uri]).
189 | ///
190 | /// If [failure] is `null`, then this is the first attempt to fetch the image.
191 | ///
192 | /// If the [failure] is not `null`, it contains the information about the
193 | /// previous attempt to fetch the image. A [FetchStrategy] may attempt to
194 | /// recover from the failure by returning [FetchInstructions] that instruct
195 | /// [NetworkImageWithRetry] to try again.
196 | ///
197 | /// See [NetworkImageWithRetry.defaultFetchStrategy] for an example.
198 | typedef Future FetchStrategy(Uri uri, FetchFailure failure);
199 |
200 | /// Instructions [NetworkImageWithRetry] uses to fetch the image.
201 | @immutable
202 | class FetchInstructions {
203 | /// Instructs [NetworkImageWithRetry] to give up trying to download the image.
204 | const FetchInstructions.giveUp({
205 | @required this.uri,
206 | this.alternativeImage,
207 | }) : shouldGiveUp = true,
208 | timeout = null;
209 |
210 | /// Instructs [NetworkImageWithRetry] to attempt to download the image from
211 | /// the given [uri] and [timeout] if it takes too long.
212 | const FetchInstructions.attempt({
213 | @required this.uri,
214 | @required this.timeout,
215 | }) : shouldGiveUp = false,
216 | alternativeImage = null;
217 |
218 | /// Instructs to give up trying.
219 | ///
220 | /// If [alternativeImage] is `null` reports the latest [FetchFailure] to
221 | /// [FlutterError].
222 | final bool shouldGiveUp;
223 |
224 | /// Timeout for the next network call.
225 | final Duration timeout;
226 |
227 | /// The URI to use on the next attempt.
228 | final Uri uri;
229 |
230 | /// Instructs to give up and use this image instead.
231 | final Future alternativeImage;
232 |
233 | @override
234 | String toString() {
235 | return '$runtimeType(\n'
236 | ' shouldGiveUp: $shouldGiveUp\n'
237 | ' timeout: $timeout\n'
238 | ' uri: $uri\n'
239 | ' alternativeImage?: ${alternativeImage != null ? 'yes' : 'no'}\n'
240 | ')';
241 | }
242 | }
243 |
244 | /// Contains information about a failed attempt to fetch an image.
245 | @immutable
246 | class FetchFailure implements Exception {
247 | const FetchFailure._({
248 | @required this.totalDuration,
249 | @required this.attemptCount,
250 | this.httpStatusCode,
251 | this.originalException,
252 | }) : assert(totalDuration != null),
253 | assert(attemptCount > 0);
254 |
255 | /// The total amount of time it has taken so far to download the image.
256 | final Duration totalDuration;
257 |
258 | /// The number of times [NetworkImageWithRetry] attempted to fetch the image
259 | /// so far.
260 | ///
261 | /// This value starts with 1 and grows by 1 with each attempt to fetch the
262 | /// image.
263 | final int attemptCount;
264 |
265 | /// HTTP status code, such as 500.
266 | final int httpStatusCode;
267 |
268 | /// The exception that caused the fetch failure.
269 | final dynamic originalException;
270 |
271 | @override
272 | String toString() {
273 | return '$runtimeType(\n'
274 | ' attemptCount: $attemptCount\n'
275 | ' httpStatusCode: $httpStatusCode\n'
276 | ' totalDuration: $totalDuration\n'
277 | ' originalException: $originalException\n'
278 | ')';
279 | }
280 | }
281 |
282 | /// An indefinitely growing builder of a [Uint8List].
283 | class _Uint8ListBuilder {
284 | static const int _kInitialSize = 100000; // 100KB-ish
285 |
286 | int _usedLength = 0;
287 | Uint8List _buffer = new Uint8List(_kInitialSize);
288 |
289 | Uint8List get data => new Uint8List.view(_buffer.buffer, 0, _usedLength);
290 |
291 | void add(List bytes) {
292 | _ensureCanAdd(bytes.length);
293 | _buffer.setAll(_usedLength, bytes);
294 | _usedLength += bytes.length;
295 | }
296 |
297 | void _ensureCanAdd(int byteCount) {
298 | final int totalSpaceNeeded = _usedLength + byteCount;
299 |
300 | int newLength = _buffer.length;
301 | while (totalSpaceNeeded > newLength) {
302 | newLength *= 2;
303 | }
304 |
305 | if (newLength != _buffer.length) {
306 | final Uint8List newBuffer = new Uint8List(newLength);
307 | newBuffer.setAll(0, _buffer);
308 | newBuffer.setRange(0, _usedLength, _buffer);
309 | _buffer = newBuffer;
310 | }
311 | }
312 | }
313 |
314 | /// Determines whether the given HTTP [statusCode] is transient.
315 | typedef bool TransientHttpStatusCodePredicate(int statusCode);
316 |
317 | /// Builds a [FetchStrategy] function that retries up to a certain amount of
318 | /// times for up to a certain amount of time.
319 | ///
320 | /// Pauses between retries with pauses growing exponentially (known as
321 | /// exponential backoff). Each attempt is subject to a [timeout]. Retries only
322 | /// those HTTP status codes considered transient by a
323 | /// [transientHttpStatusCodePredicate] function.
324 | class FetchStrategyBuilder {
325 | /// A list of HTTP status codes that can generally be retried.
326 | ///
327 | /// You may want to use a different list depending on the needs of your
328 | /// application.
329 | static const List defaultTransientHttpStatusCodes = const [
330 | 0, // Network error
331 | 408, // Request timeout
332 | 500, // Internal server error
333 | 502, // Bad gateway
334 | 503, // Service unavailable
335 | 504 // Gateway timeout
336 | ];
337 |
338 | /// Creates a fetch strategy builder.
339 | ///
340 | /// All parameters must be non-null.
341 | const FetchStrategyBuilder({
342 | this.timeout: const Duration(seconds: 30),
343 | this.totalFetchTimeout: const Duration(minutes: 1),
344 | this.maxAttempts: 5,
345 | this.initialPauseBetweenRetries: const Duration(seconds: 1),
346 | this.exponentialBackoffMultiplier: 2,
347 | this.transientHttpStatusCodePredicate:
348 | defaultTransientHttpStatusCodePredicate,
349 | }) : assert(timeout != null),
350 | assert(totalFetchTimeout != null),
351 | assert(maxAttempts != null),
352 | assert(initialPauseBetweenRetries != null),
353 | assert(exponentialBackoffMultiplier != null),
354 | assert(transientHttpStatusCodePredicate != null);
355 |
356 | /// Maximum amount of time a single fetch attempt is allowed to take.
357 | final Duration timeout;
358 |
359 | /// A strategy built by this builder will retry for up to this amount of time
360 | /// before giving up.
361 | final Duration totalFetchTimeout;
362 |
363 | /// Maximum number of attempts a strategy will make before giving up.
364 | final int maxAttempts;
365 |
366 | /// Initial amount of time between retries.
367 | final Duration initialPauseBetweenRetries;
368 |
369 | /// The pause between retries is multiplied by this number with each attempt,
370 | /// causing it to grow exponentially.
371 | final num exponentialBackoffMultiplier;
372 |
373 | /// A function that determines whether a given HTTP status code should be
374 | /// retried.
375 | final TransientHttpStatusCodePredicate transientHttpStatusCodePredicate;
376 |
377 | /// Uses [defaultTransientHttpStatusCodes] to determine if the [statusCode] is
378 | /// transient.
379 | static bool defaultTransientHttpStatusCodePredicate(int statusCode) {
380 | return defaultTransientHttpStatusCodes.contains(statusCode);
381 | }
382 |
383 | /// Builds a [FetchStrategy] that operates using the properties of this
384 | /// builder.
385 | FetchStrategy build() {
386 | return (Uri uri, FetchFailure failure) async {
387 | if (failure == null) {
388 | // First attempt. Just load.
389 | return new FetchInstructions.attempt(
390 | uri: uri,
391 | timeout: timeout,
392 | );
393 | }
394 |
395 | final bool isRetriableFailure =
396 | transientHttpStatusCodePredicate(failure.httpStatusCode) ||
397 | failure.originalException is io.SocketException;
398 |
399 | // If cannot retry, give up.
400 | if (!isRetriableFailure || // retrying will not help
401 | failure.totalDuration > totalFetchTimeout || // taking too long
402 | failure.attemptCount > maxAttempts) {
403 | // too many attempts
404 | return new FetchInstructions.giveUp(uri: uri);
405 | }
406 |
407 | // Exponential back-off.
408 | final Duration pauseBetweenRetries = initialPauseBetweenRetries *
409 | math.pow(exponentialBackoffMultiplier, failure.attemptCount - 1);
410 | await new Future.delayed(pauseBetweenRetries);
411 |
412 | // Retry.
413 | return new FetchInstructions.attempt(
414 | uri: uri,
415 | timeout: timeout,
416 | );
417 | };
418 | }
419 | }
420 |
--------------------------------------------------------------------------------
/lib/ui/movie_list_tile.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:movie_searcher/data/movie_data.dart';
3 | import 'package:movie_searcher/network/network_image.dart';
4 |
5 | const String IMAGE_BASE_URL = "http://image.tmdb.org/t/p/w185";
6 |
7 | class MovieListTile extends StatelessWidget {
8 | MovieListTile({this.movie});
9 | final Movie movie;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Card(
14 | shape: RoundedRectangleBorder(
15 | borderRadius: new BorderRadius.all(new Radius.circular(15.0)),
16 | ),
17 | color: Colors.white,
18 | elevation: 5.0,
19 | child: Stack(
20 | fit: StackFit.expand,
21 | children: [
22 | Image(
23 | image: NetworkImageWithRetry(
24 | IMAGE_BASE_URL + movie.posterPath,
25 | scale: 0.85,
26 | ),
27 | fit: BoxFit.fill,
28 | ),
29 | _MovieFavoredImage(movie: movie),
30 | Align(
31 | alignment: Alignment.bottomRight,
32 | child: Padding(
33 | padding: EdgeInsets.only(
34 | bottom: 5.0,
35 | right: 5.0,
36 | ),
37 | child: Text('Rating : ${movie.voteAverage}'),
38 | )),
39 | ],
40 | ));
41 | }
42 | }
43 |
44 | class _MovieFavoredImage extends StatefulWidget {
45 | final Movie movie;
46 | _MovieFavoredImage({@required this.movie});
47 |
48 | @override
49 | State createState() => _MovieFavoredImageState();
50 | }
51 |
52 | class _MovieFavoredImageState extends State<_MovieFavoredImage> {
53 | Movie currentMovie;
54 |
55 | @override
56 | void initState() {
57 | currentMovie = widget.movie;
58 | super.initState();
59 | }
60 |
61 | @override
62 | Widget build(BuildContext context) {
63 | return new Container(
64 | child: new Align(
65 | alignment: Alignment.topRight,
66 | child: new IconButton(
67 | icon: Icon(currentMovie.favored ? Icons.star : Icons.star_border),
68 | onPressed: onFavoredImagePressed,
69 | ),
70 | ),
71 | );
72 | }
73 |
74 | onFavoredImagePressed() {
75 | setState(() => currentMovie.favored = !currentMovie.favored);
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/movie_searcher.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/movie_searcher_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile
3 | packages:
4 | analyzer:
5 | dependency: transitive
6 | description:
7 | name: analyzer
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "0.31.2-alpha.2"
11 | angel_framework:
12 | dependency: transitive
13 | description:
14 | name: angel_framework
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.1.4+3"
18 | angel_http_exception:
19 | dependency: transitive
20 | description:
21 | name: angel_http_exception
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.0.0"
25 | angel_model:
26 | dependency: transitive
27 | description:
28 | name: angel_model
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.0.0"
32 | angel_paginate:
33 | dependency: "direct main"
34 | description:
35 | name: angel_paginate
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.0.0+3"
39 | angel_route:
40 | dependency: transitive
41 | description:
42 | name: angel_route
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "2.0.6"
46 | args:
47 | dependency: transitive
48 | description:
49 | name: args
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.4.3"
53 | async:
54 | dependency: transitive
55 | description:
56 | name: async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.0.7"
60 | body_parser:
61 | dependency: transitive
62 | description:
63 | name: body_parser
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "1.1.0"
67 | boolean_selector:
68 | dependency: transitive
69 | description:
70 | name: boolean_selector
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "1.0.3"
74 | charcode:
75 | dependency: transitive
76 | description:
77 | name: charcode
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "1.1.1"
81 | code_buffer:
82 | dependency: transitive
83 | description:
84 | name: code_buffer
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "1.0.0"
88 | collection:
89 | dependency: transitive
90 | description:
91 | name: collection
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "1.14.6"
95 | combinator:
96 | dependency: transitive
97 | description:
98 | name: combinator
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "1.0.0"
102 | container:
103 | dependency: transitive
104 | description:
105 | name: container
106 | url: "https://pub.dartlang.org"
107 | source: hosted
108 | version: "0.1.2"
109 | convert:
110 | dependency: transitive
111 | description:
112 | name: convert
113 | url: "https://pub.dartlang.org"
114 | source: hosted
115 | version: "2.0.1"
116 | crypto:
117 | dependency: transitive
118 | description:
119 | name: crypto
120 | url: "https://pub.dartlang.org"
121 | source: hosted
122 | version: "2.0.3"
123 | csslib:
124 | dependency: transitive
125 | description:
126 | name: csslib
127 | url: "https://pub.dartlang.org"
128 | source: hosted
129 | version: "0.14.4"
130 | cupertino_icons:
131 | dependency: "direct main"
132 | description:
133 | name: cupertino_icons
134 | url: "https://pub.dartlang.org"
135 | source: hosted
136 | version: "0.1.2"
137 | dart2_constant:
138 | dependency: transitive
139 | description:
140 | name: dart2_constant
141 | url: "https://pub.dartlang.org"
142 | source: hosted
143 | version: "1.0.1+dart2"
144 | flutter:
145 | dependency: "direct main"
146 | description: flutter
147 | source: sdk
148 | version: "0.0.0"
149 | flutter_test:
150 | dependency: "direct dev"
151 | description: flutter
152 | source: sdk
153 | version: "0.0.0"
154 | front_end:
155 | dependency: transitive
156 | description:
157 | name: front_end
158 | url: "https://pub.dartlang.org"
159 | source: hosted
160 | version: "0.1.0-alpha.12"
161 | glob:
162 | dependency: transitive
163 | description:
164 | name: glob
165 | url: "https://pub.dartlang.org"
166 | source: hosted
167 | version: "1.1.5"
168 | html:
169 | dependency: transitive
170 | description:
171 | name: html
172 | url: "https://pub.dartlang.org"
173 | source: hosted
174 | version: "0.13.3"
175 | http:
176 | dependency: transitive
177 | description:
178 | name: http
179 | url: "https://pub.dartlang.org"
180 | source: hosted
181 | version: "0.11.3+16"
182 | http_multi_server:
183 | dependency: transitive
184 | description:
185 | name: http_multi_server
186 | url: "https://pub.dartlang.org"
187 | source: hosted
188 | version: "2.0.4"
189 | http_parser:
190 | dependency: transitive
191 | description:
192 | name: http_parser
193 | url: "https://pub.dartlang.org"
194 | source: hosted
195 | version: "3.1.2"
196 | http_server:
197 | dependency: transitive
198 | description:
199 | name: http_server
200 | url: "https://pub.dartlang.org"
201 | source: hosted
202 | version: "0.9.7"
203 | io:
204 | dependency: transitive
205 | description:
206 | name: io
207 | url: "https://pub.dartlang.org"
208 | source: hosted
209 | version: "0.3.2+1"
210 | js:
211 | dependency: transitive
212 | description:
213 | name: js
214 | url: "https://pub.dartlang.org"
215 | source: hosted
216 | version: "0.6.1"
217 | json_god:
218 | dependency: transitive
219 | description:
220 | name: json_god
221 | url: "https://pub.dartlang.org"
222 | source: hosted
223 | version: "2.0.0-beta+1"
224 | kernel:
225 | dependency: transitive
226 | description:
227 | name: kernel
228 | url: "https://pub.dartlang.org"
229 | source: hosted
230 | version: "0.3.0-alpha.12"
231 | logging:
232 | dependency: transitive
233 | description:
234 | name: logging
235 | url: "https://pub.dartlang.org"
236 | source: hosted
237 | version: "0.11.3+1"
238 | matcher:
239 | dependency: transitive
240 | description:
241 | name: matcher
242 | url: "https://pub.dartlang.org"
243 | source: hosted
244 | version: "0.12.2+1"
245 | merge_map:
246 | dependency: transitive
247 | description:
248 | name: merge_map
249 | url: "https://pub.dartlang.org"
250 | source: hosted
251 | version: "1.0.0"
252 | meta:
253 | dependency: transitive
254 | description:
255 | name: meta
256 | url: "https://pub.dartlang.org"
257 | source: hosted
258 | version: "1.1.5"
259 | mime:
260 | dependency: transitive
261 | description:
262 | name: mime
263 | url: "https://pub.dartlang.org"
264 | source: hosted
265 | version: "0.9.6"
266 | multi_server_socket:
267 | dependency: transitive
268 | description:
269 | name: multi_server_socket
270 | url: "https://pub.dartlang.org"
271 | source: hosted
272 | version: "1.0.1"
273 | node_preamble:
274 | dependency: transitive
275 | description:
276 | name: node_preamble
277 | url: "https://pub.dartlang.org"
278 | source: hosted
279 | version: "1.4.1"
280 | package_config:
281 | dependency: transitive
282 | description:
283 | name: package_config
284 | url: "https://pub.dartlang.org"
285 | source: hosted
286 | version: "1.0.3"
287 | package_resolver:
288 | dependency: transitive
289 | description:
290 | name: package_resolver
291 | url: "https://pub.dartlang.org"
292 | source: hosted
293 | version: "1.0.2"
294 | path:
295 | dependency: transitive
296 | description:
297 | name: path
298 | url: "https://pub.dartlang.org"
299 | source: hosted
300 | version: "1.5.1"
301 | path_provider:
302 | dependency: "direct main"
303 | description:
304 | name: path_provider
305 | url: "https://pub.dartlang.org"
306 | source: hosted
307 | version: "0.4.1"
308 | plugin:
309 | dependency: transitive
310 | description:
311 | name: plugin
312 | url: "https://pub.dartlang.org"
313 | source: hosted
314 | version: "0.2.0+2"
315 | pool:
316 | dependency: transitive
317 | description:
318 | name: pool
319 | url: "https://pub.dartlang.org"
320 | source: hosted
321 | version: "1.3.4"
322 | pub_semver:
323 | dependency: transitive
324 | description:
325 | name: pub_semver
326 | url: "https://pub.dartlang.org"
327 | source: hosted
328 | version: "1.4.1"
329 | quiver:
330 | dependency: transitive
331 | description:
332 | name: quiver
333 | url: "https://pub.dartlang.org"
334 | source: hosted
335 | version: "0.29.0+1"
336 | quiver_hashcode:
337 | dependency: transitive
338 | description:
339 | name: quiver_hashcode
340 | url: "https://pub.dartlang.org"
341 | source: hosted
342 | version: "1.0.0"
343 | random_string:
344 | dependency: transitive
345 | description:
346 | name: random_string
347 | url: "https://pub.dartlang.org"
348 | source: hosted
349 | version: "0.0.1"
350 | rxdart:
351 | dependency: "direct main"
352 | description:
353 | name: rxdart
354 | url: "https://pub.dartlang.org"
355 | source: hosted
356 | version: "0.17.0"
357 | shelf:
358 | dependency: transitive
359 | description:
360 | name: shelf
361 | url: "https://pub.dartlang.org"
362 | source: hosted
363 | version: "0.7.3"
364 | shelf_packages_handler:
365 | dependency: transitive
366 | description:
367 | name: shelf_packages_handler
368 | url: "https://pub.dartlang.org"
369 | source: hosted
370 | version: "1.0.3"
371 | shelf_static:
372 | dependency: transitive
373 | description:
374 | name: shelf_static
375 | url: "https://pub.dartlang.org"
376 | source: hosted
377 | version: "0.2.7"
378 | shelf_web_socket:
379 | dependency: transitive
380 | description:
381 | name: shelf_web_socket
382 | url: "https://pub.dartlang.org"
383 | source: hosted
384 | version: "0.2.2"
385 | sky_engine:
386 | dependency: transitive
387 | description: flutter
388 | source: sdk
389 | version: "0.0.99"
390 | source_map_stack_trace:
391 | dependency: transitive
392 | description:
393 | name: source_map_stack_trace
394 | url: "https://pub.dartlang.org"
395 | source: hosted
396 | version: "1.1.4"
397 | source_maps:
398 | dependency: transitive
399 | description:
400 | name: source_maps
401 | url: "https://pub.dartlang.org"
402 | source: hosted
403 | version: "0.10.5"
404 | source_span:
405 | dependency: transitive
406 | description:
407 | name: source_span
408 | url: "https://pub.dartlang.org"
409 | source: hosted
410 | version: "1.4.0"
411 | sqflite:
412 | dependency: "direct main"
413 | description:
414 | name: sqflite
415 | url: "https://pub.dartlang.org"
416 | source: hosted
417 | version: "0.10.0"
418 | stack_trace:
419 | dependency: transitive
420 | description:
421 | name: stack_trace
422 | url: "https://pub.dartlang.org"
423 | source: hosted
424 | version: "1.9.2"
425 | stream_channel:
426 | dependency: transitive
427 | description:
428 | name: stream_channel
429 | url: "https://pub.dartlang.org"
430 | source: hosted
431 | version: "1.6.6"
432 | string_scanner:
433 | dependency: transitive
434 | description:
435 | name: string_scanner
436 | url: "https://pub.dartlang.org"
437 | source: hosted
438 | version: "1.0.2"
439 | synchronized:
440 | dependency: transitive
441 | description:
442 | name: synchronized
443 | url: "https://pub.dartlang.org"
444 | source: hosted
445 | version: "1.5.0+1"
446 | term_glyph:
447 | dependency: transitive
448 | description:
449 | name: term_glyph
450 | url: "https://pub.dartlang.org"
451 | source: hosted
452 | version: "1.0.0"
453 | test:
454 | dependency: transitive
455 | description:
456 | name: test
457 | url: "https://pub.dartlang.org"
458 | source: hosted
459 | version: "0.12.37"
460 | tuple:
461 | dependency: transitive
462 | description:
463 | name: tuple
464 | url: "https://pub.dartlang.org"
465 | source: hosted
466 | version: "1.0.1"
467 | typed_data:
468 | dependency: transitive
469 | description:
470 | name: typed_data
471 | url: "https://pub.dartlang.org"
472 | source: hosted
473 | version: "1.1.5"
474 | utf:
475 | dependency: transitive
476 | description:
477 | name: utf
478 | url: "https://pub.dartlang.org"
479 | source: hosted
480 | version: "0.9.0+4"
481 | vector_math:
482 | dependency: transitive
483 | description:
484 | name: vector_math
485 | url: "https://pub.dartlang.org"
486 | source: hosted
487 | version: "2.0.6"
488 | watcher:
489 | dependency: transitive
490 | description:
491 | name: watcher
492 | url: "https://pub.dartlang.org"
493 | source: hosted
494 | version: "0.9.7+7"
495 | web_socket_channel:
496 | dependency: transitive
497 | description:
498 | name: web_socket_channel
499 | url: "https://pub.dartlang.org"
500 | source: hosted
501 | version: "1.0.7"
502 | yaml:
503 | dependency: transitive
504 | description:
505 | name: yaml
506 | url: "https://pub.dartlang.org"
507 | source: hosted
508 | version: "2.1.13"
509 | sdks:
510 | dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760"
511 | flutter: ">=0.1.4 <2.0.0"
512 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: movie_searcher
2 | description: A new Flutter project.
3 |
4 | dependencies:
5 | flutter:
6 | sdk: flutter
7 |
8 | # The following adds the Cupertino Icons font to your application.
9 | # Use with the CupertinoIcons class for iOS style icons.
10 | cupertino_icons: ^0.1.2
11 | sqflite: any
12 | path_provider: "^0.4.1"
13 | rxdart: "^0.17.0"
14 | angel_paginate: "^1.0.0"
15 |
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 |
20 |
21 | # For information on the generic Dart part of this file, see the
22 | # following page: https://www.dartlang.org/tools/pub/pubspec
23 |
24 | # The following section is specific to Flutter.
25 | flutter:
26 |
27 | # The following line ensures that the Material Icons font is
28 | # included with your application, so that you can use the icons in
29 | # the material Icons class.
30 | uses-material-design: true
31 |
32 | # To add assets to your application, add an assets section, like this:
33 | # assets:
34 | # - images/a_dot_burr.jpeg
35 | # - images/a_dot_ham.jpeg
36 |
37 | # An image asset can refer to one or more resolution-specific "variants", see
38 | # https://flutter.io/assets-and-images/#resolution-aware.
39 |
40 | # For details regarding adding assets from package dependencies, see
41 | # https://flutter.io/assets-and-images/#from-packages
42 |
43 | # To add custom fonts to your application, add a fonts section here,
44 | # in this "flutter" section. Each entry in this list should have a
45 | # "family" key with the font family name, and a "fonts" key with a
46 | # list giving the asset and other descriptors for the font. For
47 | # example:
48 | # fonts:
49 | # - family: Schyler
50 | # fonts:
51 | # - asset: fonts/Schyler-Regular.ttf
52 | # - asset: fonts/Schyler-Italic.ttf
53 | # style: italic
54 | # - family: Trajan Pro
55 | # fonts:
56 | # - asset: fonts/TrajanPro.ttf
57 | # - asset: fonts/TrajanPro_Bold.ttf
58 | # weight: 700
59 | #
60 | # For details regarding fonts from package dependencies,
61 | # see https://flutter.io/custom-fonts/#from-packages
62 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties
5 | // are correct.
6 |
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_test/flutter_test.dart';
9 |
10 | import 'package:movie_searcher/main.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(new MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------