├── .gitignore ├── README.md ├── android.iml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ └── com │ │ │ └── lee │ │ │ └── wanandroid │ │ │ └── flutterwanandroid │ │ │ └── MainActivity.kt │ │ └── 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_wan_android.iml ├── flutter_wan_android_android.iml ├── imgs ├── detail.webp ├── drawer.webp ├── favor.webp ├── login.webp ├── recommend.webp ├── search.webp ├── series.webp └── series_list.webp ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── about_author.dart ├── adapter │ ├── base_adapter.dart │ ├── feed_item_adapter.dart │ └── website_item_adapter.dart ├── cache.dart ├── collect_list.dart ├── drawer.dart ├── feed_list.dart ├── login_page.dart ├── main.dart ├── net │ └── wan_android_api.dart ├── post_detail.dart ├── presenter │ ├── base_presenter.dart │ ├── collect_post_presenter.dart │ ├── collect_website_presenter.dart │ ├── feeds_presenter.dart │ ├── response_data.dart │ ├── search_presenter.dart │ └── sub_types_presenter.dart ├── search_page.dart ├── tabbed_post_by_type.dart ├── text_link_span.dart └── type_list.dart ├── pubspec.yaml └── test ├── api_test.dart └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .vscode/ 5 | .packages 6 | .pub/ 7 | build/ 8 | ios/.generated/ 9 | packages 10 | pubspec.lock 11 | .flutter-plugins 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_wan_android 2 | 3 | [wanandroid](http://www.wanandroid.com) app use flutter 4 | 5 | # new 6 | 7 | 升级到 Dart2 8 | 9 | ## Getting Started 10 | 11 | Flutter 是 google 的一个跨平台移动开发框架,目前支持`IOS`, `Android` 12 | 13 | install: `flutter packages get` 14 | 15 | For help getting started with Flutter, view our online 16 | [documentation](http://flutter.io/). 17 | 18 | 由于时间有限,只实现了部分功能,项目结构比较混乱,主要是熟悉一下`Flutter`的`api` 19 | 20 | ### 截图(ios simulator) 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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 plugin: 'kotlin-android' 16 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 17 | 18 | android { 19 | compileSdkVersion 27 20 | 21 | sourceSets { 22 | main.java.srcDirs += 'src/main/kotlin' 23 | } 24 | 25 | lintOptions { 26 | disable 'InvalidPackage' 27 | } 28 | 29 | defaultConfig { 30 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 31 | applicationId "com.lee.wanandroid.flutterwanandroid" 32 | minSdkVersion 16 33 | targetSdkVersion 27 34 | versionCode 1 35 | versionName "1.0" 36 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 37 | } 38 | 39 | buildTypes { 40 | release { 41 | // TODO: Add your own signing config for the release build. 42 | // Signing with the debug keys for now, so `flutter run --release` works. 43 | signingConfig signingConfigs.debug 44 | } 45 | } 46 | } 47 | 48 | flutter { 49 | source '../..' 50 | } 51 | 52 | dependencies { 53 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 54 | testImplementation 'junit:junit:4.12' 55 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 56 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 57 | } 58 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/lee/wanandroid/flutterwanandroid/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.lee.wanandroid.flutterwanandroid 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity(): FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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 | ext.kotlin_version = '1.1.51' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.0.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /flutter_wan_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_wan_android_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /imgs/detail.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/detail.webp -------------------------------------------------------------------------------- /imgs/drawer.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/drawer.webp -------------------------------------------------------------------------------- /imgs/favor.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/favor.webp -------------------------------------------------------------------------------- /imgs/login.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/login.webp -------------------------------------------------------------------------------- /imgs/recommend.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/recommend.webp -------------------------------------------------------------------------------- /imgs/search.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/search.webp -------------------------------------------------------------------------------- /imgs/series.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/series.webp -------------------------------------------------------------------------------- /imgs/series_list.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/imgs/series_list.webp -------------------------------------------------------------------------------- /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 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/flutter_assets/ 37 | /Flutter/App.framework 38 | /Flutter/Flutter.framework 39 | /Flutter/Generated.xcconfig 40 | /ServiceDefinitions.json 41 | 42 | Pods/ 43 | -------------------------------------------------------------------------------- /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 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | def parse_KV_file(file,seperator='=') 8 | file_abs_path = File.expand_path(file) 9 | if !File.exists? file_abs_path 10 | return []; 11 | end 12 | pods_ary = [] 13 | skip_line_start_symbols = ["#", "/"] 14 | File.foreach(file_abs_path) { |line| 15 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 16 | plugin = line.split(pattern=seperator) 17 | if plugin.length == 2 18 | podname = plugin[0].strip() 19 | path = plugin[1].strip() 20 | podpath = File.expand_path("#{path}", file_abs_path) 21 | pods_ary.push({:name => podname,:path=>podpath}); 22 | else 23 | puts "Invalid plugin specification: #{line}" 24 | end 25 | } 26 | return pods_ary 27 | end 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | # Flutter Pods 32 | generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig") 33 | if generated_xcode_build_settings.empty? 34 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first." 35 | end 36 | generated_xcode_build_settings.map{ |p| 37 | if p[:name]=='FLUTTER_FRAMEWORK_DIR' 38 | pod 'Flutter', :path => p[:path] 39 | end 40 | } 41 | 42 | # Plugin Pods 43 | plugin_pods = parse_KV_file("../.flutter-plugins") 44 | plugin_pods.map{ |p| 45 | pod p[:name], :path => File.expand_path("ios",p[:path]) 46 | } 47 | end 48 | 49 | post_install do |installer| 50 | installer.pods_project.targets.each do |target| 51 | target.build_configurations.each do |config| 52 | config.build_settings['ENABLE_BITCODE'] = 'NO' 53 | end 54 | end 55 | end -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_web_view (0.0.1): 4 | - Flutter 5 | - flutter_webview_plugin (0.0.1): 6 | - Flutter 7 | - shared_preferences (0.0.1): 8 | - Flutter 9 | - url_launcher (0.0.1): 10 | - Flutter 11 | 12 | DEPENDENCIES: 13 | - Flutter (from `/Users/leeo/Develop/github/flutter/bin/cache/artifacts/engine/ios`) 14 | - flutter_web_view (from `/Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/flutter_web_view-0.0.2/ios`) 15 | - flutter_webview_plugin (from `/Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/flutter_webview_plugin-0.1.0+1/ios`) 16 | - shared_preferences (from `/Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.2.5/ios`) 17 | - url_launcher (from `/Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-2.0.1/ios`) 18 | 19 | EXTERNAL SOURCES: 20 | Flutter: 21 | :path: /Users/leeo/Develop/github/flutter/bin/cache/artifacts/engine/ios 22 | flutter_web_view: 23 | :path: /Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/flutter_web_view-0.0.2/ios 24 | flutter_webview_plugin: 25 | :path: /Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/flutter_webview_plugin-0.1.0+1/ios 26 | shared_preferences: 27 | :path: /Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.2.5/ios 28 | url_launcher: 29 | :path: /Users/leeo/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-2.0.1/ios 30 | 31 | SPEC CHECKSUMS: 32 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 33 | flutter_web_view: 95e784768166c40b99e0801adff6ccc798bde237 34 | flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694 35 | shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523 36 | url_launcher: 0067ddb8f10d36786672aa0722a21717dba3a298 37 | 38 | PODFILE CHECKSUM: 58e7140e8d177014d15256865f8b852f3a6fa6b4 39 | 40 | COCOAPODS: 1.3.1 41 | -------------------------------------------------------------------------------- /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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 19 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 23 | A8A7B23A8D385A815D1C2759 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EE7CCF546F4125B76411AB5 /* Pods_Runner.framework */; }; 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 | 0EE7CCF546F4125B76411AB5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 44 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 45 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 46 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 47 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 48 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 49 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 50 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 51 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 52 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 53 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 54 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 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 | A8A7B23A8D385A815D1C2759 /* Pods_Runner.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | /* End PBXFrameworksBuildPhase section */ 73 | 74 | /* Begin PBXGroup section */ 75 | 4B2962AF79139252A699F397 /* Frameworks */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 0EE7CCF546F4125B76411AB5 /* Pods_Runner.framework */, 79 | ); 80 | name = Frameworks; 81 | sourceTree = ""; 82 | }; 83 | 9740EEB11CF90186004384FC /* Flutter */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 87 | 3B80C3931E831B6300D905FE /* App.framework */, 88 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 89 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 90 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 91 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 92 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 93 | ); 94 | name = Flutter; 95 | sourceTree = ""; 96 | }; 97 | 97C146E51CF9000F007C117D = { 98 | isa = PBXGroup; 99 | children = ( 100 | 9740EEB11CF90186004384FC /* Flutter */, 101 | 97C146F01CF9000F007C117D /* Runner */, 102 | 97C146EF1CF9000F007C117D /* Products */, 103 | BB04C540AA41F51417C9FCF7 /* Pods */, 104 | 4B2962AF79139252A699F397 /* Frameworks */, 105 | ); 106 | sourceTree = ""; 107 | }; 108 | 97C146EF1CF9000F007C117D /* Products */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 97C146EE1CF9000F007C117D /* Runner.app */, 112 | ); 113 | name = Products; 114 | sourceTree = ""; 115 | }; 116 | 97C146F01CF9000F007C117D /* Runner */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 120 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 121 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 122 | 97C147021CF9000F007C117D /* Info.plist */, 123 | 97C146F11CF9000F007C117D /* Supporting Files */, 124 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 125 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 126 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 127 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 128 | ); 129 | path = Runner; 130 | sourceTree = ""; 131 | }; 132 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | ); 136 | name = "Supporting Files"; 137 | sourceTree = ""; 138 | }; 139 | BB04C540AA41F51417C9FCF7 /* Pods */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | ); 143 | name = Pods; 144 | sourceTree = ""; 145 | }; 146 | /* End PBXGroup section */ 147 | 148 | /* Begin PBXNativeTarget section */ 149 | 97C146ED1CF9000F007C117D /* Runner */ = { 150 | isa = PBXNativeTarget; 151 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 152 | buildPhases = ( 153 | E6BFCFB36D15D687C083D4FF /* [CP] Check Pods Manifest.lock */, 154 | 9740EEB61CF901F6004384FC /* Run Script */, 155 | 97C146EA1CF9000F007C117D /* Sources */, 156 | 97C146EB1CF9000F007C117D /* Frameworks */, 157 | 97C146EC1CF9000F007C117D /* Resources */, 158 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 159 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 160 | 7822A3165C6E753EDDE37ECC /* [CP] Embed Pods Frameworks */, 161 | F6DB8EE7B3CF9398189EA19C /* [CP] Copy Pods Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | ); 167 | name = Runner; 168 | productName = Runner; 169 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 170 | productType = "com.apple.product-type.application"; 171 | }; 172 | /* End PBXNativeTarget section */ 173 | 174 | /* Begin PBXProject section */ 175 | 97C146E61CF9000F007C117D /* Project object */ = { 176 | isa = PBXProject; 177 | attributes = { 178 | LastUpgradeCheck = 0910; 179 | ORGANIZATIONNAME = "The Chromium Authors"; 180 | TargetAttributes = { 181 | 97C146ED1CF9000F007C117D = { 182 | CreatedOnToolsVersion = 7.3.1; 183 | LastSwiftMigration = 0910; 184 | }; 185 | }; 186 | }; 187 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 188 | compatibilityVersion = "Xcode 3.2"; 189 | developmentRegion = English; 190 | hasScannedForEncodings = 0; 191 | knownRegions = ( 192 | en, 193 | Base, 194 | ); 195 | mainGroup = 97C146E51CF9000F007C117D; 196 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 197 | projectDirPath = ""; 198 | projectRoot = ""; 199 | targets = ( 200 | 97C146ED1CF9000F007C117D /* Runner */, 201 | ); 202 | }; 203 | /* End PBXProject section */ 204 | 205 | /* Begin PBXResourcesBuildPhase section */ 206 | 97C146EC1CF9000F007C117D /* Resources */ = { 207 | isa = PBXResourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 211 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 212 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 213 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 214 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 215 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 216 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXShellScriptBuildPhase section */ 223 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputPaths = ( 229 | ); 230 | name = "Thin Binary"; 231 | outputPaths = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | shellPath = /bin/sh; 235 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 236 | }; 237 | 7822A3165C6E753EDDE37ECC /* [CP] Embed Pods Frameworks */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputPaths = ( 243 | "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 244 | "${PODS_ROOT}/../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework", 245 | "${BUILT_PRODUCTS_DIR}/flutter_web_view/flutter_web_view.framework", 246 | "${BUILT_PRODUCTS_DIR}/flutter_webview_plugin/flutter_webview_plugin.framework", 247 | "${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework", 248 | "${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework", 249 | ); 250 | name = "[CP] Embed Pods Frameworks"; 251 | outputPaths = ( 252 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 253 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_web_view.framework", 254 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_webview_plugin.framework", 255 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework", 256 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework", 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | shellPath = /bin/sh; 260 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 261 | showEnvVarsInLog = 0; 262 | }; 263 | 9740EEB61CF901F6004384FC /* Run Script */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputPaths = ( 269 | ); 270 | name = "Run Script"; 271 | outputPaths = ( 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 276 | }; 277 | E6BFCFB36D15D687C083D4FF /* [CP] Check Pods Manifest.lock */ = { 278 | isa = PBXShellScriptBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | inputPaths = ( 283 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 284 | "${PODS_ROOT}/Manifest.lock", 285 | ); 286 | name = "[CP] Check Pods Manifest.lock"; 287 | outputPaths = ( 288 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | shellPath = /bin/sh; 292 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 293 | showEnvVarsInLog = 0; 294 | }; 295 | F6DB8EE7B3CF9398189EA19C /* [CP] Copy Pods Resources */ = { 296 | isa = PBXShellScriptBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputPaths = ( 301 | ); 302 | name = "[CP] Copy Pods Resources"; 303 | outputPaths = ( 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | /* End PBXShellScriptBuildPhase section */ 311 | 312 | /* Begin PBXSourcesBuildPhase section */ 313 | 97C146EA1CF9000F007C117D /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 318 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | }; 322 | /* End PBXSourcesBuildPhase section */ 323 | 324 | /* Begin PBXVariantGroup section */ 325 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 97C146FB1CF9000F007C117D /* Base */, 329 | ); 330 | name = Main.storyboard; 331 | sourceTree = ""; 332 | }; 333 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 334 | isa = PBXVariantGroup; 335 | children = ( 336 | 97C147001CF9000F007C117D /* Base */, 337 | ); 338 | name = LaunchScreen.storyboard; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXVariantGroup section */ 342 | 343 | /* Begin XCBuildConfiguration section */ 344 | 97C147031CF9000F007C117D /* Debug */ = { 345 | isa = XCBuildConfiguration; 346 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 347 | buildSettings = { 348 | ALWAYS_SEARCH_USER_PATHS = NO; 349 | CLANG_ANALYZER_NONNULL = YES; 350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 351 | CLANG_CXX_LIBRARY = "libc++"; 352 | CLANG_ENABLE_MODULES = YES; 353 | CLANG_ENABLE_OBJC_ARC = YES; 354 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 355 | CLANG_WARN_BOOL_CONVERSION = YES; 356 | CLANG_WARN_COMMA = YES; 357 | CLANG_WARN_CONSTANT_CONVERSION = YES; 358 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INFINITE_RECURSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 364 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 365 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 366 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 367 | CLANG_WARN_STRICT_PROTOTYPES = YES; 368 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 369 | CLANG_WARN_UNREACHABLE_CODE = YES; 370 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 371 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 372 | COPY_PHASE_STRIP = NO; 373 | DEBUG_INFORMATION_FORMAT = dwarf; 374 | ENABLE_STRICT_OBJC_MSGSEND = YES; 375 | ENABLE_TESTABILITY = YES; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_DYNAMIC_NO_PIC = NO; 378 | GCC_NO_COMMON_BLOCKS = YES; 379 | GCC_OPTIMIZATION_LEVEL = 0; 380 | GCC_PREPROCESSOR_DEFINITIONS = ( 381 | "DEBUG=1", 382 | "$(inherited)", 383 | ); 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 391 | MTL_ENABLE_DEBUG_INFO = YES; 392 | ONLY_ACTIVE_ARCH = YES; 393 | SDKROOT = iphoneos; 394 | TARGETED_DEVICE_FAMILY = "1,2"; 395 | }; 396 | name = Debug; 397 | }; 398 | 97C147041CF9000F007C117D /* Release */ = { 399 | isa = XCBuildConfiguration; 400 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 401 | buildSettings = { 402 | ALWAYS_SEARCH_USER_PATHS = NO; 403 | CLANG_ANALYZER_NONNULL = YES; 404 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 405 | CLANG_CXX_LIBRARY = "libc++"; 406 | CLANG_ENABLE_MODULES = YES; 407 | CLANG_ENABLE_OBJC_ARC = YES; 408 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 409 | CLANG_WARN_BOOL_CONVERSION = YES; 410 | CLANG_WARN_COMMA = YES; 411 | CLANG_WARN_CONSTANT_CONVERSION = YES; 412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 413 | CLANG_WARN_EMPTY_BODY = YES; 414 | CLANG_WARN_ENUM_CONVERSION = YES; 415 | CLANG_WARN_INFINITE_RECURSION = YES; 416 | CLANG_WARN_INT_CONVERSION = YES; 417 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 418 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 419 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 420 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 421 | CLANG_WARN_STRICT_PROTOTYPES = YES; 422 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 423 | CLANG_WARN_UNREACHABLE_CODE = YES; 424 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 425 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 426 | COPY_PHASE_STRIP = NO; 427 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 428 | ENABLE_NS_ASSERTIONS = NO; 429 | ENABLE_STRICT_OBJC_MSGSEND = YES; 430 | GCC_C_LANGUAGE_STANDARD = gnu99; 431 | GCC_NO_COMMON_BLOCKS = YES; 432 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 433 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 434 | GCC_WARN_UNDECLARED_SELECTOR = YES; 435 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 436 | GCC_WARN_UNUSED_FUNCTION = YES; 437 | GCC_WARN_UNUSED_VARIABLE = YES; 438 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 439 | MTL_ENABLE_DEBUG_INFO = NO; 440 | SDKROOT = iphoneos; 441 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 442 | TARGETED_DEVICE_FAMILY = "1,2"; 443 | VALIDATE_PRODUCT = YES; 444 | }; 445 | name = Release; 446 | }; 447 | 97C147061CF9000F007C117D /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 450 | buildSettings = { 451 | ARCHS = arm64; 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | CLANG_ENABLE_MODULES = YES; 454 | ENABLE_BITCODE = NO; 455 | FRAMEWORK_SEARCH_PATHS = ( 456 | "$(inherited)", 457 | "$(PROJECT_DIR)/Flutter", 458 | ); 459 | INFOPLIST_FILE = Runner/Info.plist; 460 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 461 | LIBRARY_SEARCH_PATHS = ( 462 | "$(inherited)", 463 | "$(PROJECT_DIR)/Flutter", 464 | ); 465 | PRODUCT_BUNDLE_IDENTIFIER = com.lee.wanandroid.flutterWanAndroid; 466 | PRODUCT_NAME = "$(TARGET_NAME)"; 467 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 468 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 469 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 470 | SWIFT_VERSION = 4.0; 471 | }; 472 | name = Debug; 473 | }; 474 | 97C147071CF9000F007C117D /* Release */ = { 475 | isa = XCBuildConfiguration; 476 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 477 | buildSettings = { 478 | ARCHS = arm64; 479 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 480 | CLANG_ENABLE_MODULES = YES; 481 | ENABLE_BITCODE = NO; 482 | FRAMEWORK_SEARCH_PATHS = ( 483 | "$(inherited)", 484 | "$(PROJECT_DIR)/Flutter", 485 | ); 486 | INFOPLIST_FILE = Runner/Info.plist; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 488 | LIBRARY_SEARCH_PATHS = ( 489 | "$(inherited)", 490 | "$(PROJECT_DIR)/Flutter", 491 | ); 492 | PRODUCT_BUNDLE_IDENTIFIER = com.lee.wanandroid.flutterWanAndroid; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 495 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 496 | SWIFT_VERSION = 4.0; 497 | }; 498 | name = Release; 499 | }; 500 | /* End XCBuildConfiguration section */ 501 | 502 | /* Begin XCConfigurationList section */ 503 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 504 | isa = XCConfigurationList; 505 | buildConfigurations = ( 506 | 97C147031CF9000F007C117D /* Debug */, 507 | 97C147041CF9000F007C117D /* Release */, 508 | ); 509 | defaultConfigurationIsVisible = 0; 510 | defaultConfigurationName = Release; 511 | }; 512 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 513 | isa = XCConfigurationList; 514 | buildConfigurations = ( 515 | 97C147061CF9000F007C117D /* Debug */, 516 | 97C147071CF9000F007C117D /* Release */, 517 | ); 518 | defaultConfigurationIsVisible = 0; 519 | defaultConfigurationName = Release; 520 | }; 521 | /* End XCConfigurationList section */ 522 | }; 523 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 524 | } 525 | -------------------------------------------------------------------------------- /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 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yonkers/flutter_wan_android/68fb5fb21cb13803dfac22c06e1b1e41e9bbef25/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_wan_android 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 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/about_author.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'text_link_span.dart'; 3 | 4 | class AboutAuthor extends StatelessWidget{ 5 | @override 6 | Widget build(BuildContext context) { 7 | final ThemeData themeData = Theme.of(context); 8 | final TextStyle aboutTextStyle = themeData.textTheme.body2; 9 | final TextStyle linkStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor); 10 | 11 | 12 | return new Scaffold( 13 | appBar: new AppBar( 14 | title: new Text("关于我"), 15 | ), 16 | body: new Container( 17 | padding: const EdgeInsets.all(10.0), 18 | child: new Card( 19 | child: new Padding( 20 | padding: const EdgeInsets.all(20.0), 21 | child: new Column( 22 | mainAxisSize: MainAxisSize.min, 23 | crossAxisAlignment: CrossAxisAlignment.stretch, 24 | children: [ 25 | new Text("leeoLuo", textScaleFactor: 1.5, textAlign: TextAlign.center,), 26 | new RichText( 27 | textAlign: TextAlign.center, 28 | text: new TextSpan(children: [ 29 | new TextSpan(style:aboutTextStyle, text: "\n\n小小的一枚Android开发\n\n"), 30 | new TextSpan(style:aboutTextStyle, text: "Blog: "), 31 | new LinkTextSpan(style: linkStyle, url: "http://www.leeo.xin") 32 | ])) 33 | ], 34 | ), 35 | ), 36 | ), 37 | ), 38 | ); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /lib/adapter/base_adapter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | abstract class BaseAdapter { 4 | Widget getItemView(BuildContext context, Map item); 5 | } 6 | -------------------------------------------------------------------------------- /lib/adapter/feed_item_adapter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wan_android/post_detail.dart'; 3 | import 'base_adapter.dart'; 4 | 5 | class FeedItemAdapter extends BaseAdapter { 6 | FeedItemAdapter(); 7 | 8 | @override 9 | Widget getItemView(BuildContext context, Map item) { 10 | return new ListTile( 11 | leading: new CircleAvatar( 12 | child: new Text(item['title'].toString().substring(0, 1)), 13 | ), 14 | title: new Text(item['title'], style: new TextStyle(fontSize: 16.0)), 15 | subtitle: new Text("${item['chapterName']} ${item['author']}"), 16 | dense: true, 17 | isThreeLine: true, 18 | onTap: () { 19 | Navigator.push(context, 20 | new MaterialPageRoute(builder: (BuildContext context) { 21 | return new PostDetailPage(item); 22 | })); 23 | }, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/adapter/website_item_adapter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_wan_android/post_detail.dart'; 3 | import 'base_adapter.dart'; 4 | 5 | class WebsiteItemAdapter extends BaseAdapter { 6 | WebsiteItemAdapter(); 7 | 8 | @override 9 | Widget getItemView(BuildContext context, Map item) { 10 | return new ListTile( 11 | leading: new CircleAvatar( 12 | child: new Text(item['name'].toString().substring(0, 1)), 13 | ), 14 | title: new Text(item['name'], style: new TextStyle(fontSize: 18.0)), 15 | dense: true, 16 | isThreeLine: false, 17 | onTap: () { 18 | Navigator.push(context, 19 | new MaterialPageRoute(builder: (BuildContext context) { 20 | return new PostDetailPage(item); 21 | })); 22 | }, 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/cache.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | import 'dart:async'; 3 | import 'dart:convert'; 4 | 5 | Future getUserInfo() async { 6 | SharedPreferences prefs = await SharedPreferences.getInstance(); 7 | String loginCookie = prefs.getString("loginCookie"); 8 | if (null != loginCookie) { 9 | return json.decode(loginCookie); 10 | } 11 | return null; 12 | } 13 | 14 | Future getCookie() async { 15 | SharedPreferences prefs = await SharedPreferences.getInstance(); 16 | String loginCookie = prefs.getString("set-cookie"); 17 | return loginCookie; 18 | } 19 | -------------------------------------------------------------------------------- /lib/collect_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'feed_list.dart'; 3 | import 'presenter/collect_post_presenter.dart'; 4 | import 'presenter/collect_website_presenter.dart'; 5 | import 'adapter/website_item_adapter.dart'; 6 | import 'adapter/feed_item_adapter.dart'; 7 | 8 | class CollectType{ 9 | String name; 10 | String code; 11 | 12 | CollectType(this.name, this.code); 13 | 14 | } 15 | 16 | class CollectListPage extends StatefulWidget{ 17 | 18 | final List collectTypes = [ 19 | new CollectType('收藏文章',"post-collect" ), 20 | new CollectType('收藏网站', "website-collect") 21 | ]; 22 | 23 | CollectListPage(); 24 | 25 | @override 26 | State createState() => new _CollectListState(); 27 | 28 | } 29 | 30 | class _CollectListState extends State{ 31 | @override 32 | Widget build(BuildContext context) { 33 | return new MaterialApp( 34 | home: new DefaultTabController( 35 | length: widget.collectTypes.length, 36 | child: new Scaffold( 37 | appBar: new AppBar( 38 | leading: new IconButton( 39 | tooltip: 'back', 40 | icon: const Icon(Icons.arrow_back), 41 | onPressed: () { Navigator.of(this.context).pop(); }, 42 | ), 43 | title: new Text('我的收藏'), 44 | bottom: new TabBar( 45 | isScrollable: true, 46 | tabs: widget.collectTypes.map((CollectType t){ 47 | return new Tab(text: t.name); 48 | }).toList()), 49 | ), 50 | body: new TabBarView( 51 | children: widget.collectTypes.map((CollectType t){ 52 | if(t.code == "website-collect"){ 53 | return new FeedListPage(new CollectWebsitePresenter(), new WebsiteItemAdapter()); 54 | } 55 | return new FeedListPage(new CollectPostPresenter(), new FeedItemAdapter()); 56 | }).toList(), 57 | ), 58 | )), 59 | ); 60 | 61 | 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /lib/drawer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'collect_list.dart'; 3 | import 'text_link_span.dart'; 4 | 5 | class DrawerSetting extends StatelessWidget { 6 | final Map userInfo; 7 | 8 | DrawerSetting(this.userInfo); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | var header; 13 | if (userInfo != null) { 14 | header = new DrawerHeader( 15 | child: new Container( 16 | padding: const EdgeInsets.all(0.0), 17 | child: new Column( 18 | mainAxisSize: MainAxisSize.min, 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | new CircleAvatar( 22 | child: new Icon( 23 | Icons.person, 24 | color: Colors.white, 25 | size: 40.0, 26 | ), 27 | backgroundColor: Colors.blue, 28 | radius: 40.0, 29 | ), 30 | new Divider( 31 | height: 20.0, 32 | color: Colors.transparent, 33 | ), 34 | new Text( 35 | userInfo['username'], 36 | style: new TextStyle(fontSize: 18.0), 37 | ) 38 | ], 39 | ), 40 | ), 41 | ); 42 | } else { 43 | header = new DrawerHeader( 44 | child: new Container( 45 | child: new RaisedButton( 46 | onPressed: () { 47 | Navigator.of(context).pushNamed("/login"); 48 | }, 49 | child: new Text("登 陆")), 50 | ), 51 | ); 52 | } 53 | final ThemeData themeData = Theme.of(context); 54 | final TextStyle aboutTextStyle = themeData.textTheme.body2; 55 | final TextStyle linkStyle = 56 | themeData.textTheme.body2.copyWith(color: themeData.accentColor); 57 | 58 | ListView listView = new ListView(children: [ 59 | header, 60 | new ListTile( 61 | leading: new Icon(Icons.favorite), 62 | title: new Text("我的收藏"), 63 | onTap: () { 64 | Navigator.push(context, 65 | new MaterialPageRoute(builder: (BuildContext context) { 66 | return new CollectListPage(); 67 | })); 68 | }, 69 | ), 70 | new Divider(), 71 | new ListTile( 72 | leading: new Icon(Icons.favorite), 73 | title: new Text("常用网站"), 74 | onTap: () {}, 75 | ), 76 | new Divider(), 77 | new ListTile( 78 | leading: new Icon(Icons.person), 79 | title: new Text("About Author"), 80 | onTap: () { 81 | Navigator.of(context).pushNamed("/about/author"); 82 | }, 83 | ), 84 | new Divider(), 85 | new AboutListTile( 86 | icon: new Icon(Icons.info), 87 | applicationVersion: '2018.02.07.alpha', 88 | applicationLegalese: 'author: leeoLuo', 89 | aboutBoxChildren: [ 90 | new Padding( 91 | padding: const EdgeInsets.all(16.0), 92 | child: new RichText( 93 | text: new TextSpan(children: [ 94 | new TextSpan( 95 | style: aboutTextStyle, text: '使用Flutter编写,WanAndroid提供api.'), 96 | new TextSpan(style: aboutTextStyle, text: '\n\n代码仓库'), 97 | new LinkTextSpan( 98 | style: linkStyle, 99 | url: 'https://github.com/Yonkers/flutter_wan_android', 100 | text: 'flutter_wan_android'), 101 | new TextSpan(style: aboutTextStyle, text: '\n\n更多Flutter资料参考'), 102 | new LinkTextSpan( 103 | style: linkStyle, 104 | url: 'https://flutter.io', 105 | ), 106 | new TextSpan(style: aboutTextStyle, text: '.'), 107 | ])), 108 | ), 109 | ], 110 | ) 111 | ]); 112 | return listView; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /lib/feed_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | import 'package:flutter/cupertino.dart'; 4 | import 'presenter/response_data.dart'; 5 | import 'adapter/base_adapter.dart'; 6 | 7 | class FeedListPage extends StatefulWidget { 8 | final dynamic presenter; 9 | final dynamic query; 10 | final Map postParam; 11 | final BaseAdapter adapter; 12 | 13 | FeedListPage(this.presenter, this.adapter, 14 | {Key key, this.query, this.postParam}) 15 | : super(key: key); 16 | 17 | @override 18 | _FeedListState createState() => new _FeedListState(); 19 | } 20 | 21 | class _FeedListState extends State { 22 | var _curPage = 0; 23 | 24 | Future _dataFuture; 25 | 26 | Future loadFeeds() async { 27 | ResponseData responseData = await widget.presenter.fetch( 28 | page: _curPage, query: widget.query, body: this.widget.postParam); 29 | if (responseData.isSuccess()) { 30 | if ((responseData.data is List)) { 31 | //兼容收藏列表,网站列表 32 | return responseData.data; 33 | } else { 34 | return responseData.data['datas']; 35 | } 36 | } else { 37 | throw new Exception(responseData.errorMsg); 38 | } 39 | } 40 | 41 | @override 42 | void initState() { 43 | super.initState(); 44 | 45 | _dataFuture = loadFeeds(); 46 | } 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | return new FutureBuilder( 51 | future: _dataFuture, 52 | builder: (BuildContext context, AsyncSnapshot snapshot) { 53 | switch (snapshot.connectionState) { 54 | case ConnectionState.active: 55 | return new Text("active"); 56 | case ConnectionState.none: 57 | return new Center( 58 | child: new Text("none"), 59 | ); 60 | case ConnectionState.waiting: 61 | return new Center( 62 | child: new CupertinoActivityIndicator(), 63 | ); 64 | default: 65 | if (snapshot.hasError) { 66 | debugPrint("${snapshot.error}"); 67 | return new Center( 68 | child: new Text('Error: ${snapshot.error}'), 69 | ); 70 | } else { 71 | List data = snapshot.data; 72 | if (null == data || data.length == 0) { 73 | return new Center( 74 | child: new Text('No Data'), 75 | ); 76 | } 77 | List listTiles = data.map((item) { 78 | return widget.adapter.getItemView(context, item); 79 | }).toList(); 80 | return new ListView( 81 | children: ListTile 82 | .divideTiles(context: this.context, tiles: listTiles) 83 | .toList(), 84 | ); 85 | } 86 | } 87 | }); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'dart:io'; 4 | import 'dart:convert'; 5 | import 'dart:async'; 6 | import 'package:http/http.dart' as http; 7 | import 'package:shared_preferences/shared_preferences.dart'; 8 | 9 | class LoginPage extends StatefulWidget { 10 | @override 11 | State createState() => new LoginState(); 12 | } 13 | 14 | class LoginState extends State { 15 | GlobalKey _scaffoldKey = new GlobalKey(); 16 | final GlobalKey _formKey = new GlobalKey(); 17 | String username; 18 | String password; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return new Scaffold( 23 | key: _scaffoldKey, 24 | appBar: new AppBar( 25 | title: new Text("登陆"), 26 | ), 27 | body: getLoginForm(), 28 | ); 29 | } 30 | 31 | void showSnack(String msg) { 32 | _scaffoldKey.currentState 33 | .showSnackBar(new SnackBar(content: new Text(msg))); 34 | } 35 | 36 | String userNameValidator(String username) { 37 | if (username.trim().length == 0) return "请输入用户名"; 38 | return null; 39 | } 40 | 41 | String passwordValidator(String pass) { 42 | if (pass.trim().length == 0) return "请输入密码"; 43 | return null; 44 | } 45 | 46 | Future login() async { 47 | final FormState form = _formKey.currentState; 48 | if (!form.validate()) { 49 | print('login form error'); 50 | } else { 51 | form.save(); 52 | print("username $username , password: $password"); 53 | var response = await http.post("http://www.wanandroid.com/user/login", 54 | body: {'username': this.username, 'password': this.password}, 55 | encoding: Encoding.getByName("utf-8")); 56 | print(response.body); 57 | print(response.headers); 58 | if (response.statusCode == HttpStatus.OK) { 59 | Map data = json.decode(response.body); 60 | if (data['errorCode'] != 0) { 61 | String msg = data['errorMsg']; 62 | String errMsg = msg == null || msg.trim().isEmpty ? "登陆失败" : msg; 63 | showSnack(errMsg); 64 | } else { 65 | SharedPreferences prefs = await SharedPreferences.getInstance(); 66 | prefs.setString("loginCookie", json.encode(data['data'])); 67 | String setCookie = response.headers['set-cookie']; 68 | prefs.setString("set-cookie", setCookie); 69 | Navigator.of(this.context).pop("login"); 70 | } 71 | } else { 72 | showSnack("登陆失败 ErrorCode: ${response.statusCode}"); 73 | } 74 | } 75 | } 76 | 77 | void register() { 78 | final FormState form = _formKey.currentState; 79 | if (!form.validate()) { 80 | print('register form error'); 81 | } else { 82 | form.save(); 83 | Navigator.of(this.context).pop("register"); 84 | } 85 | } 86 | 87 | Widget getLoginForm() { 88 | var formItems = [ 89 | new TextFormField( 90 | decoration: const InputDecoration( 91 | labelText: '用户名', 92 | labelStyle: const TextStyle(fontSize: 16.0), 93 | hintText: '请输入用户名', 94 | hintStyle: const TextStyle(fontSize: 14.0)), 95 | validator: passwordValidator, 96 | initialValue: '', 97 | maxLines: 1, 98 | onSaved: (String value) { 99 | username = value; 100 | }, 101 | ), 102 | new TextFormField( 103 | decoration: const InputDecoration( 104 | labelText: '密码', 105 | labelStyle: const TextStyle(fontSize: 16.0), 106 | hintText: '由数字 - _ 组成的密码', 107 | hintStyle: const TextStyle(fontSize: 14.0)), 108 | obscureText: true, 109 | validator: userNameValidator, 110 | initialValue: '', 111 | maxLines: 1, 112 | onSaved: (String value) { 113 | password = value; 114 | }, 115 | ), 116 | new ButtonTheme.bar( 117 | child: new ButtonBar( 118 | alignment: MainAxisAlignment.end, 119 | children: [ 120 | new FlatButton( 121 | child: const Text('注 册', textScaleFactor: 1.3), 122 | textColor: Colors.red.shade300, 123 | onPressed: register), 124 | new FlatButton( 125 | child: const Text( 126 | '登 陆', 127 | textScaleFactor: 1.3, 128 | ), 129 | textColor: Colors.blue.shade600, 130 | onPressed: login), 131 | ], 132 | ), 133 | ), 134 | ]; 135 | return new Container( 136 | padding: new EdgeInsets.all(5.0), 137 | child: new Card( 138 | child: new Form( 139 | key: _formKey, 140 | autovalidate: true, 141 | child: new Padding( 142 | padding: new EdgeInsets.all(10.0), 143 | child: 144 | new Column(mainAxisSize: MainAxisSize.min, children: formItems), 145 | ), 146 | ), 147 | ), 148 | ); 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | import 'dart:convert'; 4 | import 'package:flutter/cupertino.dart'; 5 | import 'feed_list.dart'; 6 | import 'type_list.dart'; 7 | import 'drawer.dart'; 8 | import 'login_page.dart'; 9 | import 'package:shared_preferences/shared_preferences.dart'; 10 | import 'collect_list.dart'; 11 | import 'search_page.dart'; 12 | import 'presenter/feeds_presenter.dart'; 13 | import 'adapter/feed_item_adapter.dart'; 14 | import 'about_author.dart'; 15 | 16 | void main() => runApp(new MyApp()); 17 | 18 | Map buildRoutes() { 19 | return { 20 | '/login': (BuildContext context) => new LoginPage(), 21 | '/favorite/list': (BuildContext context) => new CollectListPage(), 22 | '/about/author': (BuildContext context) => new AboutAuthor(), 23 | }; 24 | } 25 | 26 | class MyApp extends StatelessWidget { 27 | // This widget is the root of your application. 28 | @override 29 | Widget build(BuildContext context) { 30 | return new MaterialApp( 31 | title: 'WanAndroid', 32 | theme: new ThemeData( 33 | primarySwatch: Colors.blue, 34 | ), 35 | routes: buildRoutes(), 36 | home: new MyHomePage(title: 'WanAndroid'), 37 | ); 38 | } 39 | } 40 | 41 | class MyHomePage extends StatefulWidget { 42 | MyHomePage({Key key, this.title}) : super(key: key); 43 | 44 | final String title; 45 | 46 | @override 47 | _MyHomePageState createState() => new _MyHomePageState(); 48 | } 49 | 50 | class _MyHomePageState extends State with WidgetsBindingObserver { 51 | int _currentIndex = 0; 52 | 53 | Map userInfo; 54 | 55 | @override 56 | void initState() { 57 | super.initState(); 58 | WidgetsBinding.instance.addObserver(this); 59 | checkLogin(); 60 | } 61 | 62 | @override 63 | void dispose() { 64 | super.dispose(); 65 | WidgetsBinding.instance.removeObserver(this); 66 | } 67 | 68 | @override 69 | void didChangeAppLifecycleState(AppLifecycleState state) { 70 | print("app state $state"); 71 | if (state == AppLifecycleState.resumed) { 72 | checkLogin(); 73 | } 74 | } 75 | 76 | Future checkLogin() async { 77 | SharedPreferences prefs = await SharedPreferences.getInstance(); 78 | String loginCookie = prefs.getString("loginCookie"); 79 | bool login = loginCookie != null && loginCookie.isNotEmpty; 80 | setState(() { 81 | if (login) { 82 | userInfo = json.decode(loginCookie); 83 | } else { 84 | userInfo = null; 85 | } 86 | }); 87 | } 88 | 89 | Widget _buildStack() { 90 | final List transitions = []; 91 | transitions 92 | .add(new FeedListPage(new FeedsPresenter(), new FeedItemAdapter())); 93 | transitions.add(new SearchPage()); 94 | transitions.add(new TypeListPage()); 95 | return new IndexedStack( 96 | children: transitions, 97 | index: _currentIndex, 98 | ); 99 | } 100 | 101 | @override 102 | Widget build(BuildContext context) { 103 | return new Scaffold( 104 | appBar: new AppBar( 105 | title: new Text(widget.title), 106 | ), 107 | body: _buildStack(), 108 | drawer: new Drawer(child: new DrawerSetting(userInfo)), 109 | bottomNavigationBar: new BottomNavigationBar( 110 | currentIndex: _currentIndex, 111 | onTap: (int index) { 112 | setState(() { 113 | this._currentIndex = index; 114 | }); 115 | }, 116 | items: [ 117 | new BottomNavigationBarItem( 118 | icon: new Icon(Icons.home), title: new Text("推荐")), 119 | new BottomNavigationBarItem( 120 | icon: new Icon(Icons.search), title: new Text("搜索")), 121 | new BottomNavigationBarItem( 122 | icon: new Icon(Icons.menu), title: new Text("知识体系")), 123 | ]), 124 | ); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /lib/net/wan_android_api.dart: -------------------------------------------------------------------------------- 1 | 2 | //feed 文章列表 3 | const String RECOMMEND_FEEDS = "http://www.wanandroid.com/article/list/{param}/json"; 4 | 5 | //知识体系 6 | const String TREE_LIST = "http://www.wanandroid.com/tree/json"; 7 | 8 | //知识体系下的文章 9 | const String TREE_FEEDS = "http://www.wanandroid.com/article/list/{param}/json?cid={param}"; 10 | 11 | //搜索热词 12 | const String HOT_KEYS = "http://www.wanandroid.com/hotkey/json"; 13 | 14 | //热门网站 15 | const String FRIEND_WEBSITE = "http://www.wanandroid.com/friend/json"; 16 | 17 | //搜索 18 | const String SEARCH = "http://www.wanandroid.com/article/query/{param}/json"; 19 | 20 | //登陆 21 | const String LOGIN = "http://www.wanandroid.com/user/login"; 22 | 23 | //注册 24 | const String REGISTER = "http://www.wanandroid.com/user/login"; 25 | 26 | //取消收藏 27 | const String REMOVE_FAVORITE = "http://www.wanandroid.com/lg/uncollect_originId/{param}/json"; 28 | //收藏 29 | const String ADD_FAVORITE = "http://www.wanandroid.com/lg/collect/{param}/json"; 30 | //收藏列表 31 | const String FAVORITE_LIST = "http://www.wanandroid.com/lg/collect/list/{param}/json"; 32 | 33 | //添加站外文章 34 | const String ADD_POST = "http://www.wanandroid.com/lg/collect/add/json"; 35 | 36 | //添加网站 37 | const String ADD_WEBSITE = "http://www.wanandroid.com/lg/collect/addtool/json"; 38 | //网站列表 39 | const String WEBSITE_LIST = "http://www.wanandroid.com/lg/collect/usertools/json"; 40 | //删除网站 41 | const String REMOVE_WEBSITE = "http://www.wanandroid.com/lg/collect/deletetool/json"; 42 | 43 | 44 | // 填充url 45 | String fillUrl(String url, {List params}){ 46 | if(null == params || params.length == 0){ 47 | return url; 48 | } 49 | String s = url; 50 | params.forEach((dynamic p){ 51 | if(s.contains("{param}")) { 52 | s = s.replaceFirst("{param}", p.toString()); 53 | } 54 | }); 55 | return s; 56 | } -------------------------------------------------------------------------------- /lib/post_detail.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'dart:async'; 4 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; 5 | 6 | import 'presenter/collect_post_presenter.dart'; 7 | import 'presenter/response_data.dart'; 8 | 9 | class PostDetailPage extends StatefulWidget { 10 | final Map post; 11 | 12 | PostDetailPage(this.post); 13 | 14 | @override 15 | State createState() => new _PostDetailWebViewState(); 16 | } 17 | 18 | class _PostDetailWebViewState extends State { 19 | GlobalKey _scaffoldKey = new GlobalKey(); 20 | 21 | CollectPostPresenter presenter = new CollectPostPresenter(); 22 | 23 | // Instance of WebView plugin 24 | final flutterWebviewPlugin = new FlutterWebviewPlugin(); 25 | 26 | // On destroy stream 27 | StreamSubscription _onDestroy; 28 | 29 | // On urlChanged stream 30 | StreamSubscription _onUrlChanged; 31 | 32 | // On urlChanged stream 33 | StreamSubscription _onStateChanged; 34 | 35 | final _history = []; 36 | 37 | void showSnack(String msg) { 38 | _scaffoldKey.currentState 39 | .showSnackBar(new SnackBar(content: new Text(msg))); 40 | } 41 | 42 | bool collected = false; 43 | bool loading = false; 44 | 45 | @override 46 | initState() { 47 | super.initState(); 48 | if (null != this.widget.post['collect']) { 49 | collected = this.widget.post['collect']; 50 | } 51 | 52 | flutterWebviewPlugin.close(); 53 | 54 | // Add a listener to on destroy WebView, so you can make came actions. 55 | _onDestroy = flutterWebviewPlugin.onDestroy.listen((_) { 56 | if (mounted) { 57 | // Actions like show a info toast. 58 | //_scaffoldKey.currentState.showSnackBar(new SnackBar(content: new Text("Webview Destroyed"))); 59 | } 60 | }); 61 | 62 | // Add a listener to on url changed 63 | _onUrlChanged = flutterWebviewPlugin.onUrlChanged.listen((String url) { 64 | if (mounted) { 65 | setState(() { 66 | _history.add("onUrlChanged: $url"); 67 | }); 68 | } 69 | }); 70 | 71 | _onStateChanged = 72 | flutterWebviewPlugin.onStateChanged.listen((WebViewStateChanged state) { 73 | if (mounted) { 74 | setState(() { 75 | _history.add("onStateChanged: ${state.type} ${state.url}"); 76 | }); 77 | } 78 | }); 79 | } 80 | 81 | @override 82 | void dispose() { 83 | // Every listener should be canceled, the same should be done with this stream. 84 | _onDestroy.cancel(); 85 | _onUrlChanged.cancel(); 86 | _onStateChanged.cancel(); 87 | 88 | flutterWebviewPlugin.dispose(); 89 | 90 | super.dispose(); 91 | } 92 | 93 | @override 94 | Widget build(BuildContext context) { 95 | String title = widget.post['title'] == null 96 | ? widget.post['name'] 97 | : widget.post['title']; 98 | var favIcon = loading 99 | ? new CupertinoActivityIndicator() 100 | : new Icon( 101 | collected ? Icons.favorite : Icons.favorite_border, 102 | color: Colors.white, 103 | ); 104 | return new WebviewScaffold( 105 | key: _scaffoldKey, 106 | url: widget.post['link'], 107 | withJavascript: true, 108 | appBar: new AppBar( 109 | title: new Text(title), 110 | actions: [ 111 | new FlatButton( 112 | onPressed: () { 113 | if (loading) return; 114 | if (collected) 115 | removeFavorite(); 116 | else 117 | addToFavorite(); 118 | }, 119 | child: favIcon) 120 | ], 121 | ), 122 | ); 123 | } 124 | 125 | Future addToFavorite() async { 126 | setState(() { 127 | loading = true; 128 | }); 129 | ResponseData data = await presenter.addCollect( 130 | query: this.widget.post['id'], 131 | ); 132 | if (data.isSuccess()) { 133 | print("收藏成功"); 134 | setState(() { 135 | collected = true; 136 | loading = false; 137 | }); 138 | } else { 139 | print("收藏失败"); 140 | setState(() { 141 | loading = false; 142 | }); 143 | } 144 | } 145 | 146 | Future removeFavorite() async { 147 | setState(() { 148 | loading = true; 149 | }); 150 | String originId = widget.post['origin']; 151 | if (originId == null || originId.isEmpty) originId = "-1"; 152 | ResponseData data = await presenter.removeCollect( 153 | query: this.widget.post['id'], body: {'originId': originId}); 154 | if (data.isSuccess()) { 155 | print("取消收藏成功"); 156 | setState(() { 157 | collected = false; 158 | loading = false; 159 | }); 160 | } else { 161 | print("取消收藏失败"); 162 | setState(() { 163 | loading = false; 164 | }); 165 | } 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /lib/presenter/base_presenter.dart: -------------------------------------------------------------------------------- 1 | import 'response_data.dart'; 2 | import 'dart:async'; 3 | import 'package:flutter_wan_android/cache.dart'; 4 | import 'dart:io'; 5 | import 'dart:convert'; 6 | import 'package:http/http.dart'; 7 | 8 | abstract class BasePresenter { 9 | ///请求接口数据 10 | Future fetch( 11 | {int page, dynamic query, Map body}); 12 | 13 | Future> getHeader() async { 14 | String loginCookie = await getCookie(); 15 | Map header; 16 | if (null != loginCookie) { 17 | header = { 18 | 'Cookie': loginCookie, 19 | }; 20 | } 21 | return header; 22 | } 23 | 24 | ResponseData parseResponse(Response response) { 25 | print(response.body); 26 | ResponseData responseData; 27 | if (response.statusCode == HttpStatus.OK) { 28 | Map res = json.decode(response.body); 29 | responseData = new ResponseData( 30 | errorCode: res['errorCode'], 31 | errorMsg: res['errorMsg'], 32 | data: res['data']); 33 | } else { 34 | responseData = new ResponseData( 35 | errorCode: -1, 36 | errorMsg: "Request Server Error! Code:${response.statusCode}"); 37 | } 38 | return responseData; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/presenter/collect_post_presenter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:http/http.dart' as http; 3 | import 'base_presenter.dart'; 4 | import '../net/wan_android_api.dart'; 5 | import 'response_data.dart'; 6 | 7 | class CollectPostPresenter extends BasePresenter { 8 | @override 9 | Future fetch( 10 | {int page, dynamic query, Map body}) async { 11 | String url = fillUrl(FAVORITE_LIST, params: [page]); 12 | Map header = await getHeader(); 13 | var response = await http.get(url, headers: header); 14 | return parseResponse(response); 15 | } 16 | 17 | //添加收藏 18 | Future addCollect( 19 | {dynamic query, Map body}) async { 20 | String url = fillUrl(ADD_FAVORITE, params: [query]); 21 | Map header = await getHeader(); 22 | var response = await http.post(url, headers: header); 23 | return parseResponse(response); 24 | } 25 | 26 | //删除收藏 27 | Future removeCollect( 28 | {dynamic query, Map body}) async { 29 | String url = fillUrl(REMOVE_FAVORITE, params: [query]); 30 | Map header = await getHeader(); 31 | var response = await http.post(url, headers: header); 32 | return parseResponse(response); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/presenter/collect_website_presenter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'base_presenter.dart'; 4 | import '../net/wan_android_api.dart'; 5 | import 'response_data.dart'; 6 | import 'package:http/http.dart' as http; 7 | 8 | class CollectWebsitePresenter extends BasePresenter { 9 | @override 10 | Future fetch( 11 | {int page, dynamic query, Map body}) async { 12 | String url = fillUrl(WEBSITE_LIST); 13 | Map header = await getHeader(); 14 | var response = await http.get(url, headers: header); 15 | return parseResponse(response); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/presenter/feeds_presenter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'base_presenter.dart'; 4 | import '../net/wan_android_api.dart'; 5 | import 'response_data.dart'; 6 | import 'package:http/http.dart' as http; 7 | 8 | class FeedsPresenter extends BasePresenter { 9 | @override 10 | Future fetch( 11 | {int page, dynamic query, Map body}) async { 12 | String url = fillUrl(RECOMMEND_FEEDS, params: [page]); 13 | Map header = await getHeader(); 14 | var response = await http.get(url, headers: header); 15 | return parseResponse(response); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/presenter/response_data.dart: -------------------------------------------------------------------------------- 1 | //服务器返回的数据 2 | class ResponseData { 3 | dynamic data; 4 | int errorCode = -1; 5 | String errorMsg = ""; 6 | 7 | bool isSuccess() => errorCode == 0 && (errorMsg == null || errorMsg.length == 0); 8 | 9 | ResponseData({this.errorCode, this.errorMsg, this.data}); 10 | } -------------------------------------------------------------------------------- /lib/presenter/search_presenter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'base_presenter.dart'; 4 | import '../net/wan_android_api.dart'; 5 | import 'response_data.dart'; 6 | import 'package:http/http.dart' as http; 7 | 8 | class SearchPresenter extends BasePresenter { 9 | @override 10 | Future fetch( 11 | {int page, dynamic query, Map body}) async { 12 | String url = fillUrl(SEARCH, params: [page]); 13 | Map header = await getHeader(); 14 | var response = await http.post(url, headers: header, body: body); 15 | return parseResponse(response); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/presenter/sub_types_presenter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'base_presenter.dart'; 4 | import '../net/wan_android_api.dart'; 5 | import 'response_data.dart'; 6 | import 'package:http/http.dart' as http; 7 | 8 | class TypeFeedsPresenter extends BasePresenter { 9 | @override 10 | Future fetch( 11 | {int page, dynamic query, Map body}) async { 12 | String url = fillUrl(TREE_FEEDS, params: [page, query]); 13 | Map header = await getHeader(); 14 | var response = await http.get(url, headers: header); 15 | return parseResponse(response); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/search_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:async'; 3 | import 'package:http/http.dart' as http; 4 | import 'dart:io'; 5 | import 'dart:convert'; 6 | import 'dart:math'; 7 | import 'feed_list.dart'; 8 | import 'presenter/search_presenter.dart'; 9 | import 'adapter/feed_item_adapter.dart'; 10 | 11 | class SearchPage extends StatefulWidget { 12 | @override 13 | State createState() => new _SearchState(); 14 | } 15 | 16 | class _SearchState extends State { 17 | List hotWords; 18 | 19 | List colors = [ 20 | Colors.blue, 21 | Colors.amber, 22 | Colors.green, 23 | Colors.pink, 24 | Colors.cyan 25 | ]; 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | List columns = [ 30 | new TextField( 31 | autofocus: false, 32 | maxLines: 1, 33 | decoration: new InputDecoration( 34 | prefixIcon: const Icon(Icons.search), 35 | hintText: '搜索关键词', 36 | hintStyle: const TextStyle(color: Colors.blueGrey), 37 | border: const OutlineInputBorder(), 38 | contentPadding: const EdgeInsets.all(16.0), 39 | suffixIcon: new IconButton( 40 | icon: const Icon(Icons.arrow_right), onPressed: () {}), 41 | ), 42 | ) 43 | ]; 44 | if (null != hotWords && hotWords.length > 0) { 45 | columns.add(new Divider( 46 | height: 30.0, 47 | color: Colors.transparent, 48 | )); 49 | 50 | Random random = new Random(colors.length); 51 | 52 | Wrap hotLayout = new Wrap( 53 | spacing: 16.0, 54 | runSpacing: 16.0, 55 | alignment: WrapAlignment.center, 56 | children: hotWords.map((word) { 57 | return new InkWell( 58 | child: new Container( 59 | child: new Text( 60 | word['name'], 61 | style: new TextStyle(color: Colors.white, fontSize: 18.0), 62 | ), 63 | padding: const EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), 64 | color: colors[random.nextInt(colors.length)], 65 | ), 66 | onTap: () { 67 | Navigator.push(this.context, 68 | new MaterialPageRoute(builder: (BuildContext context) { 69 | return new Scaffold( 70 | appBar: new AppBar( 71 | title: new Text("search:${word['name']}"), 72 | ), 73 | body: new FeedListPage( 74 | new SearchPresenter(), 75 | new FeedItemAdapter(), 76 | postParam: {'k': word['name']}, 77 | )); 78 | })); 79 | }, 80 | ); 81 | }).toList(), 82 | ); 83 | 84 | columns.add(hotLayout); 85 | } 86 | 87 | return new Container( 88 | padding: const EdgeInsets.all(5.0), 89 | child: new Column(children: columns), 90 | ); 91 | } 92 | 93 | @override 94 | void initState() { 95 | super.initState(); 96 | 97 | loadHotWords(); 98 | } 99 | 100 | Future loadHotWords() async { 101 | var response = await http.get("http://www.wanandroid.com/hotkey/json"); 102 | if (response.statusCode == HttpStatus.OK) { 103 | Map res = json.decode(response.body); 104 | List list = res['data']; 105 | if (list == null) list = []; 106 | setState(() { 107 | this.hotWords = list; 108 | }); 109 | } else {} 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /lib/tabbed_post_by_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'feed_list.dart'; 3 | import 'presenter/sub_types_presenter.dart'; 4 | import 'adapter/feed_item_adapter.dart'; 5 | 6 | class TabbedPostListPage extends StatefulWidget { 7 | final Map typeItem; 8 | 9 | TabbedPostListPage(this.typeItem); 10 | 11 | @override 12 | State createState() => new _TabbedPostListState(); 13 | } 14 | 15 | class _TabbedPostListState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | List types = this.widget.typeItem['children']; 19 | 20 | return new MaterialApp( 21 | home: new DefaultTabController( 22 | length: types.length, 23 | child: new Scaffold( 24 | appBar: new AppBar( 25 | leading: new IconButton( 26 | tooltip: 'Previous choice', 27 | icon: const Icon(Icons.arrow_back), 28 | onPressed: () { 29 | Navigator.of(this.context).pop(); 30 | }, 31 | ), 32 | title: new Text(this.widget.typeItem['name']), 33 | bottom: new TabBar( 34 | isScrollable: true, 35 | tabs: types.map((t) { 36 | return new Tab(text: t['name']); 37 | }).toList()), 38 | ), 39 | body: new TabBarView( 40 | children: types.map((t) { 41 | return new FeedListPage( 42 | new TypeFeedsPresenter(), 43 | new FeedItemAdapter(), 44 | query: t['id'], 45 | ); 46 | }).toList(), 47 | ), 48 | )), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/text_link_span.dart: -------------------------------------------------------------------------------- 1 | import 'package:url_launcher/url_launcher.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/gestures.dart'; 4 | 5 | class LinkTextSpan extends TextSpan { 6 | 7 | LinkTextSpan({ TextStyle style, String url, String text }) : super( 8 | style: style, 9 | text: text ?? url, 10 | recognizer: new TapGestureRecognizer()..onTap = () { 11 | launch(url); 12 | } 13 | ); 14 | } -------------------------------------------------------------------------------- /lib/type_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'dart:async'; 5 | import 'dart:convert'; 6 | import 'package:flutter/cupertino.dart'; 7 | 8 | import 'tabbed_post_by_type.dart'; 9 | 10 | //知识体系列表 11 | class TypeListPage extends StatefulWidget { 12 | TypeListPage({Key key}) : super(key: key); 13 | 14 | @override 15 | _TypeListPageState createState() => new _TypeListPageState(); 16 | } 17 | 18 | class _TypeListPageState extends State 19 | with AutomaticKeepAliveClientMixin { 20 | List typeList; 21 | String _errorMsg; 22 | 23 | Future loadFeeds() async { 24 | var response = await http.get("http://www.wanandroid.com/tree/json"); 25 | if (response.statusCode == 200) { 26 | typeList = json.decode(response.body)['data']; 27 | } else { 28 | typeList = []; 29 | _errorMsg = "Data error ${response.statusCode}"; 30 | } 31 | return typeList; 32 | } 33 | 34 | @override 35 | void initState() { 36 | super.initState(); 37 | 38 | loadFeeds().then((dynamic data) { 39 | setState(() { 40 | //update ui 41 | }); 42 | }); 43 | } 44 | 45 | Widget getBodyView() { 46 | var body; 47 | if (typeList == null) { 48 | body = new Container( 49 | child: new Center( 50 | child: new CupertinoActivityIndicator(), 51 | )); 52 | } else if (_errorMsg != null) { 53 | body = new Container( 54 | child: new Center( 55 | child: new Text(_errorMsg), 56 | )); 57 | } else { 58 | List listTiles = typeList.map((item) { 59 | List children = item['children'] as List; 60 | StringBuffer sb = new StringBuffer(); 61 | children.forEach((child) { 62 | sb.write(child['name']); 63 | sb.write(" "); 64 | }); 65 | return new ListTile( 66 | leading: new CircleAvatar( 67 | child: new Text(item['name'].toString().substring(0, 1)), 68 | ), 69 | title: new Text(item['name'], style: new TextStyle(fontSize: 18.0)), 70 | isThreeLine: true, 71 | dense: true, 72 | subtitle: new Text( 73 | "$sb", 74 | maxLines: 2, 75 | ), 76 | onTap: () { 77 | Navigator.push(this.context, 78 | new MaterialPageRoute(builder: (BuildContext context) { 79 | return new TabbedPostListPage(item); 80 | })); 81 | }, 82 | ); 83 | }).toList(); 84 | body = new ListView( 85 | children: ListTile 86 | .divideTiles(context: this.context, tiles: listTiles) 87 | .toList(), 88 | ); 89 | } 90 | return body; 91 | } 92 | 93 | @override 94 | Widget build(BuildContext context) { 95 | return getBodyView(); 96 | } 97 | 98 | // TODO: implement wantKeepAlive 99 | @override 100 | bool get wantKeepAlive => true; 101 | } 102 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_wan_android 2 | description: wanandroid app use flutter 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 | # flutter_web_view: ^0.0.2 12 | flutter_webview_plugin: ^0.1.5 13 | shared_preferences: ^0.4.1 14 | url_launcher: ^3.0.0 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | 21 | # For information on the generic Dart part of this file, see the 22 | # following page: https://www.dartlang.org/tools/pub/pubspec 23 | 24 | # The following section is specific to Flutter. 25 | flutter: 26 | 27 | # The following line ensures that the Material Icons font is 28 | # included with your application, so that you can use the icons in 29 | # the material Icons class. 30 | uses-material-design: true 31 | 32 | # To add assets to your application, add an assets section, like this: 33 | # assets: 34 | # - images/a_dot_burr.jpeg 35 | # - images/a_dot_ham.jpeg 36 | 37 | # An image asset can refer to one or more resolution-specific "variants", see 38 | # https://flutter.io/assets-and-images/#resolution-aware. 39 | 40 | # For details regarding adding assets from package dependencies, see 41 | # https://flutter.io/assets-and-images/#from-packages 42 | 43 | # To add custom fonts to your application, add a fonts section here, 44 | # in this "flutter" section. Each entry in this list should have a 45 | # "family" key with the font family name, and a "fonts" key with a 46 | # list giving the asset and other descriptors for the font. For 47 | # example: 48 | # fonts: 49 | # - family: Schyler 50 | # fonts: 51 | # - asset: fonts/Schyler-Regular.ttf 52 | # - asset: fonts/Schyler-Italic.ttf 53 | # style: italic 54 | # - family: Trajan Pro 55 | # fonts: 56 | # - asset: fonts/TrajanPro.ttf 57 | # - asset: fonts/TrajanPro_Bold.ttf 58 | # weight: 700 59 | # 60 | # For details regarding fonts from package dependencies, 61 | # see https://flutter.io/custom-fonts/#from-packages 62 | -------------------------------------------------------------------------------- /test/api_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:flutter_wan_android/net/wan_android_api.dart'; 3 | 4 | void main(){ 5 | test("url pattern", (){ 6 | String url = fillUrl(TREE_FEEDS, params: [1, 12]); 7 | print(url); 8 | }); 9 | } -------------------------------------------------------------------------------- /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_wan_android/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 | --------------------------------------------------------------------------------