├── .gitignore ├── .idea ├── libraries │ ├── Dart_SDK.xml │ └── Flutter_for_Android.xml ├── modules.xml ├── runConfigurations │ └── main_dart.xml └── workspace.xml ├── .metadata ├── .vscode ├── launch.json └── settings.json ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── fluttergank │ │ │ └── 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 ├── flutter_01.log ├── flutter_gank.iml ├── flutter_gank_android.iml ├── images ├── 2.0x │ └── gank.png ├── 3.0x │ └── gank.png ├── gank.png ├── lake.jpg └── loading.png ├── 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 ├── config │ └── AppOptions.dart ├── main.dart ├── models │ ├── BookResp.dart │ ├── Gank.dart │ ├── GankItem.dart │ └── GankList.dart └── ui │ ├── Home.dart │ ├── Splash.dart │ ├── android │ └── Android.dart │ ├── book │ ├── Book.dart │ └── BookList.dart │ ├── comm │ ├── LoadingMoreFooter.dart │ ├── LoadingPage.dart │ ├── MyDrawer.dart │ └── MyWebview.dart │ ├── ios │ └── Ios.dart │ ├── setting │ └── Setting.dart │ ├── video │ └── VideoPage.dart │ ├── web │ └── Web.dart │ └── welfare │ ├── PhotoView.dart │ └── Welfare.dart ├── pubspec.lock ├── pubspec.yaml ├── readmeImage ├── 115567431967967707.png ├── 195713837319785555.png ├── 420295395223380047.png └── 664096358807009630.png └── 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 | 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 | 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: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b 8 | channel: beta 9 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: 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 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_gank 2 | 3 | Flutter App for Gank.io 4 | 5 | 预览图片 6 | 7 | ![首页预览](https://github.com/pknan520/flutter_gank/blob/master/readmeImage/664096358807009630.png) 8 | ![Drawer](https://github.com/pknan520/flutter_gank/blob/master/readmeImage/195713837319785555.png) 9 | ![Android](https://github.com/pknan520/flutter_gank/blob/master/readmeImage/420295395223380047.png) 10 | ![福利](https://github.com/pknan520/flutter_gank/blob/master/readmeImage/115567431967967707.png) 11 | 12 | ## Getting Started 13 | 14 | For help getting started with Flutter, view our online 15 | [documentation](https://flutter.io/). 16 | -------------------------------------------------------------------------------- /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.fluttergank" 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.2' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 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/fluttergank/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.fluttergank; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.1.2' 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | maven { url 'https://jitpack.io' } 16 | maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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.4-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 | -------------------------------------------------------------------------------- /flutter_01.log: -------------------------------------------------------------------------------- 1 | Flutter crash report; please file at https://github.com/flutter/flutter/issues. 2 | 3 | ## command 4 | 5 | flutter build apk 6 | 7 | ## exception 8 | 9 | FormatException: FormatException: Bad UTF-8 encoding 0xc3 (at offset 172) 10 | 11 | ``` 12 | #0 _Utf8Decoder.convert (dart:convert/utf.dart:490) 13 | #1 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:345) 14 | #2 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:341) 15 | #3 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:86) 16 | #4 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120) 17 | #5 _rootRunUnary (dart:async/zone.dart:1134) 18 | #6 _CustomZone.runUnary (dart:async/zone.dart:1031) 19 | #7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933) 20 | #8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330) 21 | #9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:257) 22 | #10 _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:763) 23 | #11 _StreamController._add (dart:async/stream_controller.dart:639) 24 | #12 _StreamController.add (dart:async/stream_controller.dart:585) 25 | #13 _Socket._onData (dart:io-patch/socket_patch.dart:1672) 26 | #14 _rootRunUnary (dart:async/zone.dart:1138) 27 | #15 _CustomZone.runUnary (dart:async/zone.dart:1031) 28 | #16 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933) 29 | #17 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330) 30 | #18 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:257) 31 | #19 _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:763) 32 | #20 _StreamController._add (dart:async/stream_controller.dart:639) 33 | #21 _StreamController.add (dart:async/stream_controller.dart:585) 34 | #22 new _RawSocket. (dart:io-patch/socket_patch.dart:1245) 35 | #23 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:797) 36 | #24 _microtaskLoop (dart:async/schedule_microtask.dart:41) 37 | #25 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50) 38 | #26 _runPendingImmediateCallback (dart:isolate-patch/dart:isolate/isolate_patch.dart:113) 39 | #27 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:166) 40 | ``` 41 | 42 | ## flutter doctor 43 | 44 | ``` 45 | [✓] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.14393], locale zh-CN) 46 | • Flutter version 0.5.1 at D:\flutter 47 | • Framework revision c7ea3ca377 (8 weeks ago), 2018-05-29 21:07:33 +0200 48 | • Engine revision 1ed25ca7b7 49 | • Dart version 2.0.0-dev.58.0.flutter-f981f09760 50 | 51 | [!] Android toolchain - develop for Android devices (Android SDK 27.0.3) 52 | • Android SDK at D:\Android\sdk 53 | • Android NDK location not configured (optional; useful for native profiling support) 54 | • Platform android-27, build-tools 27.0.3 55 | • ANDROID_HOME = D:\Android\sdk 56 | • Java binary at: D:\Android\Android Studio\jre\bin\java 57 | • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01) 58 | ✗ Android license status unknown. 59 | 60 | [✓] Android Studio (version 3.0) 61 | • Android Studio at D:\Android\Android Studio 62 | ✗ Flutter plugin not installed; this adds Flutter specific functionality. 63 | ✗ Dart plugin not installed; this adds Dart specific functionality. 64 | • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01) 65 | 66 | [!] IntelliJ IDEA Ultimate Edition (version 2017.2) 67 | • IntelliJ at D:\JetBrains\IntelliJ IDEA 2017.2 68 | ✗ Flutter plugin not installed; this adds Flutter specific functionality. 69 | ✗ Dart plugin not installed; this adds Dart specific functionality. 70 | • For information about installing plugins, see 71 | https://flutter.io/intellij-setup/#installing-the-plugins 72 | 73 | [✓] Connected devices (2 available) 74 | • KNT AL20 • TWGDU16B26002896 • android-arm64 • Android 7.0 (API 24) 75 | • Google Galaxy Nexus, 4 2 2, API 17, 720x1280 • 192.168.176.101:5555 • android-x86 • Android 4.2.2 (API 17) 76 | 77 | ! Doctor found issues in 2 categories. 78 | ``` 79 | -------------------------------------------------------------------------------- /flutter_gank.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /flutter_gank_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /images/2.0x/gank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/images/2.0x/gank.png -------------------------------------------------------------------------------- /images/3.0x/gank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/images/3.0x/gank.png -------------------------------------------------------------------------------- /images/gank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/images/gank.png -------------------------------------------------------------------------------- /images/lake.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/images/lake.jpg -------------------------------------------------------------------------------- /images/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/images/loading.png -------------------------------------------------------------------------------- /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.flutterGank; 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.flutterGank; 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 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/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 | flutter_gank 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/config/AppOptions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppOptions { 4 | final AppTheme appTheme; 5 | 6 | const AppOptions({this.appTheme}); 7 | 8 | AppOptions copyWith({AppTheme appTheme}) { 9 | return AppOptions(appTheme: appTheme); 10 | } 11 | } 12 | 13 | class AppTheme { 14 | final ThemeData themeData; 15 | 16 | const AppTheme(this.themeData); 17 | 18 | AppTheme changePrimaryColor(Color color) { 19 | return AppTheme(themeData.copyWith(primaryColor: color)); 20 | } 21 | } 22 | 23 | final AppTheme defTheme = 24 | AppTheme(ThemeData().copyWith(primaryColor: Colors.blue)); 25 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:flutter_gank/ui/Splash.dart'; 4 | import 'package:flutter_gank/ui/Home.dart'; 5 | import 'package:flutter_gank/ui/android/Android.dart'; 6 | import 'package:flutter_gank/ui/book/Book.dart'; 7 | import 'package:flutter_gank/config/AppOptions.dart'; 8 | import 'package:flutter_gank/ui/ios/Ios.dart'; 9 | import 'package:flutter_gank/ui/setting/Setting.dart'; 10 | import 'package:flutter_gank/ui/video/VideoPage.dart'; 11 | import 'package:flutter_gank/ui/web/Web.dart'; 12 | import 'package:flutter_gank/ui/welfare/Welfare.dart'; 13 | 14 | void main() => runApp(MyApp()); 15 | 16 | class MyApp extends StatefulWidget { 17 | @override 18 | _MyAppState createState() => _MyAppState(); 19 | } 20 | 21 | class _MyAppState extends State { 22 | AppOptions _appOpt; 23 | 24 | void _handleOptChanged(AppOptions _newOpt) { 25 | setState(() { 26 | _appOpt = _newOpt; 27 | }); 28 | } 29 | 30 | @override 31 | void initState() { 32 | super.initState(); 33 | _appOpt = AppOptions(appTheme: defTheme); 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return MaterialApp( 39 | title: 'Flutter Gank', 40 | theme: _appOpt.appTheme.themeData, 41 | home: Slpash(), 42 | routes: { 43 | '/home': (_) => Home(), 44 | '/setting': (_) => 45 | Setting(appOpt: _appOpt, onOptionsChanged: _handleOptChanged), 46 | '/android': (_) => AndroidPage(), 47 | '/ios': (_) => Ios(), 48 | '/web': (_) => Web(), 49 | '/welfare': (_) => Welfare(), 50 | '/video': (_) => VideoPage(), 51 | '/book': (_) => Book() 52 | }, 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/models/BookResp.dart: -------------------------------------------------------------------------------- 1 | class BookResp { 2 | final bool error; 3 | final List results; 4 | 5 | BookResp(this.error, this.results); 6 | 7 | BookResp.fromJson(Map json) 8 | : error = json['error'], 9 | results = formatedResults(json['results']); 10 | 11 | static formatedResults(list) { 12 | List mList = []; 13 | if (list != null) { 14 | list.forEach((v) { 15 | mList.add(BookContent.fromJson(v)); 16 | }); 17 | } 18 | return mList; 19 | } 20 | } 21 | 22 | class BookContent { 23 | final String _id; 24 | final String content; 25 | final String cover; 26 | final int crawled; 27 | final String created_at; 28 | final bool deleted; 29 | final String published_at; 30 | final String raw; 31 | final Site site; 32 | final String title; 33 | final String uid; 34 | final String url; 35 | 36 | BookContent( 37 | this._id, 38 | this.content, 39 | this.cover, 40 | this.crawled, 41 | this.created_at, 42 | this.deleted, 43 | this.published_at, 44 | this.raw, 45 | this.site, 46 | this.title, 47 | this.uid, 48 | this.url); 49 | 50 | BookContent.fromJson(Map json) 51 | : _id = json['_id'], 52 | content = json['content'], 53 | cover = json['cover'], 54 | crawled = json['crawled'], 55 | created_at = json['created_at'], 56 | deleted = json['deleted'], 57 | published_at = json['published_at'], 58 | raw = json['raw'], 59 | site = Site.fromJson(json['site']), 60 | title = json['title'], 61 | uid = json['uid'], 62 | url = json['url']; 63 | 64 | Map toJson() => { 65 | '_id': _id, 66 | 'content': content, 67 | 'cover': cover, 68 | 'crawled': crawled, 69 | 'created_at': created_at, 70 | 'deleted': deleted, 71 | 'published_at': published_at, 72 | 'raw': raw, 73 | 'site': site, 74 | 'title': title, 75 | 'uid': uid, 76 | 'url': url 77 | }; 78 | } 79 | 80 | class Site { 81 | final String cat_cn; 82 | final String cat_en; 83 | final String desc; 84 | final String feed_id; 85 | final String icon; 86 | final String id; 87 | final String name; 88 | final int subscribers; 89 | final String type; 90 | final String url; 91 | 92 | Site(this.cat_cn, this.cat_en, this.desc, this.feed_id, this.icon, this.id, 93 | this.name, this.subscribers, this.type, this.url); 94 | 95 | Site.fromJson(Map json) 96 | : cat_cn = json['cat_cn'], 97 | cat_en = json['cat_en'], 98 | desc = json['desc'], 99 | feed_id = json['feed_id'], 100 | icon = json['icon'], 101 | id = json['id'], 102 | name = json['name'], 103 | subscribers = json['subscribers'], 104 | type = json['type'], 105 | url = json['url']; 106 | 107 | Map toJson() => { 108 | 'cat_cn': cat_cn, 109 | 'cat_en': cat_en, 110 | 'desc': desc, 111 | 'feed_id': feed_id, 112 | 'icon': icon, 113 | 'id': id, 114 | 'name': name, 115 | 'subscribers': subscribers, 116 | 'type': type, 117 | 'url': url 118 | }; 119 | } 120 | -------------------------------------------------------------------------------- /lib/models/Gank.dart: -------------------------------------------------------------------------------- 1 | // import 'GankItem.dart'; 2 | 3 | import 'package:flutter_gank/models/GankItem.dart'; 4 | 5 | class Gank { 6 | final List category; 7 | final bool error; 8 | final Map> results; 9 | 10 | Gank(this.category, this.error, this.results); 11 | 12 | Gank.fromJson(Map json) 13 | : category = formatedString(json['category']), 14 | error = json['error'], 15 | results = formatedResults(json['results']); 16 | 17 | Map toJson() => 18 | {'category': category, 'error': error, 'results': results}; 19 | 20 | static formatedString(list) { 21 | List category = []; 22 | if (list != null) { 23 | list.forEach((v) { 24 | category.add(v.toString()); 25 | }); 26 | } 27 | return category; 28 | } 29 | 30 | static formatedResults(Map map) { 31 | Map> results = Map(); 32 | if (map != null) { 33 | map.forEach((key, val) { 34 | List list = []; 35 | if (val != null) { 36 | val.forEach((v) { 37 | list.add(GankItem.fromJson(v)); 38 | }); 39 | } 40 | results.addAll({key: list}); 41 | }); 42 | } 43 | return results; 44 | } 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /lib/models/GankItem.dart: -------------------------------------------------------------------------------- 1 | class GankItem { 2 | final String _id; 3 | final String createdAt; 4 | final String desc; 5 | final String publishedAt; 6 | final String source; 7 | final String type; 8 | final String url; 9 | final bool used; 10 | final String who; 11 | 12 | GankItem(this._id, this.createdAt, this.desc, this.publishedAt, this.source, 13 | this.type, this.url, this.used, this.who); 14 | 15 | GankItem.fromJson(Map json) 16 | : _id = json['_id'], 17 | createdAt = json['createdAt'], 18 | desc = json['desc'], 19 | publishedAt = json['publishedAt'], 20 | source = json['source'], 21 | type = json['type'], 22 | url = json['url'], 23 | used = json['used'], 24 | who = json['who']; 25 | 26 | Map toJson() => { 27 | '_id': _id, 28 | 'createdAt': createdAt, 29 | 'desc': desc, 30 | 'publishedAt': publishedAt, 31 | 'source': source, 32 | 'type': type, 33 | 'url': url, 34 | 'used': used, 35 | 'who': who 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /lib/models/GankList.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_gank/models/GankItem.dart'; 2 | 3 | class GankList { 4 | final bool error; 5 | final List results; 6 | 7 | GankList(this.error, this.results); 8 | 9 | GankList.fromJson(Map json) 10 | : error = json['error'], 11 | results = formatedList(json['results']); 12 | 13 | static formatedList(list) { 14 | List ganklist = []; 15 | if (list != null) { 16 | list.forEach((v) { 17 | ganklist.add(GankItem.fromJson(v)); 18 | }); 19 | } 20 | return ganklist; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/ui/Home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:dio/dio.dart'; 3 | 4 | import 'package:flutter_gank/models/Gank.dart'; 5 | import 'package:flutter_gank/models/GankItem.dart'; 6 | import 'package:flutter_gank/ui/comm/MyDrawer.dart'; 7 | import 'package:flutter_gank/ui/comm/MyWebview.dart'; 8 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 9 | 10 | enum AppBarBehavior { normal, pinned, floating, snapping } 11 | 12 | class Home extends StatefulWidget { 13 | @override 14 | _HomeState createState() => _HomeState(); 15 | } 16 | 17 | class _HomeState extends State { 18 | final Map> ganks = Map>(); 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | _getData(); 24 | } 25 | 26 | void _getData() async { 27 | await Dio().get('http://gank.io/api/today').then((resp) { 28 | Gank gank = Gank.fromJson(resp.data); 29 | setState(() { 30 | ganks.addAll(gank.results); 31 | }); 32 | }, onError: () {}); 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | AppBarBehavior _appBarBehavior = AppBarBehavior.pinned; 38 | return Scaffold( 39 | drawer: MyDrawer(), 40 | // floatingActionButton: FloatingActionButton( 41 | // onPressed: () => _getData(), 42 | // child: Icon(Icons.edit), 43 | // ), 44 | body: CustomScrollView( 45 | slivers: [ 46 | SliverAppBar( 47 | expandedHeight: 256.0, 48 | pinned: _appBarBehavior == AppBarBehavior.pinned, 49 | floating: _appBarBehavior == AppBarBehavior.floating || 50 | _appBarBehavior == AppBarBehavior.snapping, 51 | snap: _appBarBehavior == AppBarBehavior.snapping, 52 | flexibleSpace: FlexibleSpaceBar( 53 | title: Text('Gank'), 54 | background: Stack( 55 | fit: StackFit.expand, 56 | children: [ 57 | ganks['福利'] != null 58 | ? FadeInImage.assetNetwork( 59 | placeholder: 'images/lake.jpg', 60 | image: ganks['福利'][0].url, 61 | fit: BoxFit.cover, 62 | height: 256.0, 63 | ) 64 | : Image.asset( 65 | 'images/lake.jpg', 66 | fit: BoxFit.cover, 67 | height: 256.0, 68 | ), 69 | ], 70 | ), 71 | ), 72 | ), 73 | // SliverList( 74 | // delegate: SliverChildListDelegate( 75 | // _buildGroup(ganks), 76 | // ), 77 | // ), 78 | ganks.length == 0 79 | ? SliverFillRemaining( 80 | child: LoadingPage(), 81 | ) 82 | : SliverList( 83 | delegate: SliverChildListDelegate( 84 | _buildGroup(ganks), 85 | ), 86 | ), 87 | ], 88 | ), 89 | ); 90 | } 91 | 92 | List _buildGroup(Map> ganks) { 93 | final TextStyle titleStyle = TextStyle( 94 | fontSize: 16.0, color: Color(0xff333333), fontWeight: FontWeight.bold); 95 | List widgets = []; 96 | ganks.forEach((k, v) { 97 | if (k != '福利') { 98 | widgets.add( 99 | Container( 100 | child: Column( 101 | crossAxisAlignment: CrossAxisAlignment.start, 102 | children: [ 103 | Container( 104 | margin: EdgeInsets.only(left: 12.0, top: 12.0, right: 12.0), 105 | child: Text(k, style: titleStyle), 106 | ), 107 | Container( 108 | child: Column( 109 | children: v.map((item) { 110 | return ListTile( 111 | title: Text(item.desc), 112 | subtitle: Text(item.who), 113 | onTap: () => Navigator 114 | .of(context) 115 | .push(MaterialPageRoute(builder: (context) { 116 | return MyWebview(title: item.desc, url: item.url); 117 | })), 118 | ); 119 | }).toList(), 120 | ), 121 | ), 122 | ], 123 | ), 124 | ), 125 | ); 126 | } 127 | }); 128 | return widgets; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /lib/ui/Splash.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Slpash extends StatefulWidget { 4 | @override 5 | _SlpashState createState() => _SlpashState(); 6 | } 7 | 8 | class _SlpashState extends State with TickerProviderStateMixin { 9 | final TextStyle textStyle = TextStyle(fontSize: 12.0, color: Colors.white); 10 | 11 | AnimationController _controllerLogo; 12 | CurvedAnimation _curvedLogoMove; 13 | CurvedAnimation _curvedLogoOpacity; 14 | 15 | AnimationController _controllerText0; 16 | CurvedAnimation _curvedText0Move; 17 | CurvedAnimation _curvedText0Opacity; 18 | 19 | AnimationController _controllerText1; 20 | CurvedAnimation _curvedText1Move; 21 | CurvedAnimation _curvedText1Opacity; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | initAnim(); 27 | } 28 | 29 | void initAnim() { 30 | // LOGO的动画 31 | _controllerLogo = 32 | AnimationController(duration: Duration(milliseconds: 800), vsync: this) 33 | ..addStatusListener((AnimationStatus status) { 34 | if (status == AnimationStatus.completed) { 35 | _controllerText0.forward(); 36 | } 37 | }); 38 | Tween(begin: -40.0, end: 0.0).animate(_controllerLogo) 39 | ..addListener(() { 40 | setState(() {}); 41 | }); 42 | _curvedLogoMove = 43 | CurvedAnimation(parent: _controllerLogo, curve: Curves.easeIn); 44 | _curvedLogoOpacity = 45 | CurvedAnimation(parent: _controllerLogo, curve: Curves.easeIn); 46 | 47 | _controllerLogo.forward(); 48 | 49 | // 字符串1的动画 50 | _controllerText0 = 51 | AnimationController(duration: Duration(milliseconds: 800), vsync: this) 52 | ..addStatusListener((AnimationStatus status) { 53 | if (status == AnimationStatus.completed) { 54 | _controllerText1.forward(); 55 | } 56 | }); 57 | Tween(begin: 10.0, end: 50.0).animate(_controllerText0) 58 | ..addListener(() { 59 | setState(() {}); 60 | }); 61 | _curvedText0Move = 62 | CurvedAnimation(parent: _controllerText0, curve: Curves.easeIn); 63 | _curvedText0Opacity = 64 | CurvedAnimation(parent: _controllerText0, curve: Curves.easeIn); 65 | 66 | // 字符串2的动画 67 | _controllerText1 = 68 | AnimationController(duration: Duration(milliseconds: 800), vsync: this) 69 | ..addStatusListener((AnimationStatus status) { 70 | if (status == AnimationStatus.completed) { 71 | Navigator.of(context).pushReplacementNamed('/home'); 72 | } 73 | }); 74 | 75 | Tween(begin: 10.0, end: 50.0).animate(_controllerText1) 76 | ..addListener(() { 77 | setState(() {}); 78 | }); 79 | _curvedText1Move = 80 | CurvedAnimation(parent: _controllerText1, curve: Curves.easeIn); 81 | _curvedText1Opacity = 82 | CurvedAnimation(parent: _controllerText1, curve: Curves.easeIn); 83 | } 84 | 85 | @override 86 | void dispose() { 87 | _controllerLogo.dispose(); 88 | _controllerText0.dispose(); 89 | _controllerText1.dispose(); 90 | super.dispose(); 91 | } 92 | 93 | @override 94 | Widget build(BuildContext context) { 95 | return Scaffold( 96 | backgroundColor: Colors.black, 97 | body: Stack( 98 | children: [ 99 | Positioned( 100 | left: -40 + _curvedLogoMove.value * 40.0, 101 | top: 0.0, 102 | right: 0.0, 103 | bottom: 0.0, 104 | child: FadeTransition( 105 | opacity: _curvedLogoOpacity, 106 | child: Container( 107 | alignment: Alignment.center, 108 | child: FlutterLogo(size: 100.0), 109 | ), 110 | ), 111 | ), 112 | Positioned( 113 | bottom: 50.0, 114 | left: 10.0 + _curvedText0Move.value * 40.0, 115 | child: FadeTransition( 116 | opacity: _curvedText0Opacity, 117 | child: Text('Supported by: Gank.io', style: textStyle), 118 | ), 119 | ), 120 | Positioned( 121 | bottom: 30.0, 122 | left: 10.0 + _curvedText1Move.value * 40.0, 123 | child: FadeTransition( 124 | opacity: _curvedText1Opacity, 125 | child: Text('Powered by: PK', style: textStyle), 126 | ), 127 | ), 128 | ], 129 | ), 130 | ); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /lib/ui/android/Android.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_gank/models/GankList.dart'; 6 | import 'package:flutter_gank/models/GankItem.dart'; 7 | import 'package:flutter_gank/ui/comm/LoadingMoreFooter.dart'; 8 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 9 | import 'package:flutter_gank/ui/comm/MyWebview.dart'; 10 | 11 | class AndroidPage extends StatefulWidget { 12 | @override 13 | _AndroidPageState createState() => _AndroidPageState(); 14 | } 15 | 16 | class _AndroidPageState extends State { 17 | final List data = []; 18 | num currPage = 1; 19 | ScrollController _controller; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _controller = ScrollController() 25 | ..addListener(() { 26 | var maxScroll = _controller.position.maxScrollExtent; 27 | var pixels = _controller.position.pixels; 28 | if (maxScroll - pixels < 200.0) { 29 | currPage++; 30 | _getData(false); 31 | } 32 | }); 33 | _getData(true); 34 | } 35 | 36 | Future _getData(bool isRefresh) async { 37 | if (isRefresh) { 38 | data.clear(); 39 | currPage = 1; 40 | } 41 | await Dio().get('http://gank.io/api/data/Android/10/$currPage').then( 42 | (resp) { 43 | GankList gankList = GankList.fromJson(resp.data); 44 | setState(() { 45 | data.addAll(gankList.results); 46 | }); 47 | }, onError: () {}); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | appBar: AppBar( 54 | title: Text('Android'), 55 | ), 56 | body: data.length == 0 57 | ? LoadingPage() 58 | : RefreshIndicator( 59 | child: ListView.builder( 60 | itemCount: 2 * data.length + 1, 61 | itemBuilder: (context, i) { 62 | if (i.isOdd) return Divider(height: 1.0); 63 | if (i == 2 * data.length) return LoadingMoreFooter(); 64 | final index = i ~/ 2; 65 | return _buildRow(data[index]); 66 | }, 67 | controller: _controller, 68 | ), 69 | onRefresh: () => _getData(true), 70 | ), 71 | ); 72 | } 73 | 74 | Widget _buildRow(GankItem item) { 75 | return ListTile( 76 | title: Text(item.desc), 77 | subtitle: Text(item.who), 78 | onTap: () => 79 | Navigator.of(context).push(MaterialPageRoute(builder: (context) { 80 | return MyWebview(title: item.desc, url: item.url); 81 | })), 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/ui/book/Book.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_gank/ui/book/BookList.dart'; 3 | 4 | class Book extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return DefaultTabController( 8 | length: tabList.length, 9 | child: Scaffold( 10 | appBar: AppBar( 11 | title: Text('闲读'), 12 | bottom: TabBar( 13 | isScrollable: true, 14 | tabs: tabList.map((TabContent tab) { 15 | return Tab( 16 | text: tab.title, 17 | ); 18 | }).toList()), 19 | ), 20 | body: TabBarView( 21 | children: tabList.map((TabContent tab) { 22 | return BookList(category: tab.id); 23 | }).toList(), 24 | ), 25 | ), 26 | ); 27 | } 28 | } 29 | 30 | class TabContent { 31 | final String id; 32 | final String title; 33 | 34 | const TabContent({this.id, this.title}); 35 | } 36 | 37 | const List tabList = [ 38 | const TabContent(id: 'qdaily', title: '好奇心日报'), 39 | const TabContent(id: 'zhihu', title: '知乎日报'), 40 | const TabContent(id: 'vice', title: 'Vice'), 41 | const TabContent(id: 'ifanr', title: '爱范儿'), 42 | const TabContent(id: 'engadget', title: 'Engadget'), 43 | const TabContent(id: 'ipc', title: 'iPc.me'), 44 | const TabContent(id: 'techcrunch', title: 'TechCrunch'), 45 | const TabContent(id: 'solidot', title: 'Solidot'), 46 | const TabContent(id: 'williamlong', title: '月光博客'), 47 | const TabContent(id: 'toodaylab', title: '理想生活实验室'), 48 | ]; 49 | -------------------------------------------------------------------------------- /lib/ui/book/BookList.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter_gank/models/BookResp.dart'; 5 | import 'package:flutter_gank/ui/comm/LoadingMoreFooter.dart'; 6 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 7 | import 'package:flutter_gank/ui/comm/MyWebview.dart'; 8 | 9 | class BookList extends StatefulWidget { 10 | final String category; 11 | 12 | const BookList({Key key, this.category}) : super(key: key); 13 | @override 14 | _BookListState createState() => _BookListState(); 15 | } 16 | 17 | class _BookListState extends State 18 | with AutomaticKeepAliveClientMixin { 19 | final List data = []; 20 | num currPage = 1; 21 | ScrollController _controller; 22 | 23 | @override 24 | bool get wantKeepAlive => true; 25 | 26 | @override 27 | void initState() { 28 | super.initState(); 29 | _controller = ScrollController() 30 | ..addListener(() { 31 | var maxScroll = _controller.position.maxScrollExtent; 32 | var pixels = _controller.position.pixels; 33 | 34 | if (maxScroll - pixels < 300.0) { 35 | currPage++; 36 | _getData(false); 37 | } 38 | }); 39 | _getData(true); 40 | } 41 | 42 | Future _getData(bool isRefresh) async { 43 | if (isRefresh) { 44 | currPage = 1; 45 | data.clear(); 46 | } 47 | await Dio() 48 | .get( 49 | 'http://gank.io/api/xiandu/data/id/${widget.category}/count/10/page/$currPage') 50 | .then((resp) { 51 | BookResp bookResp = BookResp.fromJson(resp.data); 52 | setState(() { 53 | data.addAll(bookResp.results); 54 | }); 55 | }, onError: () {}); 56 | } 57 | 58 | @override 59 | Widget build(BuildContext context) { 60 | return data.length == 0 61 | ? LoadingPage() 62 | : RefreshIndicator( 63 | onRefresh: () => _getData(true), 64 | child: ListView.builder( 65 | itemCount: 2 * data.length + 1, 66 | itemBuilder: (context, i) { 67 | if (i.isOdd) return Divider(); 68 | if (i == 2 * data.length) return LoadingMoreFooter(); 69 | final index = i ~/ 2; 70 | return _buildRow(data[index]); 71 | }, 72 | controller: _controller, 73 | ), 74 | ); 75 | } 76 | 77 | Widget _buildRow(BookContent content) { 78 | return ListTile( 79 | title: Text(content.title), 80 | leading: ClipOval( 81 | child: SizedBox( 82 | width: 25.0, 83 | height: 25.0, 84 | child: Image.network( 85 | content.site.icon, 86 | fit: BoxFit.cover, 87 | ), 88 | ), 89 | ), 90 | onTap: () => 91 | Navigator.of(context).push(MaterialPageRoute(builder: (context) { 92 | return MyWebview(title: content.title, url: content.url); 93 | })), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/ui/comm/LoadingMoreFooter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_spinkit/flutter_spinkit.dart'; 3 | 4 | class LoadingMoreFooter extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Container( 8 | padding: EdgeInsets.all(8.0), 9 | child: Center( 10 | child: SpinKitThreeBounce( 11 | color: Colors.grey, 12 | size: 25.0, 13 | ), 14 | ), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/ui/comm/LoadingPage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_spinkit/flutter_spinkit.dart'; 3 | 4 | class LoadingPage extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Container( 8 | child: Center( 9 | child: SpinKitWave( 10 | color: Theme.of(context).primaryColor, 11 | ), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/ui/comm/MyDrawer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MyDrawer extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Drawer( 7 | child: Column( 8 | children: [ 9 | UserAccountsDrawerHeader( 10 | accountName: Text('Gank', style: TextStyle(color: Colors.white)), 11 | currentAccountPicture: CircleAvatar( 12 | backgroundImage: NetworkImage( 13 | 'http://thirdwx.qlogo.cn/mmopen/vi_32/jTjqKarzMIpzHibISRqtxKGic430ibXgiaA9rHScQSltqyQjXXtfWWSojWAXxCibnAHYGBiapLJvfrxQFUuDGTwMxZjg/132'), 14 | ), 15 | otherAccountsPictures: [ 16 | GestureDetector( 17 | child: Icon(Icons.settings, color: Colors.white), 18 | onTap: () => Navigator.of(context).pushNamed('/setting'), 19 | ) 20 | ], 21 | decoration: BoxDecoration( 22 | color: Theme.of(context).primaryColor, 23 | // image: DecorationImage( 24 | // fit: BoxFit.cover, 25 | // image: ExactAssetImage('images/lake.jpg'), 26 | // ), 27 | ), 28 | ), 29 | MediaQuery.removePadding( 30 | context: context, 31 | removeTop: true, 32 | child: Expanded( 33 | child: ListView( 34 | children: drawerList.map((item) { 35 | return ListTile( 36 | leading: Icon(item.icon), 37 | title: Text(item.title), 38 | onTap: () { 39 | if (item.route.length > 0) { 40 | Navigator.of(context).pushNamed(item.route); 41 | } 42 | }, 43 | ); 44 | }).toList(), 45 | ), 46 | )), 47 | ], 48 | ), 49 | ); 50 | } 51 | } 52 | 53 | class DrawerMenuItem { 54 | final IconData icon; 55 | final String title; 56 | final String route; 57 | 58 | const DrawerMenuItem(this.icon, this.title, this.route); 59 | } 60 | 61 | const List drawerList = [ 62 | const DrawerMenuItem(Icons.android, 'Android', '/android'), 63 | const DrawerMenuItem(Icons.apps, 'iOS', '/ios'), 64 | const DrawerMenuItem(Icons.code, '前端', '/web'), 65 | const DrawerMenuItem(Icons.photo_camera, '福利', '/welfare'), 66 | const DrawerMenuItem(Icons.video_library, '休息视频', '/video'), 67 | const DrawerMenuItem(Icons.book, '闲读', '/book') 68 | ]; 69 | -------------------------------------------------------------------------------- /lib/ui/comm/MyWebview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; 5 | 6 | class MyWebview extends StatefulWidget { 7 | final String title; 8 | final String url; 9 | 10 | MyWebview({Key key, this.title, this.url}) : super(key: key); 11 | 12 | @override 13 | _MyWebviewState createState() => _MyWebviewState(); 14 | } 15 | 16 | class _MyWebviewState extends State { 17 | bool loading = true; 18 | 19 | final flutterWebViewPlugin = new FlutterWebviewPlugin(); 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | flutterWebViewPlugin.onStateChanged.listen((state) {}); 25 | 26 | flutterWebViewPlugin.onUrlChanged.listen((state) { 27 | setState(() { 28 | loading = false; 29 | }); 30 | }); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | List titleContent = []; 36 | titleContent.add(Text(widget.title, style: TextStyle(color: Colors.white))); 37 | if (loading) titleContent.add(CupertinoActivityIndicator()); 38 | titleContent.add(Container(width: 50.0)); 39 | return WebviewScaffold( 40 | url: widget.url, 41 | appBar: AppBar( 42 | title: Row( 43 | mainAxisAlignment: MainAxisAlignment.center, 44 | children: titleContent), 45 | iconTheme: IconThemeData(color: Colors.white), 46 | ), 47 | withZoom: true, 48 | withLocalStorage: true, 49 | withJavascript: true, 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/ui/ios/Ios.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_gank/models/GankItem.dart'; 6 | import 'package:flutter_gank/models/GankList.dart'; 7 | import 'package:flutter_gank/ui/comm/LoadingMoreFooter.dart'; 8 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 9 | import 'package:flutter_gank/ui/comm/MyWebview.dart'; 10 | 11 | class Ios extends StatefulWidget { 12 | @override 13 | _IosState createState() => _IosState(); 14 | } 15 | 16 | class _IosState extends State { 17 | final List data = []; 18 | num currPage = 1; 19 | ScrollController _controller; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _controller = ScrollController() 25 | ..addListener(() { 26 | var maxScroll = _controller.position.maxScrollExtent; 27 | var pixels = _controller.position.pixels; 28 | if (maxScroll - pixels < 200.0) { 29 | currPage++; 30 | _getData(false); 31 | } 32 | }); 33 | _getData(true); 34 | } 35 | 36 | Future _getData(bool isRefresh) async { 37 | if (isRefresh) { 38 | data.clear(); 39 | currPage = 1; 40 | } 41 | await Dio().get('http://gank.io/api/data/iOS/10/$currPage').then( 42 | (resp) { 43 | GankList gankList = GankList.fromJson(resp.data); 44 | setState(() { 45 | data.addAll(gankList.results); 46 | }); 47 | }, onError: () {}); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | appBar: AppBar( 54 | title: Text('iOS'), 55 | ), 56 | body: data.length == 0 57 | ? LoadingPage() 58 | : RefreshIndicator( 59 | child: ListView.builder( 60 | itemCount: 2 * data.length + 1, 61 | itemBuilder: (context, i) { 62 | if (i.isOdd) return Divider(height: 1.0); 63 | if (i == 2 * data.length) return LoadingMoreFooter(); 64 | final index = i ~/ 2; 65 | return _buildRow(data[index]); 66 | }, 67 | controller: _controller, 68 | ), 69 | onRefresh: () => _getData(true), 70 | ), 71 | ); 72 | } 73 | 74 | Widget _buildRow(GankItem item) { 75 | return ListTile( 76 | title: Text(item.desc), 77 | subtitle: Text(item.who), 78 | onTap: () => 79 | Navigator.of(context).push(MaterialPageRoute(builder: (context) { 80 | return MyWebview(title: item.desc, url: item.url); 81 | })), 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/ui/setting/Setting.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_gank/config/AppOptions.dart'; 3 | 4 | class Setting extends StatelessWidget { 5 | const Setting({Key key, this.appOpt, this.onOptionsChanged}) 6 | : super(key: key); 7 | final AppOptions appOpt; 8 | final ValueChanged onOptionsChanged; 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: Text('Setting'), 14 | ), 15 | body: Container( 16 | padding: EdgeInsets.all(12.0), 17 | child: ListView( 18 | scrollDirection: Axis.vertical, 19 | children: [ 20 | Text('主题设置', 21 | style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), 22 | Container( 23 | margin: EdgeInsets.only(top: 12.0), 24 | child: GridView.count( 25 | shrinkWrap: true, 26 | physics: new NeverScrollableScrollPhysics(), 27 | crossAxisCount: 6, 28 | crossAxisSpacing: 4.0, 29 | mainAxisSpacing: 4.0, 30 | children: colorList.map((item) { 31 | return GestureDetector( 32 | child: Container( 33 | color: item, 34 | ), 35 | onTap: () { 36 | onOptionsChanged(appOpt.copyWith( 37 | appTheme: AppTheme( 38 | ThemeData().copyWith(primaryColor: item)))); 39 | }, 40 | ); 41 | }).toList(), 42 | ), 43 | ), 44 | ], 45 | ), 46 | // child: GridView.count( 47 | // physics: new NeverScrollableScrollPhysics(), 48 | // crossAxisCount: 6, 49 | // crossAxisSpacing: 4.0, 50 | // mainAxisSpacing: 4.0, 51 | // children: colorList.map((item) { 52 | // return GestureDetector( 53 | // child: Container( 54 | // color: item, 55 | // ), 56 | // onTap: () { 57 | // onOptionsChanged(appOpt.copyWith( 58 | // appTheme: 59 | // AppTheme(ThemeData().copyWith(primaryColor: item)))); 60 | // }, 61 | // ); 62 | // }).toList(), 63 | // ), 64 | ), 65 | ); 66 | } 67 | } 68 | 69 | const List colorList = [ 70 | Colors.red, 71 | Colors.pink, 72 | Colors.green, 73 | Colors.teal, 74 | Colors.blue, 75 | Colors.cyan, 76 | Colors.purple, 77 | Colors.yellow, 78 | Colors.lime, 79 | Colors.orange, 80 | Colors.white, 81 | Colors.black, 82 | ]; 83 | -------------------------------------------------------------------------------- /lib/ui/video/VideoPage.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_gank/models/GankItem.dart'; 6 | import 'package:flutter_gank/models/GankList.dart'; 7 | import 'package:flutter_gank/ui/comm/LoadingMoreFooter.dart'; 8 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 9 | import 'package:flutter_gank/ui/comm/MyWebview.dart'; 10 | 11 | class VideoPage extends StatefulWidget { 12 | @override 13 | _VideoPageState createState() => _VideoPageState(); 14 | } 15 | 16 | class _VideoPageState extends State { 17 | final List data = []; 18 | num currPage = 1; 19 | ScrollController _controller; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _controller = ScrollController() 25 | ..addListener(() { 26 | var maxScroll = _controller.position.maxScrollExtent; 27 | var pixels = _controller.position.pixels; 28 | if (maxScroll - pixels < 200.0) { 29 | currPage++; 30 | _getData(false); 31 | } 32 | }); 33 | _getData(true); 34 | } 35 | 36 | Future _getData(bool isRefresh) async { 37 | if (isRefresh) { 38 | data.clear(); 39 | currPage = 1; 40 | } 41 | await Dio().get('http://gank.io/api/data/休息视频/10/$currPage').then( 42 | (resp) { 43 | GankList gankList = GankList.fromJson(resp.data); 44 | setState(() { 45 | data.addAll(gankList.results); 46 | }); 47 | }, onError: () {}); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | appBar: AppBar( 54 | title: Text('休息视频'), 55 | ), 56 | body: data.length == 0 57 | ? LoadingPage() 58 | : RefreshIndicator( 59 | child: ListView.builder( 60 | itemCount: 2 * data.length + 1, 61 | itemBuilder: (context, i) { 62 | if (i.isOdd) return Divider(height: 1.0); 63 | if (i == 2 * data.length) return LoadingMoreFooter(); 64 | final index = i ~/ 2; 65 | return _buildRow(data[index]); 66 | }, 67 | controller: _controller, 68 | ), 69 | onRefresh: () => _getData(true), 70 | ), 71 | ); 72 | } 73 | 74 | Widget _buildRow(GankItem item) { 75 | return ListTile( 76 | title: Text(item.desc), 77 | subtitle: Text(item.who), 78 | onTap: () => 79 | Navigator.of(context).push(MaterialPageRoute(builder: (context) { 80 | return MyWebview(title: item.desc, url: item.url); 81 | })), 82 | ); 83 | } 84 | } -------------------------------------------------------------------------------- /lib/ui/web/Web.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_gank/models/GankItem.dart'; 6 | import 'package:flutter_gank/models/GankList.dart'; 7 | import 'package:flutter_gank/ui/comm/LoadingMoreFooter.dart'; 8 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 9 | import 'package:flutter_gank/ui/comm/MyWebview.dart'; 10 | 11 | class Web extends StatefulWidget { 12 | @override 13 | _WebState createState() => _WebState(); 14 | } 15 | 16 | class _WebState extends State { 17 | final List data = []; 18 | num currPage = 1; 19 | ScrollController _controller; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _controller = ScrollController() 25 | ..addListener(() { 26 | var maxScroll = _controller.position.maxScrollExtent; 27 | var pixels = _controller.position.pixels; 28 | if (maxScroll - pixels < 200.0) { 29 | currPage++; 30 | _getData(false); 31 | } 32 | }); 33 | _getData(true); 34 | } 35 | 36 | Future _getData(bool isRefresh) async { 37 | if (isRefresh) { 38 | data.clear(); 39 | currPage = 1; 40 | } 41 | await Dio().get('http://gank.io/api/data/前端/10/$currPage').then( 42 | (resp) { 43 | GankList gankList = GankList.fromJson(resp.data); 44 | setState(() { 45 | data.addAll(gankList.results); 46 | }); 47 | }, onError: () {}); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | appBar: AppBar( 54 | title: Text('前端'), 55 | ), 56 | body: data.length == 0 57 | ? LoadingPage() 58 | : RefreshIndicator( 59 | child: ListView.builder( 60 | itemCount: 2 * data.length + 1, 61 | itemBuilder: (context, i) { 62 | if (i.isOdd) return Divider(height: 1.0); 63 | if (i == 2 * data.length) return LoadingMoreFooter(); 64 | final index = i ~/ 2; 65 | return _buildRow(data[index]); 66 | }, 67 | controller: _controller, 68 | ), 69 | onRefresh: () => _getData(true), 70 | ), 71 | ); 72 | } 73 | 74 | Widget _buildRow(GankItem item) { 75 | return ListTile( 76 | title: Text(item.desc), 77 | subtitle: Text(item.who), 78 | onTap: () => 79 | Navigator.of(context).push(MaterialPageRoute(builder: (context) { 80 | return MyWebview(title: item.desc, url: item.url); 81 | })), 82 | ); 83 | } 84 | } -------------------------------------------------------------------------------- /lib/ui/welfare/PhotoView.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_gank/models/GankItem.dart'; 3 | 4 | const double _kMinFlingVelocity = 800.0; 5 | 6 | class PhotoView extends StatefulWidget { 7 | const PhotoView({Key key, this.item}) : super(key: key); 8 | 9 | final GankItem item; 10 | @override 11 | _PhotoViewState createState() => _PhotoViewState(); 12 | } 13 | 14 | class _PhotoViewState extends State 15 | with SingleTickerProviderStateMixin { 16 | AnimationController _controller; 17 | Animation _flingAnimation; 18 | Offset _offset = Offset.zero; 19 | double _scale = 1.0; 20 | Offset _normalizedOffset; 21 | double _previousScale; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | _controller = new AnimationController(vsync: this) 27 | ..addListener(_handleFlingAnimation); 28 | } 29 | 30 | @override 31 | void dispose() { 32 | _controller.dispose(); 33 | super.dispose(); 34 | } 35 | 36 | // The maximum offset value is 0,0. If the size of this renderer's box is w,h 37 | // then the minimum offset value is w - _scale * w, h - _scale * h. 38 | Offset _clampOffset(Offset offset) { 39 | final Size size = context.size; 40 | final Offset minOffset = 41 | new Offset(size.width, size.height) * (1.0 - _scale); 42 | return new Offset( 43 | offset.dx.clamp(minOffset.dx, 0.0), offset.dy.clamp(minOffset.dy, 0.0)); 44 | } 45 | 46 | void _handleFlingAnimation() { 47 | setState(() { 48 | _offset = _flingAnimation.value; 49 | }); 50 | } 51 | 52 | void _handleOnScaleStart(ScaleStartDetails details) { 53 | setState(() { 54 | _previousScale = _scale; 55 | _normalizedOffset = (details.focalPoint - _offset) / _scale; 56 | // The fling animation stops if an input gesture starts. 57 | _controller.stop(); 58 | }); 59 | } 60 | 61 | void _handleOnScaleUpdate(ScaleUpdateDetails details) { 62 | setState(() { 63 | _scale = (_previousScale * details.scale).clamp(1.0, 4.0); 64 | // Ensure that image location under the focal point stays in the same place despite scaling. 65 | _offset = _clampOffset(details.focalPoint - _normalizedOffset * _scale); 66 | }); 67 | } 68 | 69 | void _handleOnScaleEnd(ScaleEndDetails details) { 70 | final double magnitude = details.velocity.pixelsPerSecond.distance; 71 | if (magnitude < _kMinFlingVelocity) return; 72 | final Offset direction = details.velocity.pixelsPerSecond / magnitude; 73 | final double distance = (Offset.zero & context.size).shortestSide; 74 | _flingAnimation = new Tween( 75 | begin: _offset, end: _clampOffset(_offset + direction * distance)) 76 | .animate(_controller); 77 | _controller 78 | ..value = 0.0 79 | ..fling(velocity: magnitude / 1000.0); 80 | } 81 | 82 | @override 83 | Widget build(BuildContext context) { 84 | return GestureDetector( 85 | onScaleStart: _handleOnScaleStart, 86 | onScaleUpdate: _handleOnScaleUpdate, 87 | onScaleEnd: _handleOnScaleEnd, 88 | child: ClipRect( 89 | child: Transform( 90 | transform: Matrix4.identity() 91 | ..translate(_offset.dx, _offset.dy) 92 | ..scale(_scale), 93 | child: Image.network( 94 | widget.item.url, 95 | fit: BoxFit.cover, 96 | ), 97 | ), 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/ui/welfare/Welfare.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dio/dio.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_gank/models/GankItem.dart'; 6 | import 'package:flutter_gank/models/GankList.dart'; 7 | import 'package:flutter_gank/ui/comm/LoadingPage.dart'; 8 | import 'package:flutter_gank/ui/welfare/PhotoView.dart'; 9 | 10 | class Welfare extends StatefulWidget { 11 | @override 12 | _WelfareState createState() => _WelfareState(); 13 | } 14 | 15 | class _WelfareState extends State with SingleTickerProviderStateMixin { 16 | final List data = []; 17 | num currPage = 1; 18 | ScrollController _controller; 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | _controller = ScrollController() 24 | ..addListener(() { 25 | var maxScroll = _controller.position.maxScrollExtent; 26 | var pixels = _controller.position.pixels; 27 | 28 | if (maxScroll - pixels < 300.0) { 29 | currPage++; 30 | _getData(false); 31 | } 32 | }); 33 | _getData(true); 34 | } 35 | 36 | Future _getData(bool isRefresh) async { 37 | if (isRefresh) { 38 | data.clear(); 39 | currPage = 1; 40 | } 41 | await Dio().get('http://gank.io/api/data/福利/10/$currPage').then((resp) { 42 | GankList gankList = GankList.fromJson(resp.data); 43 | setState(() { 44 | data.addAll(gankList.results); 45 | }); 46 | }, onError: () {}); 47 | } 48 | 49 | void showPhoto(item) { 50 | Navigator.of(context).push( 51 | MaterialPageRoute( 52 | builder: (context) { 53 | return Scaffold( 54 | appBar: AppBar( 55 | title: Text(item.desc), 56 | ), 57 | body: SizedBox.expand( 58 | child: Hero(tag: item.url, child: PhotoView(item: item)), 59 | ), 60 | ); 61 | }, 62 | ), 63 | ); 64 | } 65 | 66 | @override 67 | Widget build(BuildContext context) { 68 | return Scaffold( 69 | appBar: AppBar( 70 | title: Text('福利'), 71 | ), 72 | body: data.length == 0 73 | ? LoadingPage() 74 | : RefreshIndicator( 75 | child: GridView.count( 76 | padding: EdgeInsets.all(4.0), 77 | crossAxisCount: 2, 78 | mainAxisSpacing: 4.0, 79 | crossAxisSpacing: 4.0, 80 | childAspectRatio: 1.0, 81 | children: data.map((item) { 82 | return GestureDetector( 83 | onTap: () => showPhoto(item), 84 | child: Hero( 85 | key: Key(item.url), 86 | tag: item.url, 87 | child: FadeInImage.assetNetwork( 88 | placeholder: 'images/loading.png', 89 | image: item.url, 90 | fit: BoxFit.cover 91 | ), 92 | // child: Image.network( 93 | // item.url, 94 | // fit: BoxFit.cover, 95 | // ), 96 | ), 97 | ); 98 | }).toList(), 99 | controller: _controller, 100 | ), 101 | onRefresh: () => _getData(true), 102 | ), 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /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.flutter-io.cn" 9 | source: hosted 10 | version: "0.31.2-alpha.2" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.4.3" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.0.7" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.0.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.1" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.14.6" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.0.1" 53 | cookie_jar: 54 | dependency: transitive 55 | description: 56 | name: cookie_jar 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "0.0.4" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "2.0.3" 67 | csslib: 68 | dependency: transitive 69 | description: 70 | name: csslib 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "0.14.4" 74 | cupertino_icons: 75 | dependency: "direct main" 76 | description: 77 | name: cupertino_icons 78 | url: "https://pub.flutter-io.cn" 79 | source: hosted 80 | version: "0.1.2" 81 | dio: 82 | dependency: "direct main" 83 | description: 84 | name: dio 85 | url: "https://pub.flutter-io.cn" 86 | source: hosted 87 | version: "0.1.7" 88 | english_words: 89 | dependency: "direct main" 90 | description: 91 | name: english_words 92 | url: "https://pub.flutter-io.cn" 93 | source: hosted 94 | version: "3.1.0" 95 | flutter: 96 | dependency: "direct main" 97 | description: flutter 98 | source: sdk 99 | version: "0.0.0" 100 | flutter_spinkit: 101 | dependency: "direct main" 102 | description: 103 | name: flutter_spinkit 104 | url: "https://pub.flutter-io.cn" 105 | source: hosted 106 | version: "2.0.0" 107 | flutter_test: 108 | dependency: "direct dev" 109 | description: flutter 110 | source: sdk 111 | version: "0.0.0" 112 | flutter_webview_plugin: 113 | dependency: "direct main" 114 | description: 115 | name: flutter_webview_plugin 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "0.1.6" 119 | front_end: 120 | dependency: transitive 121 | description: 122 | name: front_end 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "0.1.0-alpha.12" 126 | glob: 127 | dependency: transitive 128 | description: 129 | name: glob 130 | url: "https://pub.flutter-io.cn" 131 | source: hosted 132 | version: "1.1.5" 133 | html: 134 | dependency: transitive 135 | description: 136 | name: html 137 | url: "https://pub.flutter-io.cn" 138 | source: hosted 139 | version: "0.13.3" 140 | http: 141 | dependency: transitive 142 | description: 143 | name: http 144 | url: "https://pub.flutter-io.cn" 145 | source: hosted 146 | version: "0.11.3+16" 147 | http_multi_server: 148 | dependency: transitive 149 | description: 150 | name: http_multi_server 151 | url: "https://pub.flutter-io.cn" 152 | source: hosted 153 | version: "2.0.4" 154 | http_parser: 155 | dependency: transitive 156 | description: 157 | name: http_parser 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "3.1.2" 161 | io: 162 | dependency: transitive 163 | description: 164 | name: io 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "0.3.2+1" 168 | js: 169 | dependency: transitive 170 | description: 171 | name: js 172 | url: "https://pub.flutter-io.cn" 173 | source: hosted 174 | version: "0.6.1" 175 | kernel: 176 | dependency: transitive 177 | description: 178 | name: kernel 179 | url: "https://pub.flutter-io.cn" 180 | source: hosted 181 | version: "0.3.0-alpha.12" 182 | logging: 183 | dependency: transitive 184 | description: 185 | name: logging 186 | url: "https://pub.flutter-io.cn" 187 | source: hosted 188 | version: "0.11.3+1" 189 | matcher: 190 | dependency: transitive 191 | description: 192 | name: matcher 193 | url: "https://pub.flutter-io.cn" 194 | source: hosted 195 | version: "0.12.2+1" 196 | meta: 197 | dependency: transitive 198 | description: 199 | name: meta 200 | url: "https://pub.flutter-io.cn" 201 | source: hosted 202 | version: "1.1.5" 203 | mime: 204 | dependency: transitive 205 | description: 206 | name: mime 207 | url: "https://pub.flutter-io.cn" 208 | source: hosted 209 | version: "0.9.6" 210 | multi_server_socket: 211 | dependency: transitive 212 | description: 213 | name: multi_server_socket 214 | url: "https://pub.flutter-io.cn" 215 | source: hosted 216 | version: "1.0.1" 217 | node_preamble: 218 | dependency: transitive 219 | description: 220 | name: node_preamble 221 | url: "https://pub.flutter-io.cn" 222 | source: hosted 223 | version: "1.4.1" 224 | package_config: 225 | dependency: transitive 226 | description: 227 | name: package_config 228 | url: "https://pub.flutter-io.cn" 229 | source: hosted 230 | version: "1.0.3" 231 | package_resolver: 232 | dependency: transitive 233 | description: 234 | name: package_resolver 235 | url: "https://pub.flutter-io.cn" 236 | source: hosted 237 | version: "1.0.2" 238 | path: 239 | dependency: transitive 240 | description: 241 | name: path 242 | url: "https://pub.flutter-io.cn" 243 | source: hosted 244 | version: "1.5.1" 245 | plugin: 246 | dependency: transitive 247 | description: 248 | name: plugin 249 | url: "https://pub.flutter-io.cn" 250 | source: hosted 251 | version: "0.2.0+2" 252 | pool: 253 | dependency: transitive 254 | description: 255 | name: pool 256 | url: "https://pub.flutter-io.cn" 257 | source: hosted 258 | version: "1.3.4" 259 | pub_semver: 260 | dependency: transitive 261 | description: 262 | name: pub_semver 263 | url: "https://pub.flutter-io.cn" 264 | source: hosted 265 | version: "1.4.1" 266 | quiver: 267 | dependency: transitive 268 | description: 269 | name: quiver 270 | url: "https://pub.flutter-io.cn" 271 | source: hosted 272 | version: "0.29.0+1" 273 | shelf: 274 | dependency: transitive 275 | description: 276 | name: shelf 277 | url: "https://pub.flutter-io.cn" 278 | source: hosted 279 | version: "0.7.3" 280 | shelf_packages_handler: 281 | dependency: transitive 282 | description: 283 | name: shelf_packages_handler 284 | url: "https://pub.flutter-io.cn" 285 | source: hosted 286 | version: "1.0.3" 287 | shelf_static: 288 | dependency: transitive 289 | description: 290 | name: shelf_static 291 | url: "https://pub.flutter-io.cn" 292 | source: hosted 293 | version: "0.2.7" 294 | shelf_web_socket: 295 | dependency: transitive 296 | description: 297 | name: shelf_web_socket 298 | url: "https://pub.flutter-io.cn" 299 | source: hosted 300 | version: "0.2.2" 301 | sky_engine: 302 | dependency: transitive 303 | description: flutter 304 | source: sdk 305 | version: "0.0.99" 306 | source_map_stack_trace: 307 | dependency: transitive 308 | description: 309 | name: source_map_stack_trace 310 | url: "https://pub.flutter-io.cn" 311 | source: hosted 312 | version: "1.1.4" 313 | source_maps: 314 | dependency: transitive 315 | description: 316 | name: source_maps 317 | url: "https://pub.flutter-io.cn" 318 | source: hosted 319 | version: "0.10.5" 320 | source_span: 321 | dependency: transitive 322 | description: 323 | name: source_span 324 | url: "https://pub.flutter-io.cn" 325 | source: hosted 326 | version: "1.4.0" 327 | stack_trace: 328 | dependency: transitive 329 | description: 330 | name: stack_trace 331 | url: "https://pub.flutter-io.cn" 332 | source: hosted 333 | version: "1.9.2" 334 | stream_channel: 335 | dependency: transitive 336 | description: 337 | name: stream_channel 338 | url: "https://pub.flutter-io.cn" 339 | source: hosted 340 | version: "1.6.6" 341 | string_scanner: 342 | dependency: transitive 343 | description: 344 | name: string_scanner 345 | url: "https://pub.flutter-io.cn" 346 | source: hosted 347 | version: "1.0.2" 348 | term_glyph: 349 | dependency: transitive 350 | description: 351 | name: term_glyph 352 | url: "https://pub.flutter-io.cn" 353 | source: hosted 354 | version: "1.0.0" 355 | test: 356 | dependency: transitive 357 | description: 358 | name: test 359 | url: "https://pub.flutter-io.cn" 360 | source: hosted 361 | version: "0.12.37" 362 | typed_data: 363 | dependency: transitive 364 | description: 365 | name: typed_data 366 | url: "https://pub.flutter-io.cn" 367 | source: hosted 368 | version: "1.1.5" 369 | utf: 370 | dependency: transitive 371 | description: 372 | name: utf 373 | url: "https://pub.flutter-io.cn" 374 | source: hosted 375 | version: "0.9.0+4" 376 | vector_math: 377 | dependency: transitive 378 | description: 379 | name: vector_math 380 | url: "https://pub.flutter-io.cn" 381 | source: hosted 382 | version: "2.0.6" 383 | watcher: 384 | dependency: transitive 385 | description: 386 | name: watcher 387 | url: "https://pub.flutter-io.cn" 388 | source: hosted 389 | version: "0.9.7+7" 390 | web_socket_channel: 391 | dependency: transitive 392 | description: 393 | name: web_socket_channel 394 | url: "https://pub.flutter-io.cn" 395 | source: hosted 396 | version: "1.0.7" 397 | yaml: 398 | dependency: transitive 399 | description: 400 | name: yaml 401 | url: "https://pub.flutter-io.cn" 402 | source: hosted 403 | version: "2.1.13" 404 | sdks: 405 | dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.58.0.flutter-f981f09760" 406 | flutter: ">=0.1.4 <2.0.0" 407 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_gank 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 | english_words: ^3.1.0 12 | dio: ^0.1.7 13 | flutter_webview_plugin: ^0.1.6 14 | flutter_spinkit: "^2.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 | assets: 37 | - images/lake.jpg 38 | - images/gank.png 39 | - images/loading.png 40 | 41 | # An image asset can refer to one or more resolution-specific "variants", see 42 | # https://flutter.io/assets-and-images/#resolution-aware. 43 | 44 | # For details regarding adding assets from package dependencies, see 45 | # https://flutter.io/assets-and-images/#from-packages 46 | 47 | # To add custom fonts to your application, add a fonts section here, 48 | # in this "flutter" section. Each entry in this list should have a 49 | # "family" key with the font family name, and a "fonts" key with a 50 | # list giving the asset and other descriptors for the font. For 51 | # example: 52 | # fonts: 53 | # - family: Schyler 54 | # fonts: 55 | # - asset: fonts/Schyler-Regular.ttf 56 | # - asset: fonts/Schyler-Italic.ttf 57 | # style: italic 58 | # - family: Trajan Pro 59 | # fonts: 60 | # - asset: fonts/TrajanPro.ttf 61 | # - asset: fonts/TrajanPro_Bold.ttf 62 | # weight: 700 63 | # 64 | # For details regarding fonts from package dependencies, 65 | # see https://flutter.io/custom-fonts/#from-packages 66 | -------------------------------------------------------------------------------- /readmeImage/115567431967967707.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/readmeImage/115567431967967707.png -------------------------------------------------------------------------------- /readmeImage/195713837319785555.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/readmeImage/195713837319785555.png -------------------------------------------------------------------------------- /readmeImage/420295395223380047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/readmeImage/420295395223380047.png -------------------------------------------------------------------------------- /readmeImage/664096358807009630.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknan520/flutter_gank/69ff8f12873ca1b025cdc115a35051f61852da36/readmeImage/664096358807009630.png -------------------------------------------------------------------------------- /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:flutter_gank/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 | --------------------------------------------------------------------------------