├── .gitignore ├── .metadata ├── README.md ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── yourcompany │ │ │ └── dilidili │ │ │ └── MainActivity.java │ │ └── res │ │ ├── drawable │ │ └── launch_background.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── key.properties └── settings.gradle ├── apk ├── flutter-dilidili-bloc.apk └── flutter-dilidili.apk ├── assets └── demo.db ├── dilidili.iml ├── dilidili_android.iml ├── 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.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── application.dart ├── bean │ ├── bean.dart │ ├── category.dart │ └── video.dart ├── blocs │ ├── blocs.dart │ ├── category │ │ ├── category.dart │ │ ├── category_bloc.dart │ │ ├── category_event.dart │ │ └── category_state.dart │ ├── detail │ │ ├── detail.dart │ │ ├── detail_bloc.dart │ │ ├── detail_event.dart │ │ └── detail_state.dart │ ├── history │ │ ├── history.dart │ │ ├── history_bloc.dart │ │ ├── history_event.dart │ │ └── history_state.dart │ ├── newest │ │ ├── newest.dart │ │ ├── newest_bloc.dart │ │ ├── newest_event.dart │ │ └── newest_state.dart │ ├── play │ │ ├── play.dart │ │ ├── play_bloc.dart │ │ ├── play_event.dart │ │ └── play_state.dart │ ├── search │ │ ├── search.dart │ │ ├── search_bloc.dart │ │ ├── search_event.dart │ │ └── search_state.dart │ └── tab │ │ ├── tab.dart │ │ ├── tab_bloc.dart │ │ ├── tab_event.dart │ │ └── tab_state.dart ├── constant.dart ├── db │ └── db_helper.dart ├── http.dart ├── main.dart ├── ui │ ├── category_body.dart │ ├── category_detail_body.dart │ ├── detail_home.dart │ ├── history_body.dart │ ├── home.dart │ ├── new_body.dart │ ├── play_home.dart │ └── search_body.dart └── utils │ ├── html_util.dart │ └── string_util.dart ├── pubspec.lock ├── pubspec.yaml ├── screenshot └── screen.png └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | .flutter-plugins 10 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 12bbaba9ae044d0ea77da4dd5e4db15eed403f09 8 | channel: beta 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dilidili 2 | 3 | 嘀哩嘀哩客户端 4 | 5 | [apk下载(flutter_gsyplayer)](https://raw.githubusercontent.com/crazecoder/dilidili/master/apk/flutter-dilidili.apk) 6 | 7 | 8 | [bloc版apk下载(flutter_gsyplayer)](https://raw.githubusercontent.com/crazecoder/dilidili/master/apk/flutter-dilidili-bloc.apk) 9 | 10 | ## 截图 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | def keystorePropertiesFile = rootProject.file("key.properties") 17 | def keystoreProperties = new Properties() 18 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 19 | android { 20 | compileSdkVersion 28 21 | 22 | lintOptions { 23 | disable 'InvalidPackage' 24 | } 25 | 26 | defaultConfig { 27 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 28 | applicationId "com.flutter.dilidili" 29 | minSdkVersion 16 30 | targetSdkVersion 28 31 | versionCode 1 32 | versionName "1.0" 33 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 34 | } 35 | 36 | signingConfigs { 37 | release { 38 | keyAlias keystoreProperties['keyAlias'] 39 | keyPassword keystoreProperties['keyPassword'] 40 | storeFile file(keystoreProperties['storeFile']) 41 | storePassword keystoreProperties['storePassword'] 42 | } 43 | } 44 | buildTypes { 45 | release { 46 | signingConfig signingConfigs.release 47 | } 48 | } 49 | } 50 | 51 | flutter { 52 | source '../..' 53 | } 54 | 55 | dependencies { 56 | testImplementation 'junit:junit:4.12' 57 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 58 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 20 | 27 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/yourcompany/dilidili/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.yourcompany.dilidili; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.3.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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-5.1.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/key.properties: -------------------------------------------------------------------------------- 1 | storePassword=flutter 2 | keyPassword=flutter 3 | keyAlias=flutter 4 | storeFile=/Users/chendong/Desktop/flutter.jks -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /apk/flutter-dilidili-bloc.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/apk/flutter-dilidili-bloc.apk -------------------------------------------------------------------------------- /apk/flutter-dilidili.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/apk/flutter-dilidili.apk -------------------------------------------------------------------------------- /assets/demo.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/assets/demo.db -------------------------------------------------------------------------------- /dilidili.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /dilidili_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/app.flx 37 | /Flutter/app.zip 38 | /Flutter/flutter_assets/ 39 | /Flutter/App.framework 40 | /Flutter/Flutter.framework 41 | /Flutter/Generated.xcconfig 42 | /ServiceDefinitions.json 43 | 44 | Pods/ 45 | -------------------------------------------------------------------------------- /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, separator='=') 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=separator) 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 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 31 | # referring to absolute paths on developers' machines. 32 | system('rm -rf Pods/.symlinks') 33 | system('mkdir -p Pods/.symlinks/plugins') 34 | 35 | # Flutter Pods 36 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 37 | if generated_xcode_build_settings.empty? 38 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 39 | end 40 | generated_xcode_build_settings.map { |p| 41 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 42 | symlink = File.join('Pods', '.symlinks', 'flutter') 43 | File.symlink(File.dirname(p[:path]), symlink) 44 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 45 | end 46 | } 47 | 48 | # Plugin Pods 49 | plugin_pods = parse_KV_file('../.flutter-plugins') 50 | plugin_pods.map { |p| 51 | symlink = File.join('Pods', '.symlinks', 'plugins', p[:name]) 52 | File.symlink(p[:path], symlink) 53 | pod p[:name], :path => File.join(symlink, 'ios') 54 | } 55 | end 56 | 57 | post_install do |installer| 58 | installer.pods_project.targets.each do |target| 59 | target.build_configurations.each do |config| 60 | config.build_settings['ENABLE_BITCODE'] = 'NO' 61 | end 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_ijkplayer (0.0.1): 4 | - Flutter 5 | - FlutterIJK (~> 0.0.9) 6 | - flutter_webview_plugin (0.0.1): 7 | - Flutter 8 | - FlutterIJK (0.0.9) 9 | - FMDB (2.7.2): 10 | - FMDB/standard (= 2.7.2) 11 | - FMDB/standard (2.7.2) 12 | - path_provider (0.0.1): 13 | - Flutter 14 | - sqflite (0.0.1): 15 | - Flutter 16 | - FMDB (~> 2.7.2) 17 | - url_launcher (0.0.1): 18 | - Flutter 19 | 20 | DEPENDENCIES: 21 | - Flutter (from `Pods/.symlinks/flutter/ios`) 22 | - flutter_ijkplayer (from `Pods/.symlinks/plugins/flutter_ijkplayer/ios`) 23 | - flutter_webview_plugin (from `Pods/.symlinks/plugins/flutter_webview_plugin/ios`) 24 | - path_provider (from `Pods/.symlinks/plugins/path_provider/ios`) 25 | - sqflite (from `Pods/.symlinks/plugins/sqflite/ios`) 26 | - url_launcher (from `Pods/.symlinks/plugins/url_launcher/ios`) 27 | 28 | SPEC REPOS: 29 | https://github.com/cocoapods/specs.git: 30 | - FlutterIJK 31 | - FMDB 32 | 33 | EXTERNAL SOURCES: 34 | Flutter: 35 | :path: Pods/.symlinks/flutter/ios 36 | flutter_ijkplayer: 37 | :path: Pods/.symlinks/plugins/flutter_ijkplayer/ios 38 | flutter_webview_plugin: 39 | :path: Pods/.symlinks/plugins/flutter_webview_plugin/ios 40 | path_provider: 41 | :path: Pods/.symlinks/plugins/path_provider/ios 42 | sqflite: 43 | :path: Pods/.symlinks/plugins/sqflite/ios 44 | url_launcher: 45 | :path: Pods/.symlinks/plugins/url_launcher/ios 46 | 47 | SPEC CHECKSUMS: 48 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 49 | flutter_ijkplayer: c3a5d569dde01d23b33bf0cfc685a256a10e56ce 50 | flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694 51 | FlutterIJK: 9e3ccb3d74cca7ebe77db65d30a19b630ea8648e 52 | FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa 53 | path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 54 | sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a 55 | url_launcher: 0067ddb8f10d36786672aa0722a21717dba3a298 56 | 57 | PODFILE CHECKSUM: 13dcf421f4da2e937a57e8ba760ed880beae536f 58 | 59 | COCOAPODS: 1.7.1 60 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 67B78EC47F33B7603B40EA6B /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 658F162D27265F3262BDB146 /* libPods-Runner.a */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 14FDACE6965445A7ADCBD438 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 41D2DD91EC88DDC8BA217FEA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 48 | 658F162D27265F3262BDB146 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 50 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 53 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 54 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 55 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 57 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 60 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 70 | 67B78EC47F33B7603B40EA6B /* libPods-Runner.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 863665719BEAE41CF034EC6F /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 658F162D27265F3262BDB146 /* libPods-Runner.a */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | 9740EEB11CF90186004384FC /* Flutter */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 3B80C3931E831B6300D905FE /* App.framework */, 89 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 90 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 91 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 92 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 93 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 94 | ); 95 | name = Flutter; 96 | sourceTree = ""; 97 | }; 98 | 97C146E51CF9000F007C117D = { 99 | isa = PBXGroup; 100 | children = ( 101 | 9740EEB11CF90186004384FC /* Flutter */, 102 | 97C146F01CF9000F007C117D /* Runner */, 103 | 97C146EF1CF9000F007C117D /* Products */, 104 | AE534B809B3BCA90EF31504D /* Pods */, 105 | 863665719BEAE41CF034EC6F /* Frameworks */, 106 | ); 107 | sourceTree = ""; 108 | }; 109 | 97C146EF1CF9000F007C117D /* Products */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 97C146EE1CF9000F007C117D /* Runner.app */, 113 | ); 114 | name = Products; 115 | sourceTree = ""; 116 | }; 117 | 97C146F01CF9000F007C117D /* Runner */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 121 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 122 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 123 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 124 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 125 | 97C147021CF9000F007C117D /* Info.plist */, 126 | 97C146F11CF9000F007C117D /* Supporting Files */, 127 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 128 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 129 | ); 130 | path = Runner; 131 | sourceTree = ""; 132 | }; 133 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 97C146F21CF9000F007C117D /* main.m */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | AE534B809B3BCA90EF31504D /* Pods */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 41D2DD91EC88DDC8BA217FEA /* Pods-Runner.debug.xcconfig */, 145 | 14FDACE6965445A7ADCBD438 /* Pods-Runner.release.xcconfig */, 146 | ); 147 | name = Pods; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 97C146ED1CF9000F007C117D /* Runner */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 156 | buildPhases = ( 157 | A1EC0DE0F0826D83E798D806 /* [CP] Check Pods Manifest.lock */, 158 | 9740EEB61CF901F6004384FC /* Run Script */, 159 | 97C146EA1CF9000F007C117D /* Sources */, 160 | 97C146EB1CF9000F007C117D /* Frameworks */, 161 | 97C146EC1CF9000F007C117D /* Resources */, 162 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 163 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 164 | 6EA2B817D2E85CA0691018D5 /* [CP] Embed Pods Frameworks */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = Runner; 171 | productName = Runner; 172 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | 97C146E61CF9000F007C117D /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | LastUpgradeCheck = 0910; 182 | ORGANIZATIONNAME = "The Chromium Authors"; 183 | TargetAttributes = { 184 | 97C146ED1CF9000F007C117D = { 185 | CreatedOnToolsVersion = 7.3.1; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | Base, 196 | ); 197 | mainGroup = 97C146E51CF9000F007C117D; 198 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 199 | projectDirPath = ""; 200 | projectRoot = ""; 201 | targets = ( 202 | 97C146ED1CF9000F007C117D /* Runner */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | 97C146EC1CF9000F007C117D /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 213 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 214 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 215 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 216 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 217 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | /* End PBXResourcesBuildPhase section */ 222 | 223 | /* Begin PBXShellScriptBuildPhase section */ 224 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 225 | isa = PBXShellScriptBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | ); 229 | inputPaths = ( 230 | ); 231 | name = "Thin Binary"; 232 | outputPaths = ( 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | shellPath = /bin/sh; 236 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 237 | }; 238 | 6EA2B817D2E85CA0691018D5 /* [CP] Embed Pods Frameworks */ = { 239 | isa = PBXShellScriptBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | ); 243 | inputPaths = ( 244 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 245 | "${PODS_ROOT}/.symlinks/flutter/ios/Flutter.framework", 246 | ); 247 | name = "[CP] Embed Pods Frameworks"; 248 | outputPaths = ( 249 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | shellPath = /bin/sh; 253 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 254 | showEnvVarsInLog = 0; 255 | }; 256 | 9740EEB61CF901F6004384FC /* Run Script */ = { 257 | isa = PBXShellScriptBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | ); 261 | inputPaths = ( 262 | ); 263 | name = "Run Script"; 264 | outputPaths = ( 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | shellPath = /bin/sh; 268 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 269 | }; 270 | A1EC0DE0F0826D83E798D806 /* [CP] Check Pods Manifest.lock */ = { 271 | isa = PBXShellScriptBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | ); 275 | inputPaths = ( 276 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 277 | "${PODS_ROOT}/Manifest.lock", 278 | ); 279 | name = "[CP] Check Pods Manifest.lock"; 280 | outputPaths = ( 281 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | shellPath = /bin/sh; 285 | 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"; 286 | showEnvVarsInLog = 0; 287 | }; 288 | /* End PBXShellScriptBuildPhase section */ 289 | 290 | /* Begin PBXSourcesBuildPhase section */ 291 | 97C146EA1CF9000F007C117D /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 296 | 97C146F31CF9000F007C117D /* main.m in Sources */, 297 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXVariantGroup section */ 304 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 97C146FB1CF9000F007C117D /* Base */, 308 | ); 309 | name = Main.storyboard; 310 | sourceTree = ""; 311 | }; 312 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 97C147001CF9000F007C117D /* Base */, 316 | ); 317 | name = LaunchScreen.storyboard; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 97C147031CF9000F007C117D /* Debug */ = { 324 | isa = XCBuildConfiguration; 325 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 326 | buildSettings = { 327 | ALWAYS_SEARCH_USER_PATHS = NO; 328 | CLANG_ANALYZER_NONNULL = YES; 329 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 330 | CLANG_CXX_LIBRARY = "libc++"; 331 | CLANG_ENABLE_MODULES = YES; 332 | CLANG_ENABLE_OBJC_ARC = YES; 333 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_COMMA = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INFINITE_RECURSION = YES; 341 | CLANG_WARN_INT_CONVERSION = YES; 342 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 343 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 346 | CLANG_WARN_STRICT_PROTOTYPES = YES; 347 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 348 | CLANG_WARN_UNREACHABLE_CODE = YES; 349 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 350 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 351 | COPY_PHASE_STRIP = NO; 352 | DEBUG_INFORMATION_FORMAT = dwarf; 353 | ENABLE_STRICT_OBJC_MSGSEND = YES; 354 | ENABLE_TESTABILITY = YES; 355 | GCC_C_LANGUAGE_STANDARD = gnu99; 356 | GCC_DYNAMIC_NO_PIC = NO; 357 | GCC_NO_COMMON_BLOCKS = YES; 358 | GCC_OPTIMIZATION_LEVEL = 0; 359 | GCC_PREPROCESSOR_DEFINITIONS = ( 360 | "DEBUG=1", 361 | "$(inherited)", 362 | ); 363 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 364 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 365 | GCC_WARN_UNDECLARED_SELECTOR = YES; 366 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 367 | GCC_WARN_UNUSED_FUNCTION = YES; 368 | GCC_WARN_UNUSED_VARIABLE = YES; 369 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 370 | MTL_ENABLE_DEBUG_INFO = YES; 371 | ONLY_ACTIVE_ARCH = YES; 372 | SDKROOT = iphoneos; 373 | TARGETED_DEVICE_FAMILY = "1,2"; 374 | }; 375 | name = Debug; 376 | }; 377 | 97C147041CF9000F007C117D /* Release */ = { 378 | isa = XCBuildConfiguration; 379 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 380 | buildSettings = { 381 | ALWAYS_SEARCH_USER_PATHS = NO; 382 | CLANG_ANALYZER_NONNULL = YES; 383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 384 | CLANG_CXX_LIBRARY = "libc++"; 385 | CLANG_ENABLE_MODULES = YES; 386 | CLANG_ENABLE_OBJC_ARC = YES; 387 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 388 | CLANG_WARN_BOOL_CONVERSION = YES; 389 | CLANG_WARN_COMMA = YES; 390 | CLANG_WARN_CONSTANT_CONVERSION = YES; 391 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 392 | CLANG_WARN_EMPTY_BODY = YES; 393 | CLANG_WARN_ENUM_CONVERSION = YES; 394 | CLANG_WARN_INFINITE_RECURSION = YES; 395 | CLANG_WARN_INT_CONVERSION = YES; 396 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 397 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 398 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 399 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 400 | CLANG_WARN_STRICT_PROTOTYPES = YES; 401 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 405 | COPY_PHASE_STRIP = NO; 406 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 407 | ENABLE_NS_ASSERTIONS = NO; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | GCC_C_LANGUAGE_STANDARD = gnu99; 410 | GCC_NO_COMMON_BLOCKS = YES; 411 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 412 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 413 | GCC_WARN_UNDECLARED_SELECTOR = YES; 414 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 415 | GCC_WARN_UNUSED_FUNCTION = YES; 416 | GCC_WARN_UNUSED_VARIABLE = YES; 417 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 418 | MTL_ENABLE_DEBUG_INFO = NO; 419 | SDKROOT = iphoneos; 420 | TARGETED_DEVICE_FAMILY = "1,2"; 421 | VALIDATE_PRODUCT = YES; 422 | }; 423 | name = Release; 424 | }; 425 | 97C147061CF9000F007C117D /* Debug */ = { 426 | isa = XCBuildConfiguration; 427 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 428 | buildSettings = { 429 | ARCHS = arm64; 430 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 431 | CURRENT_PROJECT_VERSION = 1; 432 | ENABLE_BITCODE = NO; 433 | FRAMEWORK_SEARCH_PATHS = ( 434 | "$(inherited)", 435 | "$(PROJECT_DIR)/Flutter", 436 | ); 437 | INFOPLIST_FILE = Runner/Info.plist; 438 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 439 | LIBRARY_SEARCH_PATHS = ( 440 | "$(inherited)", 441 | "$(PROJECT_DIR)/Flutter", 442 | ); 443 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.dilidili; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | VERSIONING_SYSTEM = "apple-generic"; 446 | }; 447 | name = Debug; 448 | }; 449 | 97C147071CF9000F007C117D /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 452 | buildSettings = { 453 | ARCHS = arm64; 454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 455 | CURRENT_PROJECT_VERSION = 1; 456 | ENABLE_BITCODE = NO; 457 | FRAMEWORK_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | INFOPLIST_FILE = Runner/Info.plist; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 463 | LIBRARY_SEARCH_PATHS = ( 464 | "$(inherited)", 465 | "$(PROJECT_DIR)/Flutter", 466 | ); 467 | PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.dilidili; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | VERSIONING_SYSTEM = "apple-generic"; 470 | }; 471 | name = Release; 472 | }; 473 | /* End XCBuildConfiguration section */ 474 | 475 | /* Begin XCConfigurationList section */ 476 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 477 | isa = XCConfigurationList; 478 | buildConfigurations = ( 479 | 97C147031CF9000F007C117D /* Debug */, 480 | 97C147041CF9000F007C117D /* Release */, 481 | ); 482 | defaultConfigurationIsVisible = 0; 483 | defaultConfigurationName = Release; 484 | }; 485 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 486 | isa = XCConfigurationList; 487 | buildConfigurations = ( 488 | 97C147061CF9000F007C117D /* Debug */, 489 | 97C147071CF9000F007C117D /* Release */, 490 | ); 491 | defaultConfigurationIsVisible = 0; 492 | defaultConfigurationName = Release; 493 | }; 494 | /* End XCConfigurationList section */ 495 | }; 496 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 497 | } 498 | -------------------------------------------------------------------------------- /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.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/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 | dilidili 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/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/application.dart: -------------------------------------------------------------------------------- 1 | import 'package:fluro/fluro.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class Application{ 5 | static Router router; 6 | static GlobalKey key; 7 | } -------------------------------------------------------------------------------- /lib/bean/bean.dart: -------------------------------------------------------------------------------- 1 | export './category.dart'; 2 | export './video.dart'; -------------------------------------------------------------------------------- /lib/bean/category.dart: -------------------------------------------------------------------------------- 1 | class Category{ 2 | String name; 3 | String url; 4 | Category({this.name,this.url}); 5 | get categoryUrl=>url; 6 | get categoryName=>name; 7 | } -------------------------------------------------------------------------------- /lib/bean/video.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | @JsonSerializable() 4 | class Cartoon extends Object with _$CartoonSerializerMixin{ 5 | String url; 6 | String name; 7 | String episode; 8 | String picture; 9 | String intro; 10 | Cartoon({this.url,this.name,this.episode,this.picture,this.intro}); 11 | get cartoonUrl=>url; 12 | get cartoonName=>name; 13 | get cartoonEpisode=>episode; 14 | get cartoonPicture=>picture; 15 | get cartoonIntro=>intro; 16 | 17 | factory Cartoon.fromJson(Map json) { 18 | Cartoon cartoon = _$CartoonFromJson(json); 19 | return cartoon; 20 | } 21 | } 22 | Cartoon _$CartoonFromJson(Map json) => new Cartoon( 23 | url: json['url'] as String, 24 | name: json['name'] as String, 25 | episode: json['episode'] as String, 26 | picture: json['picture'] as String, 27 | intro: json['intro'] as String); 28 | 29 | abstract class _$CartoonSerializerMixin { 30 | String get url; 31 | String get name; 32 | String get episode; 33 | String get picture; 34 | String get intro; 35 | Map toJson() => { 36 | 'url': url, 37 | 'name': name, 38 | 'episode': episode, 39 | 'picture': picture, 40 | 'intro': intro 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /lib/blocs/blocs.dart: -------------------------------------------------------------------------------- 1 | export 'tab/tab.dart'; 2 | export 'category/category.dart'; 3 | export 'detail/detail.dart'; 4 | export 'newest/newest.dart'; 5 | export 'play/play.dart'; 6 | export 'history/history.dart'; 7 | export 'search/search.dart'; -------------------------------------------------------------------------------- /lib/blocs/category/category.dart: -------------------------------------------------------------------------------- 1 | export 'category_bloc.dart'; 2 | export 'category_event.dart'; 3 | export 'category_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/category/category_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import 'category.dart'; 4 | import '../../bean/bean.dart'; 5 | import '../../http.dart' as http; 6 | import '../../utils/html_util.dart'; 7 | 8 | class CategoryBloc extends Bloc { 9 | int _position = 0; 10 | @override 11 | CategoryState get initialState => InitialCategoryState(); 12 | 13 | @override 14 | Stream mapEventToState( 15 | CategoryEvent event, 16 | ) async* { 17 | if (event is CategoryLoadEvent) { 18 | yield* _loadCategory(); 19 | } else if (event is CategoryChangeEvent) { 20 | _position = event.position; 21 | } 22 | } 23 | 24 | get prePosition => _position; 25 | Stream _loadCategory() async* { 26 | String _html = await http.htmlGetCategory(); 27 | List _categories = await HtmlUtils.parseCategory(_html); 28 | var detailBlocs = {}; 29 | for (Category _category in _categories) { 30 | detailBlocs.putIfAbsent( 31 | _category.categoryUrl, () => CategoryDetailBloc()); 32 | } 33 | yield CategoryLoaded(categorys: _categories, map: detailBlocs); 34 | } 35 | } 36 | 37 | class CategoryDetailBloc 38 | extends Bloc { 39 | static Map _map = Map(); 40 | @override 41 | CategoryDetailState get initialState => InitialCategoryDetailState(); 42 | 43 | @override 44 | Stream mapEventToState( 45 | CategoryDetailEvent event, 46 | ) async* { 47 | if (event is CategoryDetailLoadEvent) { 48 | yield* _loadCategoryDetail(event); 49 | } 50 | } 51 | 52 | Stream _loadCategoryDetail( 53 | CategoryDetailLoadEvent event) async* { 54 | // yield InitialCategoryDetailState(); 55 | List _cartoons = await http.htmlGetCategoryDetail( 56 | event.category, 57 | ); 58 | if (_cartoons.isEmpty) { 59 | yield CategoryDetailEmpty(); 60 | } else { 61 | yield CategoryDetailLoaded(cartoons: _cartoons); 62 | _map.putIfAbsent(event.category, () => true); 63 | } 64 | } 65 | 66 | get cacheMap => _map; 67 | } 68 | -------------------------------------------------------------------------------- /lib/blocs/category/category_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | @immutable 5 | abstract class CategoryEvent extends Equatable { 6 | CategoryEvent([List props = const []]) : super(props); 7 | } 8 | 9 | class CategoryLoadEvent extends CategoryEvent{} 10 | class CategoryChangeEvent extends CategoryEvent{ 11 | final int position; 12 | CategoryChangeEvent({this.position}); 13 | } 14 | 15 | 16 | 17 | @immutable 18 | abstract class CategoryDetailEvent extends Equatable { 19 | CategoryDetailEvent([List props = const []]) : super(props); 20 | } 21 | class CategoryDetailLoadEvent extends CategoryDetailEvent{ 22 | final String category; 23 | CategoryDetailLoadEvent(this.category):super([category]); 24 | } -------------------------------------------------------------------------------- /lib/blocs/category/category_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | import 'package:dilidili/bean/bean.dart'; 4 | 5 | @immutable 6 | abstract class CategoryState extends Equatable { 7 | CategoryState([List props = const []]) : super(props); 8 | } 9 | 10 | class InitialCategoryState extends CategoryState {} 11 | 12 | class CategoryLoaded extends CategoryState { 13 | final List categorys; 14 | final Map map; 15 | CategoryLoaded({this.categorys,this.map}) : super([categorys,map]); 16 | } 17 | 18 | @immutable 19 | abstract class CategoryDetailState extends Equatable { 20 | CategoryDetailState([List props = const []]) : super(props); 21 | } 22 | class InitialCategoryDetailState extends CategoryDetailState { 23 | } 24 | class CategoryDetailLoadingState extends CategoryDetailState { 25 | } 26 | 27 | class CategoryDetailLoaded extends CategoryDetailState { 28 | final List cartoons; 29 | CategoryDetailLoaded({this.cartoons}) : super([cartoons]); 30 | } 31 | 32 | class CategoryDetailEmpty extends CategoryDetailState { 33 | } 34 | 35 | -------------------------------------------------------------------------------- /lib/blocs/detail/detail.dart: -------------------------------------------------------------------------------- 1 | export 'detail_bloc.dart'; 2 | export 'detail_event.dart'; 3 | export 'detail_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/detail/detail_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import '../../bean/bean.dart'; 4 | import '../../http.dart' as http; 5 | import 'detail.dart'; 6 | 7 | class DetailBloc extends Bloc { 8 | @override 9 | DetailState get initialState => InitialDetailState(); 10 | 11 | @override 12 | Stream mapEventToState( 13 | DetailEvent event, 14 | ) async* { 15 | if (event is DetailLoadEvent) { 16 | yield* _loadUrl(event); 17 | } 18 | } 19 | 20 | Stream _loadUrl(DetailLoadEvent event) async* { 21 | String url = event.url.replaceAll("[", "/"); 22 | List _cs = await http.htmlGetCategoryDetailHome(url); 23 | if (_cs != null && _cs.isNotEmpty) { 24 | String picture = event.picture?.replaceAll("[", "/"); 25 | if (picture == null || picture.isEmpty || picture == 'null') { 26 | picture = _cs[0].picture; 27 | } 28 | yield DetailLoadedState(url: url, picture: picture, cartoons: _cs); 29 | } else { 30 | yield DetailLoadFailedState(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/blocs/detail/detail_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | @immutable 5 | abstract class DetailEvent extends Equatable { 6 | DetailEvent([List props = const []]) : super(props); 7 | } 8 | 9 | class DetailLoadEvent extends DetailEvent { 10 | final String url; 11 | final String picture; 12 | DetailLoadEvent({this.url, this.picture}):super([url,picture]); 13 | } 14 | -------------------------------------------------------------------------------- /lib/blocs/detail/detail_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:dilidili/bean/video.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:meta/meta.dart'; 4 | 5 | @immutable 6 | abstract class DetailState extends Equatable { 7 | DetailState([List props = const []]) : super(props); 8 | } 9 | 10 | class InitialDetailState extends DetailState {} 11 | 12 | class DetailLoadFailedState extends DetailState {} 13 | 14 | class DetailLoadEmptyState extends DetailState {} 15 | 16 | class DetailLoadedState extends DetailState { 17 | final String url; 18 | final String picture; 19 | final List cartoons; 20 | DetailLoadedState({this.url,this.picture,this.cartoons}); 21 | } 22 | -------------------------------------------------------------------------------- /lib/blocs/history/history.dart: -------------------------------------------------------------------------------- 1 | export 'history_bloc.dart'; 2 | export 'history_event.dart'; 3 | export 'history_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/history/history_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import 'package:dilidili/bean/video.dart'; 4 | import '../../db/db_helper.dart'; 5 | import './history.dart'; 6 | 7 | class HistoryBloc extends Bloc { 8 | @override 9 | HistoryState get initialState => InitialHistoryState(); 10 | 11 | @override 12 | Stream mapEventToState( 13 | HistoryEvent event, 14 | ) async* { 15 | if (event is HistoryLoadEvent) { 16 | yield* _load(); 17 | } else if (event is HistoryClearEvent) { 18 | yield* _clear(); 19 | } 20 | } 21 | 22 | Stream _load() async* { 23 | List _cartoons = await DbHelper().getCartoon(); 24 | if (_cartoons != null && _cartoons.isNotEmpty) { 25 | yield HistoryLoadedState(_cartoons); 26 | }else{ 27 | yield HistoryEmptyState(); 28 | } 29 | } 30 | 31 | Stream _clear() async* { 32 | yield InitialHistoryState(); 33 | await DbHelper().clear(); 34 | yield HistoryEmptyState(); 35 | } 36 | @override 37 | void dispose() { 38 | DbHelper().close(); 39 | super.dispose(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/blocs/history/history_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | @immutable 5 | abstract class HistoryEvent extends Equatable { 6 | HistoryEvent([List props = const []]) : super(props); 7 | } 8 | 9 | class HistoryLoadEvent extends HistoryEvent{} 10 | 11 | class HistoryClearEvent extends HistoryEvent{} 12 | 13 | -------------------------------------------------------------------------------- /lib/blocs/history/history_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:dilidili/bean/bean.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:meta/meta.dart'; 4 | 5 | @immutable 6 | abstract class HistoryState extends Equatable { 7 | HistoryState([List props = const []]) : super(props); 8 | } 9 | 10 | class InitialHistoryState extends HistoryState {} 11 | 12 | class HistoryEmptyState extends HistoryState {} 13 | 14 | class HistoryLoadedState extends HistoryState { 15 | final List cartoons; 16 | HistoryLoadedState(this.cartoons):super([cartoons]); 17 | } 18 | -------------------------------------------------------------------------------- /lib/blocs/newest/newest.dart: -------------------------------------------------------------------------------- 1 | export 'newest_bloc.dart'; 2 | export 'newest_event.dart'; 3 | export 'newest_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/newest/newest_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import '../../bean/bean.dart'; 4 | import '../../utils/html_util.dart'; 5 | import '../../http.dart' as http; 6 | import 'newest.dart'; 7 | 8 | class NewestBloc extends Bloc { 9 | @override 10 | NewestState get initialState => InitialNewestState(); 11 | 12 | @override 13 | Stream mapEventToState( 14 | NewestEvent event, 15 | ) async* { 16 | if (event is NewestLoadEvent) yield* _load(); 17 | } 18 | 19 | Stream _load() async* { 20 | String _htmlStr = await http.htmlGetHome(); 21 | List _cartoons = await HtmlUtils.parseHome(_htmlStr); 22 | if (_cartoons != null && _cartoons.isNotEmpty) { 23 | yield NewestLoadedState(_cartoons); 24 | }else{ 25 | yield NewestLoadFailedState(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/blocs/newest/newest_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | @immutable 5 | abstract class NewestEvent extends Equatable { 6 | NewestEvent([List props = const []]) : super(props); 7 | } 8 | 9 | class NewestLoadEvent extends NewestEvent {} 10 | -------------------------------------------------------------------------------- /lib/blocs/newest/newest_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:dilidili/bean/bean.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:meta/meta.dart'; 4 | 5 | @immutable 6 | abstract class NewestState extends Equatable { 7 | NewestState([List props = const []]) : super(props); 8 | } 9 | 10 | class InitialNewestState extends NewestState {} 11 | 12 | class NewestLoadedState extends NewestState { 13 | final List cartoons; 14 | NewestLoadedState(this.cartoons):super([cartoons]); 15 | } 16 | 17 | class NewestLoadFailedState extends NewestState {} 18 | -------------------------------------------------------------------------------- /lib/blocs/play/play.dart: -------------------------------------------------------------------------------- 1 | export 'play_bloc.dart'; 2 | export 'play_event.dart'; 3 | export 'play_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/play/play_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import 'package:dilidili/blocs/blocs.dart'; 4 | import 'package:flutter_ijkplayer/flutter_ijkplayer.dart'; 5 | 6 | import 'play.dart'; 7 | import '../../db/db_helper.dart'; 8 | import '../../constant.dart'; 9 | import '../../http.dart' as http; 10 | import '../../utils/html_util.dart'; 11 | import '../../utils/string_util.dart'; 12 | 13 | class PlayBloc extends Bloc { 14 | IjkMediaController mediaController; 15 | 16 | @override 17 | PlayState get initialState => InitialPlayState(); 18 | 19 | @override 20 | Stream mapEventToState( 21 | PlayEvent event, 22 | ) async* { 23 | if (event is LoadEvent) { 24 | yield* _loadUrl(event); 25 | } 26 | } 27 | 28 | Stream _loadUrl(LoadEvent event) async* { 29 | mediaController = event.mediaController; 30 | String url = event.cartoon.url.replaceAll("[", "/"); 31 | if (!url.contains(ConstantValue.URL)) { 32 | url = "${ConstantValue.URL}$url"; 33 | } 34 | String _html = await http.htmlGetPlay(url); 35 | try { 36 | String _playUrl = await HtmlUtils.parsePlay(_html); 37 | if (getVideoUrl(_playUrl).length > 0) { 38 | String _url = getVideoUrl(_playUrl)[0] 39 | .replaceAll("http://player.jfrft.net/index.php?url=", ""); 40 | yield LoadedPlayerState(_url, title: event.cartoon.name); 41 | } else { 42 | yield LoadedWebviewState(_playUrl, title: event.cartoon.name); 43 | } 44 | DbHelper().insertCartoon(event.cartoon, () {}); 45 | } catch (e) { 46 | yield LoadedFailedState(); 47 | } 48 | } 49 | 50 | @override 51 | void dispose() { 52 | if (mediaController != null && mediaController.isPlaying) { 53 | mediaController.stop(); 54 | mediaController.dispose(); 55 | } 56 | DbHelper().close(); 57 | super.dispose(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/blocs/play/play_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:dilidili/bean/video.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:meta/meta.dart'; 4 | import 'package:flutter_ijkplayer/flutter_ijkplayer.dart'; 5 | 6 | 7 | @immutable 8 | abstract class PlayEvent extends Equatable { 9 | PlayEvent([List props = const []]) : super(props); 10 | } 11 | 12 | class LoadEvent extends PlayEvent { 13 | final Cartoon cartoon; 14 | final IjkMediaController mediaController; 15 | LoadEvent(this.cartoon,{this.mediaController}):super([cartoon,mediaController]); 16 | } 17 | -------------------------------------------------------------------------------- /lib/blocs/play/play_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | @immutable 5 | abstract class PlayState extends Equatable { 6 | PlayState([List props = const []]) : super(props); 7 | } 8 | 9 | class InitialPlayState extends PlayState {} 10 | 11 | class LoadedPlayerState extends PlayState { 12 | final String playUrl; 13 | final String title; 14 | LoadedPlayerState(this.playUrl,{this.title}):super([playUrl,title]); 15 | } 16 | 17 | class LoadedWebviewState extends PlayState { 18 | final String url; 19 | final String title; 20 | LoadedWebviewState(this.url,{this.title}):super([url,title]); 21 | } 22 | 23 | class LoadedFailedState extends PlayState {} -------------------------------------------------------------------------------- /lib/blocs/search/search.dart: -------------------------------------------------------------------------------- 1 | export 'search_bloc.dart'; 2 | export 'search_event.dart'; 3 | export 'search_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/search/search_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import 'package:dilidili/bean/bean.dart'; 4 | import '../../utils/html_util.dart'; 5 | import './search.dart'; 6 | import '../../http.dart' as http; 7 | 8 | class SearchBloc extends Bloc { 9 | @override 10 | SearchState get initialState => InitialSearchState(); 11 | 12 | @override 13 | Stream mapEventToState( 14 | SearchEvent event, 15 | ) async* { 16 | if (event is SearchClickEvent) { 17 | yield* search(event.searchText); 18 | } 19 | } 20 | 21 | Stream search(String _text) async* { 22 | if(_text.isEmpty) { 23 | yield InitialSearchState(); 24 | return; 25 | } 26 | yield SearchingState(); 27 | String _html = await http.htmlGetSearch(_text); 28 | List _cartoons = await HtmlUtils.parseSearch(_html); 29 | if (_cartoons != null && _cartoons.isNotEmpty) { 30 | yield SearchSuccessState(_cartoons); 31 | }else{ 32 | yield SearchEmptyState(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/blocs/search/search_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | @immutable 5 | abstract class SearchEvent extends Equatable { 6 | SearchEvent([List props = const []]) : super(props); 7 | } 8 | 9 | class SearchClickEvent extends SearchEvent{ 10 | final String searchText; 11 | SearchClickEvent(this.searchText):super([searchText]); 12 | } -------------------------------------------------------------------------------- /lib/blocs/search/search_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | import '../../bean/bean.dart'; 4 | 5 | @immutable 6 | abstract class SearchState extends Equatable { 7 | SearchState([List props = const []]) : super(props); 8 | } 9 | 10 | class InitialSearchState extends SearchState {} 11 | 12 | class SearchingState extends SearchState {} 13 | 14 | class SearchEmptyState extends SearchState {} 15 | 16 | class SearchFailedState extends SearchState {} 17 | 18 | class SearchSuccessState extends SearchState { 19 | final List cartoons; 20 | SearchSuccessState(this.cartoons):super([cartoons]); 21 | } 22 | -------------------------------------------------------------------------------- /lib/blocs/tab/tab.dart: -------------------------------------------------------------------------------- 1 | export 'tab_bloc.dart'; 2 | export 'tab_event.dart'; 3 | export 'tab_state.dart'; 4 | -------------------------------------------------------------------------------- /lib/blocs/tab/tab_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import 'tab.dart'; 4 | 5 | class TabBloc extends Bloc { 6 | @override 7 | AppTab get initialState => AppTab.CATEGORY; 8 | 9 | @override 10 | Stream mapEventToState( 11 | TabEvent event, 12 | ) async* { 13 | if (event is UpdateTab) { 14 | yield event.tab; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/blocs/tab/tab_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | import 'tab_state.dart'; 5 | 6 | @immutable 7 | abstract class TabEvent extends Equatable { 8 | TabEvent([List props = const []]) : super(props); 9 | } 10 | class UpdateTab extends TabEvent { 11 | final AppTab tab; 12 | 13 | UpdateTab(this.tab) : super([tab]); 14 | 15 | @override 16 | String toString() => 'UpdateTab { tab: $tab }'; 17 | } 18 | -------------------------------------------------------------------------------- /lib/blocs/tab/tab_state.dart: -------------------------------------------------------------------------------- 1 | enum AppTab{ 2 | CATEGORY, 3 | NEWEST, 4 | SEARCH, 5 | HISTORY, 6 | } 7 | -------------------------------------------------------------------------------- /lib/constant.dart: -------------------------------------------------------------------------------- 1 | class ConstantValue{ 2 | static const URL = 'http://www.dilidili.name'; 3 | } -------------------------------------------------------------------------------- /lib/db/db_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:dilidili/bean/bean.dart'; 5 | import 'package:flutter/services.dart'; 6 | import 'package:path_provider/path_provider.dart'; 7 | import 'package:sqflite/sqflite.dart'; 8 | 9 | class DbHelper { 10 | Database db; 11 | static final DbHelper _dbHelper = DbHelper._internal(); 12 | 13 | final String tableName = "cartoon"; 14 | final String columnId = "cartoon_id"; 15 | final String columnName = "cartoon_name"; 16 | final String columnPicture = "cartoon_picture"; 17 | final String columnUrl = "cartoon_url"; 18 | final String columnEpisode = "cartoon_episode"; 19 | 20 | factory DbHelper() { 21 | return _dbHelper; 22 | } 23 | 24 | DbHelper._internal(); 25 | 26 | Future _initDataBase() async { 27 | try { 28 | Directory documentsDirectory = await getApplicationDocumentsDirectory(); 29 | String path = "${documentsDirectory.path}/demo.db"; 30 | bool exists = await new File(path).exists(); 31 | // On first install, copy database out of assets and into documents dir 32 | 33 | if (!exists) { 34 | ByteData data = await rootBundle.load("assets/demo.db"); 35 | List bytes = 36 | data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); 37 | await new File(path).writeAsBytes(bytes); 38 | } 39 | db = await openDatabase(path, version: 1); 40 | await db.execute( 41 | "CREATE TABLE IF NOT EXISTS $tableName ($columnId INTEGER PRIMARY KEY, $columnName TEXT,$columnPicture TEXT, $columnUrl TEXT, $columnEpisode TEXT)"); 42 | } catch (e) { 43 | print(e); 44 | } 45 | } 46 | 47 | Future> getCartoon() async { 48 | await _initDataBase(); 49 | var cartoons = []; 50 | if (db.isOpen) { 51 | List maps = await db.query(tableName,); 52 | if (maps.length > 0) { 53 | maps.forEach((map) { 54 | Cartoon cartoon = new Cartoon( 55 | url: map[columnUrl], 56 | name: map[columnName], 57 | picture: map[columnPicture], 58 | episode: map[columnEpisode]); 59 | cartoons.add(cartoon); 60 | }); 61 | } 62 | } 63 | return cartoons; 64 | } 65 | 66 | Future insertCartoon(Cartoon cartoon, InsertCallback callback) async { 67 | await _initDataBase(); 68 | Map map = { 69 | columnName: cartoon.name, 70 | columnPicture: cartoon.picture, 71 | columnUrl: cartoon.url, 72 | columnEpisode: cartoon.episode 73 | }; 74 | try { 75 | List maps = await db.query(tableName, 76 | columns: [columnUrl], 77 | where: "$columnUrl = ?", 78 | whereArgs: [cartoon.url]); 79 | if (maps.isEmpty) { 80 | await db.insert(tableName, map); 81 | } 82 | callback(); 83 | } catch (e) { 84 | print(e); 85 | } 86 | } 87 | 88 | Future clear() async{ 89 | await _initDataBase(); 90 | await db.rawQuery("DELETE FROM $tableName"); 91 | } 92 | 93 | 94 | Future close() async => db.close(); 95 | } 96 | 97 | typedef void InsertCallback(); 98 | -------------------------------------------------------------------------------- /lib/http.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import './bean/bean.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:http_client/console.dart'; 6 | import 'utils/html_util.dart'; 7 | import 'constant.dart'; 8 | 9 | Future htmlGetHome() async { 10 | var _url = "${ConstantValue.URL}/zxgx/?1"; 11 | final client = new ConsoleClient(); 12 | final rs = await client.send(new Request('GET', _url)); 13 | final textContent = await rs.readAsString(); 14 | await client.close(); 15 | return textContent; 16 | } 17 | 18 | Future htmlGetCategory() async { 19 | var _url = "${ConstantValue.URL}/tvdh/?1"; 20 | final client = new ConsoleClient(); 21 | final rs = await client.send(new Request('GET', _url)); 22 | final textContent = await rs.readAsString(); 23 | await client.close(); 24 | return textContent; 25 | } 26 | 27 | Future> htmlGetCategoryDetail(String url) async { 28 | var _url = ConstantValue.URL + url; 29 | final client = new ConsoleClient(); 30 | final rs = await client.send(new Request('GET', _url)); 31 | final textContent = await rs.readAsString(); 32 | var cartoons = await compute(HtmlUtils.parseCategoryDetail, textContent); 33 | 34 | await client.close(); 35 | return cartoons; 36 | } 37 | 38 | Future> htmlGetCategoryDetailHome(String url) async { 39 | var _url = ConstantValue.URL + url; 40 | final client = new ConsoleClient(); 41 | final rs = await client.send(new Request('GET', _url)); 42 | final textContent = await rs.readAsString(); 43 | return await compute(HtmlUtils.parseCategoryDetailHome, textContent); 44 | // callback(textContent); 45 | // await client.close(); 46 | } 47 | 48 | Future htmlGetPlay(String _url) async { 49 | final client = new ConsoleClient(); 50 | final rs = await client.send(new Request('GET', _url)); 51 | final textContent = await rs.readAsString(); 52 | return textContent; 53 | } 54 | 55 | Future htmlGetSearch(String _name) async { 56 | var _url = 57 | "http://zhannei.baidu.com/cse/site?kwtype=0&q=$_name&stp=1&ie=utf8&src=zz&site=www.dilidili.name&cc=www.dilidili.name&rg=1"; 58 | final client = new ConsoleClient(); 59 | final rs = await client.send(new Request('GET', _url)); 60 | final textContent = await rs.readAsString(); 61 | await client.close(); 62 | return textContent; 63 | } 64 | 65 | typedef void HttpCallback(String html); 66 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dilidili/bean/bean.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | import 'package:bloc/bloc.dart'; 7 | import 'application.dart'; 8 | import 'ui/home.dart'; 9 | import 'package:fluro/fluro.dart'; 10 | import 'ui/detail_home.dart'; 11 | import 'ui/play_home.dart'; 12 | import 'blocs/blocs.dart' as blocs; 13 | 14 | class SimpleBlocDelegate extends BlocDelegate { 15 | @override 16 | void onEvent(Bloc bloc, Object event) { 17 | super.onEvent(bloc, event); 18 | print(event); 19 | } 20 | 21 | @override 22 | void onTransition(Bloc bloc, Transition transition) { 23 | super.onTransition(bloc, transition); 24 | print(transition); 25 | } 26 | 27 | @override 28 | void onError(Bloc bloc, Object error, StackTrace stacktrace) { 29 | super.onError(bloc, error, stacktrace); 30 | print(error); 31 | print(stacktrace); 32 | } 33 | } 34 | 35 | void main() { 36 | // debugDefaultTargetPlatformOverride = TargetPlatform.iOS; 37 | final Router router = new Router(); 38 | // Define our splash page. 39 | router.define( 40 | "/play/:json", 41 | handler: new Handler( 42 | handlerFunc: (BuildContext context, Map params) { 43 | String json = params["json"][0]; 44 | json = json.replaceAll("]", "/"); 45 | Map map = jsonDecode(json); 46 | Cartoon cartoon = new Cartoon.fromJson(map); 47 | return BlocProvider( 48 | builder: (_) => blocs.PlayBloc(), 49 | child: PlayHome( 50 | cartoon: cartoon, 51 | ), 52 | ); 53 | }, 54 | ), 55 | ); 56 | router.define( 57 | "/detail/:url/:name/:picture", 58 | handler: new Handler( 59 | handlerFunc: (BuildContext context, Map params) { 60 | return BlocProvider( 61 | builder: (_) => blocs.DetailBloc(), 62 | child: DetailHome( 63 | url: params["url"][0], 64 | name: params["name"][0], 65 | picture: params["picture"][0], 66 | ), 67 | ); 68 | }, 69 | ), 70 | ); 71 | Application.router = router; 72 | 73 | BlocSupervisor.delegate = SimpleBlocDelegate(); 74 | runApp(MyApp()); 75 | } 76 | 77 | class MyApp extends StatelessWidget { 78 | // final GlobalKey _key = GlobalKey(); 79 | // This widget is the root of your application. 80 | @override 81 | Widget build(BuildContext context) { 82 | // final RouterBloc routerBloc = RouterBloc(); 83 | return MaterialApp( 84 | onGenerateRoute: Application.router.generator, 85 | title: 'Flutter Demo', 86 | theme: ThemeData( 87 | primarySwatch: Colors.blue, 88 | ), 89 | home: MultiBlocProvider( 90 | providers: [ 91 | BlocProvider( 92 | builder: (_) => blocs.TabBloc(), 93 | ), 94 | BlocProvider( 95 | builder: (_) => blocs.HistoryBloc(), 96 | ), 97 | BlocProvider( 98 | builder: (_) => blocs.CategoryBloc()..dispatch(blocs.CategoryLoadEvent()), 99 | ), 100 | // BlocProvider( 101 | // builder: (_) => blocs.CategoryDetailBloc(), 102 | // ), 103 | BlocProvider( 104 | builder: (_) => blocs.NewestBloc()..dispatch(blocs.NewestLoadEvent()), 105 | ), 106 | BlocProvider( 107 | builder: (_) => blocs.SearchBloc(), 108 | ), 109 | ], 110 | child: HomePage(), 111 | ), 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /lib/ui/category_body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'category_detail_body.dart'; 4 | import '../blocs/blocs.dart'; 5 | 6 | class CategoryBody extends StatefulWidget { 7 | CategoryBody({Key key}) : super(key: key); 8 | 9 | _CategoryBodyState createState() => _CategoryBodyState(); 10 | } 11 | 12 | class _CategoryBodyState extends State 13 | with SingleTickerProviderStateMixin { 14 | @override 15 | Widget build(BuildContext context) { 16 | final CategoryBloc _bloc = BlocProvider.of(context); 17 | return BlocBuilder( 18 | bloc: _bloc, 19 | builder: (_context, _state) { 20 | if (_state is CategoryLoaded) { 21 | final TabController _controller = 22 | TabController(vsync: this, length: _state.categorys.length); 23 | return BlocListener( 24 | bloc: BlocProvider.of(context), 25 | listener: (context, state) { 26 | if (state != AppTab.CATEGORY) { 27 | _bloc 28 | .dispatch(CategoryChangeEvent(position: _controller.index)); 29 | } 30 | }, 31 | child: Scaffold( 32 | appBar: PreferredSize( 33 | child: AppBar( 34 | bottom: TabBar( 35 | controller: _controller..index = _bloc.prePosition, 36 | // indicator: BoxDecoration( 37 | // borderRadius: BorderRadius.circular(10), 38 | // color: Colors.redAccent), 39 | isScrollable: true, 40 | tabs: _state.categorys.map((category) { 41 | return Tab(text: category.name); 42 | }).toList(), 43 | ), 44 | ), 45 | preferredSize: Size.fromHeight(48.0), 46 | ), 47 | body: TabBarView( 48 | controller: _controller 49 | ..addListener(() { 50 | _bloc.dispatch( 51 | CategoryChangeEvent(position: _controller.index)); 52 | }), 53 | physics: ClampingScrollPhysics(), 54 | children: _state.categorys.map((category) { 55 | // final CategoryDetailBloc bloc = CategoryDetailBloc()..dispatch(CategoryDetailLoadEvent(category.url)); 56 | return CategoryDetailBody( 57 | key: PageStorageKey(category.url), 58 | url: category.url, 59 | bloc: _state.map[category.url], 60 | ); 61 | }).toList(), 62 | ), 63 | ), 64 | ); 65 | } else if (_state is InitialCategoryState) { 66 | return Center( 67 | child: CircularProgressIndicator(), 68 | ); 69 | } 70 | }, 71 | ); 72 | } 73 | } 74 | 75 | // class CategoryBody extends StatelessWidget { 76 | // const CategoryBody({PageStorageKey key}) : super(key: key); 77 | // @override 78 | // Widget build(BuildContext context) { 79 | // final CategoryBloc _bloc = BlocProvider.of(context); 80 | // return BlocBuilder( 81 | // bloc: _bloc, 82 | // builder: (_context, _state) { 83 | // if (_state is CategoryLoaded) { 84 | // return BlocListener( 85 | // bloc: BlocProvider.of(context), 86 | // listener: (context, state) { 87 | // if (state != AppTab.CATEGORY) { 88 | // print("object"); 89 | // } 90 | // }, 91 | // child: DefaultTabController( 92 | // length: _state.categorys.length, 93 | // child: Scaffold( 94 | // appBar: PreferredSize( 95 | // child: AppBar( 96 | // bottom: TabBar( 97 | // // indicator: BoxDecoration( 98 | // // borderRadius: BorderRadius.circular(10), 99 | // // color: Colors.redAccent), 100 | // isScrollable: true, 101 | // tabs: _state.categorys.map((category) { 102 | // return Tab(text: category.name); 103 | // }).toList(), 104 | // ), 105 | // ), 106 | // preferredSize: Size.fromHeight(48.0), 107 | // ), 108 | // body: TabBarView( 109 | // physics: ClampingScrollPhysics(), 110 | // children: _state.categorys.map((category) { 111 | // // final CategoryDetailBloc bloc = CategoryDetailBloc()..dispatch(CategoryDetailLoadEvent(category.url)); 112 | // return CategoryDetailBody( 113 | // key: PageStorageKey(category.url), 114 | // url: category.url, 115 | // bloc: _state.map[category.url], 116 | // ); 117 | // }).toList(), 118 | // ), 119 | // ), 120 | // ), 121 | // ); 122 | // } else if (_state is InitialCategoryState) { 123 | // return Center( 124 | // child: CircularProgressIndicator(), 125 | // ); 126 | // } 127 | // }, 128 | // ); 129 | // } 130 | // } 131 | -------------------------------------------------------------------------------- /lib/ui/category_detail_body.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:dilidili/bean/bean.dart'; 3 | import 'package:dilidili/blocs/blocs.dart'; 4 | import 'package:dilidili/blocs/category/category_bloc.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter/rendering.dart'; 8 | import 'package:flutter_bloc/flutter_bloc.dart'; 9 | import '../blocs/blocs.dart'; 10 | 11 | import '../application.dart'; 12 | 13 | class CategoryDetailBody extends StatelessWidget { 14 | final String url; 15 | final CategoryDetailBloc bloc; 16 | CategoryDetailBody({Key key, this.url, this.bloc}) : super(key: key); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | final bool _isFirst = 21 | !bloc.cacheMap.containsKey(url) || !bloc.cacheMap[url]; 22 | return BlocBuilder( 23 | bloc: bloc, 24 | builder: (_context, _state) { 25 | if (_state is CategoryDetailLoaded) { 26 | return Scrollbar( 27 | child: GridView.builder( 28 | itemCount: _state.cartoons?.length, 29 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 30 | crossAxisCount: 2, 31 | childAspectRatio: 11 / 16, 32 | ), 33 | itemBuilder: (_, i) { 34 | return _buildGridItem(_context, _state.cartoons[i]); 35 | }, 36 | ), 37 | ); 38 | } else { 39 | if (_isFirst) bloc.dispatch(CategoryDetailLoadEvent(url)); 40 | return Center( 41 | child: CircularProgressIndicator(), 42 | ); 43 | } 44 | }, 45 | ); 46 | } 47 | 48 | Widget _buildGridItem(context, Cartoon cartoon) { 49 | return GestureDetector( 50 | onTap: () { 51 | String url = cartoon.url.replaceAll("/", "["); 52 | String picture = cartoon.picture.replaceAll("/", "["); 53 | Application.router 54 | .navigateTo(context, '/detail/$url/${cartoon.name}/$picture'); 55 | }, 56 | child: buildGridItem(context, cartoon), 57 | ); 58 | } 59 | 60 | Widget buildGridItem(context, Cartoon cartoon) => Container( 61 | margin: EdgeInsets.all(5), 62 | child: Stack( 63 | children: [ 64 | CachedNetworkImage( 65 | width: MediaQuery.of(context).size.width / 2 - 5, 66 | height: 16 * (MediaQuery.of(context).size.width / 2 - 5) / 11, 67 | fit: BoxFit.fill, 68 | imageUrl: cartoon.picture, 69 | errorWidget: (_, _s, _o) => Center( 70 | child: Icon(Icons.error), 71 | ), 72 | ), 73 | Flex( 74 | direction: Axis.vertical, 75 | mainAxisAlignment: MainAxisAlignment.end, 76 | children: [ 77 | Opacity( 78 | child: Container( 79 | padding: EdgeInsets.all(3), 80 | width: MediaQuery.of(context).size.width / 2 - 5, 81 | child: Center( 82 | child: new Text( 83 | cartoon.name, 84 | maxLines: 1, 85 | style: TextStyle(color: Colors.white), 86 | ), 87 | ), 88 | color: Colors.black, 89 | ), 90 | opacity: 0.5, 91 | ), 92 | ], 93 | ), 94 | ], 95 | ), 96 | ); 97 | } 98 | -------------------------------------------------------------------------------- /lib/ui/detail_home.dart: -------------------------------------------------------------------------------- 1 | import 'package:dilidili/blocs/blocs.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flutter_bloc/flutter_bloc.dart'; 5 | import 'dart:convert'; 6 | 7 | import '../application.dart'; 8 | 9 | class DetailHome extends StatelessWidget { 10 | final String url; 11 | final String name; 12 | final String picture; 13 | 14 | DetailHome({this.url, this.name, this.picture}); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | final DetailBloc _bloc = BlocProvider.of(context); 19 | return BlocBuilder( 20 | bloc: _bloc..dispatch(DetailLoadEvent(url: url,picture: picture)), 21 | builder: (_context, _state) { 22 | // if(_state is InitialDetailState){ 23 | // _bloc.dispatch(DetailLoadEvent(url: url,picture: picture)); 24 | // } 25 | return Scaffold( 26 | appBar: _state is DetailLoadFailedState 27 | ? AppBar( 28 | title: Text(name), 29 | centerTitle: true, 30 | ) 31 | : null, 32 | body: _buildHome(_context,_state), 33 | ); 34 | }, 35 | ); 36 | } 37 | 38 | Widget _buildHome(BuildContext _context ,DetailState _state) { 39 | if (_state is DetailLoadFailedState) { 40 | return new Center( 41 | child: new Text("获取数据异常,请访问官网观看"), 42 | ); 43 | } 44 | if (_state is DetailLoadedState) 45 | return CustomScrollView( 46 | slivers: [ 47 | SliverAppBar( 48 | expandedHeight: MediaQuery.of(_context).size.width * 3 / 4, 49 | pinned: true, 50 | flexibleSpace: FlexibleSpaceBar( 51 | title: Text( 52 | name, 53 | style: TextStyle(fontSize: 16), 54 | ), 55 | background: Stack( 56 | children: [ 57 | CachedNetworkImage( 58 | width: MediaQuery.of(_context).size.width, 59 | height: MediaQuery.of(_context).size.width * 3 / 4, 60 | fit: BoxFit.fitWidth, 61 | imageUrl: _state.picture, 62 | // placeholder: (_, s) => new Center( 63 | // child: new CircularProgressIndicator(), 64 | // ), 65 | errorWidget: (_, _s, _o) => new Icon(Icons.error), 66 | ), 67 | DecoratedBox( 68 | decoration: BoxDecoration( 69 | gradient: LinearGradient( 70 | // begin: Alignment(0.0, -1), 71 | // end: Alignment(0.0, -0.4), 72 | colors: [Color(0x60000000), Color(0x00000000)], 73 | ), 74 | ), 75 | ), 76 | ], 77 | fit: StackFit.expand, 78 | ), 79 | ), 80 | ), 81 | SliverList( 82 | delegate: SliverChildListDelegate(getListWidget(_context,_state)), 83 | ) 84 | ], 85 | ); 86 | else 87 | return Scaffold( 88 | appBar: AppBar( 89 | title: Text(name), 90 | ), 91 | body: Center( 92 | child: new CircularProgressIndicator(), 93 | ), 94 | ); 95 | } 96 | 97 | List getListWidget(BuildContext _context,DetailLoadedState _state) { 98 | var _widgets = []; 99 | _state.cartoons.forEach((_cartoon) => _widgets.add(GestureDetector( 100 | onTap: () { 101 | String json = jsonEncode(_cartoon); 102 | json = json.replaceAll("/", "]"); 103 | json = json.replaceAll("?", ""); 104 | Application.router.navigateTo(_context, '/play/$json'); 105 | }, 106 | child: new Column( 107 | crossAxisAlignment: CrossAxisAlignment.start, 108 | children: [ 109 | new Container( 110 | width: MediaQuery.of(_context).size.width, 111 | padding: new EdgeInsets.all(10.0), 112 | child: new Text( 113 | _cartoon.name, 114 | maxLines: 1, 115 | ), 116 | ), 117 | new Divider(), 118 | ], 119 | ), 120 | ))); 121 | return _widgets; 122 | } 123 | } 124 | 125 | // class DetailHomeState extends State { 126 | // var _cartoons = []; 127 | // bool isCompelete = false; 128 | // bool isFailed = false; 129 | // var _picture; 130 | // final GlobalKey _scaffoldKey = new GlobalKey(); 131 | 132 | // @override 133 | // Widget build(BuildContext context) { 134 | // Application.key = _scaffoldKey; 135 | // return new Scaffold( 136 | // key: _scaffoldKey, 137 | // appBar: isFailed 138 | // ? new AppBar( 139 | // title: new Text(widget.name), 140 | // centerTitle: true, 141 | // ) 142 | // : null, 143 | // body: _buildHome(), 144 | // ); 145 | // } 146 | 147 | // Widget _buildHome() { 148 | // if (isFailed) { 149 | // return new Center( 150 | // child: new Text("获取数据异常,请访问官网观看"), 151 | // ); 152 | // } 153 | // if (isCompelete) 154 | // return CustomScrollView( 155 | // slivers: [ 156 | // SliverAppBar( 157 | // expandedHeight: MediaQuery.of(context).size.width * 3 / 4, 158 | // pinned: true, 159 | // flexibleSpace: FlexibleSpaceBar( 160 | // title: Text( 161 | // widget.name, 162 | // style: TextStyle(fontSize: 16), 163 | // ), 164 | // background: Stack( 165 | // children: [ 166 | // CachedNetworkImage( 167 | // width: MediaQuery.of(context).size.width, 168 | // height: MediaQuery.of(context).size.width * 3 / 4, 169 | // fit: BoxFit.fitWidth, 170 | // imageUrl: _picture, 171 | // // placeholder: (_, s) => new Center( 172 | // // child: new CircularProgressIndicator(), 173 | // // ), 174 | // errorWidget: (_, _s, _o) => new Icon(Icons.error), 175 | // ), 176 | // DecoratedBox( 177 | // decoration: BoxDecoration( 178 | // gradient: LinearGradient( 179 | // // begin: Alignment(0.0, -1), 180 | // // end: Alignment(0.0, -0.4), 181 | // colors: [Color(0x60000000), Color(0x00000000)], 182 | // ), 183 | // ), 184 | // ), 185 | // ], 186 | // fit: StackFit.expand, 187 | // ), 188 | // ), 189 | // ), 190 | // SliverList( 191 | // delegate: SliverChildListDelegate(getListWidget()), 192 | // ) 193 | // ], 194 | // ); 195 | // else 196 | // return Scaffold( 197 | // appBar: AppBar( 198 | // title: Text(widget.name), 199 | // ), 200 | // body: Center( 201 | // child: new CircularProgressIndicator(), 202 | // ), 203 | // ); 204 | // } 205 | 206 | // List getListWidget() { 207 | // var _widgets = []; 208 | // _cartoons.forEach((_cartoon) => _widgets.add(GestureDetector( 209 | // onTap: () { 210 | // String json = jsonEncode(_cartoon); 211 | // json = json.replaceAll("/", "]"); 212 | // json = json.replaceAll("?", ""); 213 | // Application.router.navigateTo(context, '/play/$json'); 214 | // }, 215 | // child: new Column( 216 | // crossAxisAlignment: CrossAxisAlignment.start, 217 | // children: [ 218 | // new Container( 219 | // width: MediaQuery.of(context).size.width, 220 | // padding: new EdgeInsets.all(10.0), 221 | // child: new Text( 222 | // _cartoon.name, 223 | // maxLines: 1, 224 | // ), 225 | // ), 226 | // new Divider(), 227 | // ], 228 | // ), 229 | // ))); 230 | // return _widgets; 231 | // } 232 | 233 | // @override 234 | // void initState() { 235 | // super.initState(); 236 | // String url = widget.url.replaceAll("[", "/"); 237 | // _picture = widget.picture?.replaceAll("[", "/"); 238 | // http.htmlGetCategoryDetailHome(url, sfn: (List _cs) { 239 | // if (mounted) 240 | // setState(() { 241 | // if (widget.picture == null || 242 | // widget.picture.isEmpty || 243 | // widget.picture == "null") { 244 | // _picture = _cs[0].picture; 245 | // } 246 | // _cartoons = _cs; 247 | // isCompelete = true; 248 | // }); 249 | // }, ffn: () { 250 | // if (mounted) 251 | // setState(() { 252 | // isFailed = true; 253 | // }); 254 | // }); 255 | // } 256 | // } 257 | -------------------------------------------------------------------------------- /lib/ui/history_body.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dilidili/bean/bean.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:cached_network_image/cached_network_image.dart'; 6 | import 'package:dilidili/blocs/blocs.dart'; 7 | import 'package:flutter_bloc/flutter_bloc.dart'; 8 | import '../application.dart'; 9 | 10 | class HistoryBody extends StatelessWidget { 11 | final HistoryBloc bloc; 12 | 13 | HistoryBody({this.bloc}); 14 | @override 15 | Widget build(BuildContext context) { 16 | return BlocBuilder( 17 | bloc: bloc..dispatch(HistoryLoadEvent()), 18 | builder: (_, _state) { 19 | if (_state is InitialHistoryState) { 20 | return new Center( 21 | child: new CircularProgressIndicator(), 22 | ); 23 | } 24 | if (_state is HistoryLoadedState) { 25 | List _cartoons = _state.cartoons.reversed.toList(); 26 | return new Scaffold( 27 | body: ListView.builder( 28 | itemCount: _cartoons.length, 29 | itemBuilder: (_, i) { 30 | return GestureDetector( 31 | onTap: () { 32 | String json = jsonEncode(_cartoons[i]); 33 | json = json.replaceAll("/", "]"); 34 | Application.router.navigateTo(context, '/play/$json'); 35 | }, 36 | child: Row( 37 | children: [ 38 | new Container( 39 | padding: EdgeInsets.only( 40 | left: 10, right: 10, top: 5, bottom: 5), 41 | width: 80.0, 42 | height: 80, 43 | child: _cartoons[i].picture == null || 44 | _cartoons[i].picture.isEmpty 45 | ? Center( 46 | child: Icon(Icons.error), 47 | ) 48 | : CachedNetworkImage( 49 | width: 80.0, 50 | height: 80, 51 | imageUrl: _cartoons[i].picture, 52 | errorWidget: (_, _s, _o) => Center( 53 | child: Icon(Icons.error), 54 | ), 55 | fit: BoxFit.fitWidth, 56 | ), 57 | ), 58 | Expanded( 59 | child: new Column( 60 | crossAxisAlignment: CrossAxisAlignment.start, 61 | children: [ 62 | new Text(_cartoons[i].name), 63 | new Text(_cartoons[i].episode == null 64 | ? "" 65 | : _cartoons[i].episode), 66 | ], 67 | ), 68 | ), 69 | ], 70 | ), 71 | ); 72 | }), 73 | ); 74 | } 75 | if (_state is HistoryEmptyState) { 76 | return new Center( 77 | child: new Text("暂无记录"), 78 | ); 79 | } 80 | }, 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/ui/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'new_body.dart'; 5 | import 'category_body.dart'; 6 | import 'search_body.dart'; 7 | import 'history_body.dart'; 8 | import '../blocs/blocs.dart'; 9 | 10 | class HomePage extends StatelessWidget { 11 | static var titles = [ 12 | Text("首页"), 13 | Text("追番"), 14 | Text("搜索"), 15 | Text("我的"), 16 | ]; 17 | var items = [ 18 | BottomNavigationBarItem(icon: Icon(Icons.home), title: titles[0]), 19 | BottomNavigationBarItem(icon: Icon(Icons.toc), title: titles[1]), 20 | BottomNavigationBarItem(icon: Icon(Icons.search), title: titles[2]), 21 | BottomNavigationBarItem(icon: Icon(Icons.person), title: titles[3]), 22 | ]; 23 | 24 | Widget _buildBody(context, AppTab _state) { 25 | if (_state == AppTab.CATEGORY) { 26 | // return CategoryBody(key: PageStorageKey("category"),); 27 | return CategoryBody(); 28 | } else if (_state == AppTab.NEWEST) { 29 | return NewBody(key: PageStorageKey("new"),); 30 | } else if (_state == AppTab.SEARCH) { 31 | return SearchBody(); 32 | } else if (_state == AppTab.HISTORY) { 33 | return HistoryBody( 34 | bloc: BlocProvider.of(context), 35 | ); 36 | } 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | final _tabBloc = BlocProvider.of(context); 42 | 43 | return BlocBuilder( 44 | bloc: _tabBloc, 45 | builder: (_context, _state) { 46 | return Scaffold( 47 | appBar: _buildAppBar(_context, _state), 48 | body: _buildBody(_context, _state), 49 | bottomNavigationBar: BottomNavigationBar( 50 | items: items, 51 | currentIndex: AppTab.values.indexOf(_tabBloc.currentState), 52 | onTap: (index) { 53 | _tabBloc.dispatch(UpdateTab(AppTab.values[index])); 54 | }, 55 | type: BottomNavigationBarType.fixed, 56 | ), 57 | ); 58 | }, 59 | ); 60 | } 61 | 62 | AppBar _buildAppBar(BuildContext _context, AppTab _state) { 63 | return AppBar( 64 | actions: [ 65 | _state == AppTab.HISTORY 66 | ? GestureDetector( 67 | child: Container( 68 | child: Icon(Icons.delete_sweep), 69 | padding: EdgeInsets.only(right: 10), 70 | ), 71 | onTap: () { 72 | BlocProvider.of(_context) 73 | ..dispatch(HistoryClearEvent()); 74 | }, 75 | ) 76 | : Container(), 77 | ], 78 | elevation: _state != AppTab.CATEGORY ? 3 : 0, 79 | centerTitle: true, 80 | title: titles[_state.index], 81 | ); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /lib/ui/new_body.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:dilidili/blocs/newest/newest.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:dilidili/bean/video.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | import 'dart:convert'; 7 | 8 | import '../application.dart'; 9 | 10 | //最近更新 11 | class NewBody extends StatelessWidget { 12 | const NewBody({Key key}) : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | final NewestBloc _bloc = BlocProvider.of(context); 17 | return BlocBuilder( 18 | bloc: _bloc, 19 | builder: (_context, _state) { 20 | if (_state is NewestLoadedState) { 21 | return Scaffold( 22 | body: GridView.builder( 23 | itemCount: _state.cartoons.length, 24 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 25 | crossAxisCount: 2, 26 | childAspectRatio: 166 / 117, 27 | ), 28 | itemBuilder: (_, i) { 29 | return _buildGridItem(_context, _state.cartoons[i]); 30 | }, 31 | ), 32 | ); 33 | } else { 34 | return Center( 35 | child: CircularProgressIndicator(), 36 | ); 37 | } 38 | }, 39 | ); 40 | } 41 | 42 | Widget _buildGridItem(BuildContext context, Cartoon cartoon) { 43 | return Container( 44 | // width: MediaQuery.of(context).size.width / 2 - 5, 45 | // height: 117 * (MediaQuery.of(context).size.width / 2 - 5) / 166, 46 | child: new GestureDetector( 47 | onTap: () { 48 | String json = jsonEncode(cartoon); 49 | json = json.replaceAll("/", "]"); 50 | Application.router.navigateTo(context, '/play/$json'); 51 | }, 52 | child: Stack( 53 | children: [ 54 | new CachedNetworkImage( 55 | imageUrl: cartoon.picture, 56 | width: MediaQuery.of(context).size.width / 2 - 5, 57 | height: 117 * (MediaQuery.of(context).size.width / 2 - 5) / 166, 58 | fit: BoxFit.fill, 59 | // placeholder: (_, _s) => new Center( 60 | // child: new CircularProgressIndicator(), 61 | // ), 62 | errorWidget: (_, _s, _o) => Center( 63 | child: Icon(Icons.error), 64 | ), 65 | ), 66 | Flex( 67 | direction: Axis.vertical, 68 | mainAxisAlignment: MainAxisAlignment.end, 69 | children: [ 70 | Opacity( 71 | child: Container( 72 | width: MediaQuery.of(context).size.width - 5, 73 | child: Center( 74 | child: Text( 75 | cartoon.name, 76 | softWrap: true, 77 | maxLines: 1, 78 | style: TextStyle(color: Colors.white), 79 | ), 80 | ), 81 | color: Colors.black, 82 | ), 83 | opacity: 0.5, 84 | ), 85 | ], 86 | ), 87 | Container( 88 | padding: EdgeInsets.all(2), 89 | child: Text( 90 | cartoon.episode, 91 | softWrap: true, 92 | style: TextStyle(color: Colors.white), 93 | ), 94 | color: Colors.green, 95 | ), 96 | ], 97 | ), 98 | ), 99 | margin: const EdgeInsets.all(4.0), 100 | ); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /lib/ui/play_home.dart: -------------------------------------------------------------------------------- 1 | import 'package:dilidili/bean/bean.dart'; 2 | import 'package:dilidili/blocs/blocs.dart'; 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; 7 | // import 'package:flutter_gsyplayer/flutter_gsyplayer.dart'; 8 | import 'package:flutter_ijkplayer/flutter_ijkplayer.dart'; 9 | 10 | class PlayHome extends StatelessWidget { 11 | final Cartoon cartoon; 12 | 13 | PlayHome({this.cartoon}); 14 | IjkMediaController controller = IjkMediaController(); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | final PlayBloc _bloc = BlocProvider.of(context); 19 | return BlocBuilder( 20 | bloc: _bloc..dispatch(LoadEvent(cartoon, mediaController: controller)), 21 | builder: (_, _state) { 22 | if (_state is LoadedFailedState) { 23 | // _showSnackBar("播放界面解析失败"); 24 | Navigator.pop(context); 25 | return null; 26 | } else if (_state is LoadedPlayerState) { 27 | controller.setNetworkDataSource(_state.playUrl, autoPlay: true); 28 | return Scaffold( 29 | appBar: AppBar( 30 | title: Text(_state.title), 31 | ), 32 | body: buildIjkPlayer(), 33 | ); 34 | // play(url: _state.playUrl, title: _state.title); 35 | // Navigator.pop(context); 36 | // return null; 37 | } else if (_state is LoadedWebviewState) { 38 | return WebviewScaffold( 39 | url: _state.url, 40 | withJavascript: true, 41 | clearCache: true, 42 | withLocalStorage: true, 43 | withZoom: false, 44 | appBar: AppBar( 45 | title: new Text(_state.title), 46 | centerTitle: true, 47 | ), 48 | ); 49 | } else { 50 | return new Center( 51 | child: new CircularProgressIndicator(), 52 | ); 53 | } 54 | }, 55 | ); 56 | } 57 | 58 | Widget buildIjkPlayer() { 59 | return Container( 60 | // height: 400, // 这里随意 61 | child: IjkPlayer( 62 | mediaController: controller, 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/ui/search_body.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:dilidili/bean/bean.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:dilidili/blocs/blocs.dart'; 6 | import 'package:flutter_bloc/flutter_bloc.dart'; 7 | 8 | import '../application.dart'; 9 | 10 | class SearchBody extends StatelessWidget { 11 | final TextEditingController _editingController = TextEditingController(); 12 | @override 13 | Widget build(BuildContext context) { 14 | final SearchBloc _bloc = BlocProvider.of(context); 15 | return BlocBuilder( 16 | bloc: _bloc, 17 | builder: (_context, _state) { 18 | // if(_state is InitialSearchState){ 19 | // }else 20 | if (_state is SearchEmptyState) { 21 | return _buildEmptyOrErrorBody(_bloc); 22 | } else if (_state is SearchingState) { 23 | return _buildLoadingBody(_bloc); 24 | } else if (_state is SearchSuccessState) { 25 | return _buildListBody(_context,_bloc); 26 | } 27 | return _buildInitializeBody(_bloc); 28 | }, 29 | ); 30 | } 31 | 32 | Widget _buildInitializeBody(_bloc) => Flex( 33 | children: [_buildSearchView(_bloc)], 34 | direction: Axis.vertical, 35 | ); 36 | Widget _buildLoadingBody(_bloc) => Scaffold( 37 | body: Column( 38 | children: [ 39 | _buildSearchView(_bloc), 40 | Expanded( 41 | child: Center( 42 | child: CircularProgressIndicator(), 43 | ), 44 | ) 45 | ], 46 | ), 47 | ); 48 | Widget _buildEmptyOrErrorBody(SearchBloc _bloc) => Scaffold( 49 | body: Column( 50 | children: [ 51 | _buildSearchView(_bloc), 52 | Expanded( 53 | child: Center( 54 | child: Text(_bloc.currentState is SearchFailedState ? "获取数据异常,请访问官网查看" : "抱歉,没有找到相关结果。"), 55 | ), 56 | ) 57 | ], 58 | ), 59 | ); 60 | Widget _buildSearchView(SearchBloc _bloc) { 61 | return Container( 62 | margin: EdgeInsets.all(10), 63 | height: 40, 64 | child: TextField( 65 | textInputAction: TextInputAction.search, 66 | onSubmitted: (_query) { 67 | _bloc.dispatch(SearchClickEvent(_query)); 68 | }, 69 | decoration: InputDecoration( 70 | prefixIcon: Icon(Icons.search), 71 | suffixIcon: GestureDetector( 72 | child: Icon(Icons.delete_sweep), 73 | onTap: () { 74 | WidgetsBinding.instance.addPostFrameCallback((_) => _editingController.clear()); 75 | }, 76 | ), 77 | contentPadding: EdgeInsets.all(10), 78 | border: OutlineInputBorder( 79 | borderRadius: BorderRadius.all(Radius.circular(30)), 80 | ), 81 | hintText: "请输入查找名称", 82 | ), 83 | controller: _editingController, 84 | ), 85 | ); 86 | } 87 | 88 | Widget _buildListBody(context,SearchBloc _bloc) => Scaffold( 89 | body: Column( 90 | children: [ 91 | _buildSearchView(_bloc), 92 | Expanded( 93 | child: ListView.builder( 94 | itemCount: (_bloc.currentState as SearchSuccessState).cartoons.length, 95 | itemBuilder: (_, i) { 96 | return GestureDetector( 97 | onTap: () { 98 | String url = (_bloc.currentState as SearchSuccessState).cartoons[i].url.replaceAll("/", "["); 99 | if (url.contains("watch")) { 100 | String json = jsonEncode((_bloc.currentState as SearchSuccessState).cartoons[i]); 101 | json = json.replaceAll("/", "]"); 102 | json = json.replaceAll("?", ""); 103 | Application.router.navigateTo(context, '/play/$json'); 104 | } else 105 | Application.router.navigateTo(context, 106 | '/detail/$url/${(_bloc.currentState as SearchSuccessState).cartoons[i].name}/${(_bloc.currentState as SearchSuccessState).cartoons[i].picture}'); 107 | }, 108 | child: Column( 109 | crossAxisAlignment: CrossAxisAlignment.start, 110 | children: [ 111 | Container( 112 | width: MediaQuery.of(context).size.width, 113 | padding: EdgeInsets.all(10.0), 114 | child: Text((_bloc.currentState as SearchSuccessState).cartoons[i].name), 115 | ), 116 | Divider() 117 | ], 118 | ), 119 | ); 120 | }), 121 | ) 122 | ], 123 | ), 124 | ); 125 | } 126 | -------------------------------------------------------------------------------- /lib/utils/html_util.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import '../bean/bean.dart'; 4 | import 'package:html/parser.dart' show parse; 5 | import 'package:html/dom.dart'; 6 | import '../constant.dart'; 7 | 8 | class HtmlUtils { 9 | static Future> parseHome(String homeHtml) async { 10 | var cartoons = []; 11 | var doc = parse(homeHtml); 12 | List els = 13 | doc.documentElement.getElementsByClassName("book\ article"); 14 | List as = els?.first.getElementsByTagName("a"); 15 | as.forEach((element) { 16 | List figures = element.getElementsByTagName("figure"); 17 | Element figcaption = 18 | figures.first.getElementsByTagName("figcaption").first; 19 | List ps = figcaption.getElementsByTagName("p"); 20 | String url = element.attributes.values.elementAt(0); 21 | String name = ps.first.innerHtml; 22 | String episode = ps.last.innerHtml; 23 | Element e = figures.first.getElementsByClassName("coverImg").first; 24 | // Map attributes = e.attributes as Map; 25 | String style = e.attributes.values.last; 26 | style.replaceAll(")", ""); 27 | var picture = style.split("(").last; 28 | picture = picture.split(");").first; 29 | Cartoon cartoon = 30 | new Cartoon(url: url, picture: picture, name: name, episode: episode); 31 | cartoons.add(cartoon); 32 | }); 33 | return cartoons; 34 | } 35 | 36 | // static Future> parseCategoryDetail(String homeHtml) async { 37 | // return _parseCategoryDetail(homeHtml); 38 | // } 39 | static List parseCategoryDetail(String html) { 40 | var cartoons = []; 41 | var doc = parse(html); 42 | List els = 43 | doc.documentElement.getElementsByClassName("anime_list"); 44 | if (els.length == 0) return cartoons; 45 | List as = els?.first.getElementsByTagName("dl"); 46 | as.forEach((element) { 47 | List dts = element.getElementsByTagName("dt"); 48 | Element img = dts.first.getElementsByTagName("img").first; 49 | String url = dts.first 50 | .getElementsByTagName("a") 51 | .first 52 | .attributes 53 | .values 54 | .elementAt(0); 55 | List dds = element.getElementsByTagName("dd"); 56 | Element h3 = dds.first.getElementsByTagName("h3").first; 57 | String name = h3.getElementsByTagName("a").first.innerHtml; 58 | var picture = img.attributes.values.elementAt(0); 59 | Cartoon cartoon = new Cartoon(url: url, picture: picture, name: name); 60 | cartoons.add(cartoon); 61 | }); 62 | return cartoons; 63 | } 64 | 65 | static List parseCategoryDetailHome(String html) { 66 | var cartoons = []; 67 | var doc = parse(html); 68 | // List els = 69 | // doc.documentElement.getElementsByClassName("swiper-slide"); 70 | // List picContain = 71 | // doc.documentElement.getElementsByClassName("aside_cen2"); 72 | Element img = doc.documentElement.getElementsByTagName("img")?.first; 73 | var picture; 74 | if (img != null) { 75 | picture = img.attributes.values.elementAt(0); 76 | } 77 | // if (els.length == 0) return cartoons; 78 | List as = doc.documentElement.getElementsByTagName("li"); 79 | as.forEach((element) { 80 | // List dts = element.getElementsByTagName("a"); 81 | List as = element.getElementsByTagName("a"); 82 | if (as != null && as.isNotEmpty) { 83 | as.forEach((a) { 84 | String url = a.attributes.values.elementAt(0); 85 | List ems = a.getElementsByTagName("em"); 86 | if (ems != null && ems.isNotEmpty) { 87 | Element dds = ems.first; 88 | String name = dds.innerHtml; 89 | name = name.replaceAll(RegExp("(.+)<\/span>"), ""); 90 | // Element img = a.getElementsByTagName("img").first; 91 | // 92 | Cartoon cartoon = 93 | new Cartoon(url: url, name: name, picture: picture); 94 | cartoons.add(cartoon); 95 | } 96 | }); 97 | } 98 | }); 99 | return cartoons; 100 | } 101 | 102 | static Future> parseCategory(String html) async { 103 | var categorys = []; 104 | var doc = parse(html); 105 | List tagbox = doc.documentElement.getElementsByClassName("tagbox"); 106 | List taglist = tagbox[2].getElementsByClassName("tag-list"); 107 | List as = taglist?.first.getElementsByTagName("a"); 108 | as.forEach((element) { 109 | var name = element.innerHtml; 110 | if (name.trim().length == 0) name = "日剧"; 111 | var url = element.attributes.values.first; 112 | Category category = new Category(url: url, name: name); 113 | categorys.add(category); 114 | }); 115 | return categorys; 116 | } 117 | 118 | static Future parseDetailList(String html, Function fn) async { 119 | var cartoons = []; 120 | var doc = parse(html); 121 | List swipers = 122 | doc.documentElement.getElementsByClassName("swiper-slide"); 123 | List clears = swipers.first.getElementsByTagName("ul"); 124 | List lis = clears.first.getElementsByTagName("li"); 125 | List details = 126 | doc.documentElement.getElementsByClassName("detail\ con24\ clear"); 127 | List dts = details.first.getElementsByTagName("dt"); 128 | String picture = dts.first 129 | .getElementsByTagName("img") 130 | .first 131 | .attributes 132 | .values 133 | .elementAt(0); 134 | List labels = details.first.getElementsByClassName("d_label2"); 135 | String intro = labels[1].innerHtml; 136 | intro = intro.split("")[1]; 137 | // List as = taglist?.first.getElementsByTagName("a"); 138 | if (lis.isEmpty) { 139 | throw new Exception(); 140 | } 141 | lis.forEach((element) { 142 | Element a = element.getElementsByTagName("a").first; 143 | var name = a.getElementsByTagName("em").first.innerHtml; 144 | name = name.split("")[1]; 145 | var url = a.attributes.values.first; 146 | var episode = ""; 147 | Cartoon value = new Cartoon( 148 | url: url, 149 | name: name, 150 | intro: intro, 151 | picture: picture, 152 | episode: episode); 153 | cartoons.add(value); 154 | }); 155 | await fn(cartoons); 156 | } 157 | 158 | static Future> parseSearch(String html) async { 159 | var cartoons = []; 160 | var doc = parse(html); 161 | Element results = doc.getElementById("results"); 162 | List clears = results.getElementsByClassName("result\ f\ s0"); 163 | if (clears.isNotEmpty) { 164 | clears.forEach((element) { 165 | Element h3 = element.getElementsByTagName("h3").first; 166 | Element a = h3.getElementsByTagName("a").first; 167 | var name = a.innerHtml; 168 | name = name.replaceAll("", ""); 169 | name = name.replaceAll("", ""); 170 | var url = a.attributes.values.elementAt(2); 171 | if (url.contains(ConstantValue.URL)) { 172 | url = url.replaceAll(ConstantValue.URL, ""); 173 | Cartoon value = new Cartoon(url: url, name: name); 174 | cartoons.add(value); 175 | } 176 | }); 177 | } 178 | return cartoons; 179 | } 180 | 181 | static Future parsePlay(String playHtml) async { 182 | var doc = parse(playHtml); 183 | List els = 184 | doc.documentElement.getElementsByClassName("player_main"); 185 | List as = els?.first?.getElementsByTagName("iframe"); 186 | return as.first.attributes.values.elementAt(0); 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /lib/utils/string_util.dart: -------------------------------------------------------------------------------- 1 | List getVideoUrl(str) { 2 | var urls = []; 3 | String mode = 4 | "https?:\\/\\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]*.(swf|wma|avi|flv|mpg|rm|mov|wav|mp4|asf|3gp|mkv|rmvb|m3u8)"; 5 | RegExp reg = new RegExp(mode); 6 | Iterable matches = reg.allMatches(str); 7 | for (Match m in matches) { 8 | urls.add(m.group(0)); 9 | } 10 | return urls; 11 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "0.36.4" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.2.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.0.4" 32 | build: 33 | dependency: transitive 34 | description: 35 | name: build 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.4" 39 | build_config: 40 | dependency: transitive 41 | description: 42 | name: build_config 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "0.4.1" 46 | cached_network_image: 47 | dependency: "direct dev" 48 | description: 49 | name: cached_network_image 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.0.0" 53 | charcode: 54 | dependency: transitive 55 | description: 56 | name: charcode 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "1.1.2" 60 | checked_yaml: 61 | dependency: transitive 62 | description: 63 | name: checked_yaml 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "1.0.1" 67 | collection: 68 | dependency: transitive 69 | description: 70 | name: collection 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "1.14.11" 74 | convert: 75 | dependency: transitive 76 | description: 77 | name: convert 78 | url: "https://pub.flutter-io.cn" 79 | source: hosted 80 | version: "2.1.1" 81 | crypto: 82 | dependency: transitive 83 | description: 84 | name: crypto 85 | url: "https://pub.flutter-io.cn" 86 | source: hosted 87 | version: "2.0.6" 88 | csslib: 89 | dependency: transitive 90 | description: 91 | name: csslib 92 | url: "https://pub.flutter-io.cn" 93 | source: hosted 94 | version: "0.16.1" 95 | cupertino_icons: 96 | dependency: "direct main" 97 | description: 98 | name: cupertino_icons 99 | url: "https://pub.flutter-io.cn" 100 | source: hosted 101 | version: "0.1.2" 102 | dart_style: 103 | dependency: transitive 104 | description: 105 | name: dart_style 106 | url: "https://pub.flutter-io.cn" 107 | source: hosted 108 | version: "1.2.9" 109 | executor: 110 | dependency: transitive 111 | description: 112 | name: executor 113 | url: "https://pub.flutter-io.cn" 114 | source: hosted 115 | version: "2.1.2" 116 | fluro: 117 | dependency: "direct dev" 118 | description: 119 | name: fluro 120 | url: "https://pub.flutter-io.cn" 121 | source: hosted 122 | version: "1.5.0" 123 | flutter: 124 | dependency: "direct main" 125 | description: flutter 126 | source: sdk 127 | version: "0.0.0" 128 | flutter_cache_manager: 129 | dependency: transitive 130 | description: 131 | name: flutter_cache_manager 132 | url: "https://pub.flutter-io.cn" 133 | source: hosted 134 | version: "1.0.0" 135 | flutter_ijkplayer: 136 | dependency: "direct dev" 137 | description: 138 | name: flutter_ijkplayer 139 | url: "https://pub.flutter-io.cn" 140 | source: hosted 141 | version: "0.3.0" 142 | flutter_staggered_grid_view: 143 | dependency: "direct dev" 144 | description: 145 | name: flutter_staggered_grid_view 146 | url: "https://pub.flutter-io.cn" 147 | source: hosted 148 | version: "0.2.7" 149 | flutter_test: 150 | dependency: "direct dev" 151 | description: flutter 152 | source: sdk 153 | version: "0.0.0" 154 | flutter_webview_plugin: 155 | dependency: "direct dev" 156 | description: 157 | name: flutter_webview_plugin 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "0.3.5" 161 | front_end: 162 | dependency: transitive 163 | description: 164 | name: front_end 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "0.1.19" 168 | glob: 169 | dependency: transitive 170 | description: 171 | name: glob 172 | url: "https://pub.flutter-io.cn" 173 | source: hosted 174 | version: "1.1.7" 175 | html: 176 | dependency: "direct dev" 177 | description: 178 | name: html 179 | url: "https://pub.flutter-io.cn" 180 | source: hosted 181 | version: "0.14.0+2" 182 | http: 183 | dependency: transitive 184 | description: 185 | name: http 186 | url: "https://pub.flutter-io.cn" 187 | source: hosted 188 | version: "0.12.0+2" 189 | http_client: 190 | dependency: "direct dev" 191 | description: 192 | name: http_client 193 | url: "https://pub.flutter-io.cn" 194 | source: hosted 195 | version: "0.5.1" 196 | http_parser: 197 | dependency: transitive 198 | description: 199 | name: http_parser 200 | url: "https://pub.flutter-io.cn" 201 | source: hosted 202 | version: "3.1.3" 203 | json_annotation: 204 | dependency: "direct main" 205 | description: 206 | name: json_annotation 207 | url: "https://pub.flutter-io.cn" 208 | source: hosted 209 | version: "2.3.0" 210 | json_serializable: 211 | dependency: "direct dev" 212 | description: 213 | name: json_serializable 214 | url: "https://pub.flutter-io.cn" 215 | source: hosted 216 | version: "2.3.0" 217 | kernel: 218 | dependency: transitive 219 | description: 220 | name: kernel 221 | url: "https://pub.flutter-io.cn" 222 | source: hosted 223 | version: "0.3.19" 224 | logging: 225 | dependency: transitive 226 | description: 227 | name: logging 228 | url: "https://pub.flutter-io.cn" 229 | source: hosted 230 | version: "0.11.3+2" 231 | matcher: 232 | dependency: transitive 233 | description: 234 | name: matcher 235 | url: "https://pub.flutter-io.cn" 236 | source: hosted 237 | version: "0.12.5" 238 | meta: 239 | dependency: transitive 240 | description: 241 | name: meta 242 | url: "https://pub.flutter-io.cn" 243 | source: hosted 244 | version: "1.1.6" 245 | package_config: 246 | dependency: transitive 247 | description: 248 | name: package_config 249 | url: "https://pub.flutter-io.cn" 250 | source: hosted 251 | version: "1.0.5" 252 | path: 253 | dependency: transitive 254 | description: 255 | name: path 256 | url: "https://pub.flutter-io.cn" 257 | source: hosted 258 | version: "1.6.2" 259 | path_provider: 260 | dependency: transitive 261 | description: 262 | name: path_provider 263 | url: "https://pub.flutter-io.cn" 264 | source: hosted 265 | version: "1.1.2" 266 | pedantic: 267 | dependency: transitive 268 | description: 269 | name: pedantic 270 | url: "https://pub.flutter-io.cn" 271 | source: hosted 272 | version: "1.7.0" 273 | pub_semver: 274 | dependency: transitive 275 | description: 276 | name: pub_semver 277 | url: "https://pub.flutter-io.cn" 278 | source: hosted 279 | version: "1.4.2" 280 | pubspec_parse: 281 | dependency: transitive 282 | description: 283 | name: pubspec_parse 284 | url: "https://pub.flutter-io.cn" 285 | source: hosted 286 | version: "0.1.4" 287 | quiver: 288 | dependency: transitive 289 | description: 290 | name: quiver 291 | url: "https://pub.flutter-io.cn" 292 | source: hosted 293 | version: "2.0.3" 294 | sky_engine: 295 | dependency: transitive 296 | description: flutter 297 | source: sdk 298 | version: "0.0.99" 299 | source_gen: 300 | dependency: transitive 301 | description: 302 | name: source_gen 303 | url: "https://pub.flutter-io.cn" 304 | source: hosted 305 | version: "0.9.4+2" 306 | source_span: 307 | dependency: transitive 308 | description: 309 | name: source_span 310 | url: "https://pub.flutter-io.cn" 311 | source: hosted 312 | version: "1.5.5" 313 | sqflite: 314 | dependency: "direct dev" 315 | description: 316 | name: sqflite 317 | url: "https://pub.flutter-io.cn" 318 | source: hosted 319 | version: "1.1.6+1" 320 | stack_trace: 321 | dependency: transitive 322 | description: 323 | name: stack_trace 324 | url: "https://pub.flutter-io.cn" 325 | source: hosted 326 | version: "1.9.3" 327 | stream_channel: 328 | dependency: transitive 329 | description: 330 | name: stream_channel 331 | url: "https://pub.flutter-io.cn" 332 | source: hosted 333 | version: "2.0.0" 334 | string_scanner: 335 | dependency: transitive 336 | description: 337 | name: string_scanner 338 | url: "https://pub.flutter-io.cn" 339 | source: hosted 340 | version: "1.0.4" 341 | synchronized: 342 | dependency: transitive 343 | description: 344 | name: synchronized 345 | url: "https://pub.flutter-io.cn" 346 | source: hosted 347 | version: "2.1.0+1" 348 | term_glyph: 349 | dependency: transitive 350 | description: 351 | name: term_glyph 352 | url: "https://pub.flutter-io.cn" 353 | source: hosted 354 | version: "1.1.0" 355 | test_api: 356 | dependency: transitive 357 | description: 358 | name: test_api 359 | url: "https://pub.flutter-io.cn" 360 | source: hosted 361 | version: "0.2.5" 362 | typed_data: 363 | dependency: transitive 364 | description: 365 | name: typed_data 366 | url: "https://pub.flutter-io.cn" 367 | source: hosted 368 | version: "1.1.6" 369 | url_launcher: 370 | dependency: "direct dev" 371 | description: 372 | name: url_launcher 373 | url: "https://pub.flutter-io.cn" 374 | source: hosted 375 | version: "4.2.0+3" 376 | uuid: 377 | dependency: transitive 378 | description: 379 | name: uuid 380 | url: "https://pub.flutter-io.cn" 381 | source: hosted 382 | version: "2.0.2" 383 | vector_math: 384 | dependency: transitive 385 | description: 386 | name: vector_math 387 | url: "https://pub.flutter-io.cn" 388 | source: hosted 389 | version: "2.0.8" 390 | watcher: 391 | dependency: transitive 392 | description: 393 | name: watcher 394 | url: "https://pub.flutter-io.cn" 395 | source: hosted 396 | version: "0.9.7+10" 397 | yaml: 398 | dependency: transitive 399 | description: 400 | name: yaml 401 | url: "https://pub.flutter-io.cn" 402 | source: hosted 403 | version: "2.1.16" 404 | sdks: 405 | dart: ">=2.3.0 <3.0.0" 406 | flutter: ">=1.2.1 <2.0.0" 407 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dilidili 2 | description: A new Flutter project. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | flutter_bloc: ^0.19.1 8 | equatable: ^0.3.0 9 | 10 | # The following adds the Cupertino Icons font to your application. 11 | # Use with the CupertinoIcons class for iOS style icons. 12 | cupertino_icons: ^0.1.0 13 | json_annotation: ^2.0.0 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | http_client: ^0.5.0 19 | html: any 20 | cached_network_image: ^1.0.0 21 | fluro: any 22 | sqflite: ^1.1.6+2 23 | json_serializable: ^2.0.1 24 | flutter_webview_plugin: ^0.3.5 25 | flutter_ijkplayer: ^0.3.1 26 | 27 | # flutter_gsyplayer: 28 | # git: 29 | # url: git://github.com/crazecoder/flutter_gsyplayer.git 30 | 31 | # For information on the generic Dart part of this file, see the 32 | # following page: https://www.dartlang.org/tools/pub/pubspec 33 | 34 | # The following section is specific to Flutter. 35 | flutter: 36 | 37 | # The following line ensures that the Material Icons font is 38 | # included with your application, so that you can use the icons in 39 | # the material Icons class. 40 | uses-material-design: true 41 | 42 | # To add assets to your application, add an assets section, like this: 43 | assets: 44 | - assets/demo.db 45 | # - images/a_dot_burr.jpeg 46 | # - images/a_dot_ham.jpeg 47 | 48 | # An image asset can refer to one or more resolution-specific "variants", see 49 | # https://flutter.io/assets-and-images/#resolution-aware. 50 | 51 | # For details regarding adding assets from package dependencies, see 52 | # https://flutter.io/assets-and-images/#from-packages 53 | 54 | # To add custom fonts to your application, add a fonts section here, 55 | # in this "flutter" section. Each entry in this list should have a 56 | # "family" key with the font family name, and a "fonts" key with a 57 | # list giving the asset and other descriptors for the font. For 58 | # example: 59 | # fonts: 60 | # - family: Schyler 61 | # fonts: 62 | # - asset: fonts/Schyler-Regular.ttf 63 | # - asset: fonts/Schyler-Italic.ttf 64 | # style: italic 65 | # - family: Trajan Pro 66 | # fonts: 67 | # - asset: fonts/TrajanPro.ttf 68 | # - asset: fonts/TrajanPro_Bold.ttf 69 | # weight: 700 70 | # 71 | # For details regarding fonts from package dependencies, 72 | # see https://flutter.io/custom-fonts/#from-packages 73 | -------------------------------------------------------------------------------- /screenshot/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crazecoder/dilidili/835a49b2849947d2f64bdcdb2690c3c6f134c9ca/screenshot/screen.png -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:dilidili/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 | --------------------------------------------------------------------------------