├── .gitignore ├── .metadata ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── winlee │ │ │ │ └── com │ │ │ │ └── my_wanandroid │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── logo.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── images └── logo.png ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ ├── Flutter.podspec │ ├── Release.xcconfig │ └── flutter_export_environment.sh ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings └── 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 ├── dao │ ├── home_article_dao.dart │ ├── home_banner_dao.dart │ ├── login_dao.dart │ ├── navi_dao.dart │ ├── project_item_dao.dart │ ├── project_tab_dao.dart │ ├── register_dao.dart │ ├── tree_dao.dart │ └── tree_item_dao.dart ├── http │ └── API.dart ├── main.dart ├── model │ ├── BaseModel.dart │ ├── article_model.dart │ ├── home_banner_model.dart │ ├── navi_model.dart │ ├── project_tab_model.dart │ └── tree_model.dart ├── navigationbar │ └── navigation_bar_tab.dart ├── page │ ├── home_page.dart │ ├── login_page.dart │ ├── navi_page.dart │ ├── project_page.dart │ ├── regist_page.dart │ └── tree_page.dart ├── utils │ ├── images_provider.dart │ └── prefs_provider.dart └── widget │ ├── article_card.dart │ ├── home_drawer.dart │ ├── project_card.dart │ ├── project_item_page.dart │ ├── tree_item_page.dart │ └── webview.dart ├── pubspec.lock ├── pubspec.yaml ├── source └── img │ ├── drawer.png │ ├── h5.png │ ├── 体系.png │ ├── 导航.png │ ├── 项目.png │ └── 首页.png └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /.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: b593f5167bce84fb3cad5c258477bf3abc1b14eb 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter-WanAndroid 2 | 3 | 根据玩安卓开放API写的flutter项目 4 | 5 | ## 项目实现功能 6 | 7 | 项目分为以下几个模块分别为:首页、项目、体系、导航、用户中心(侧拉菜单)。 8 | 9 | > 首页 :主要实现banner和首页文章列表以及侧拉菜单的用户个人中心。 10 | 11 | > 项目 :主要实现的是项目分类以及项目列表数据,使用瀑布流模式实现。 12 | 13 | > 体系 :主要实现的是体系数据和知识体系下文章,包括基础知识、开发环境、常用控件等等。 14 | 15 | > 导航 :主要实现的是网站导航数据,包括常用网站、开发社区、个人博客、开放平台等等。 16 | 17 | > 侧拉菜单 :主要实现的是用户中心功能,包括注册、登录、注销、收藏等等 18 | 19 | ## 使用插件 20 | 21 | - [flutter_swiper](https://pub.dev/packages/flutter_swiper) 22 | - [flutter_webview_plugin](https://pub.dev/packages/flutter_webview_plugin) 23 | - [http](https://pub.dev/packages/http) 24 | - [toast](https://pub.dev/packages/toast) 25 | - [shared_preferences](https://pub.dev/packages/shared_preferences) 26 | - [flutter_staggered_grid_view](https://github.com/letsar/flutter_staggered_grid_view) 27 | 28 | ## 项目截图 29 | 30 | ![](source/img/首页.png) |![](source/img/项目.png) | ![](source/img/体系.png) 31 | :-------------------------:|:-------------------------:|:-------------------------: 32 | ![](source/img/导航.png) |![](source/img/h5.png) | ![](source/img/drawer.png) 33 | 34 | 35 | ## TODO 36 | 37 | 38 | > 收藏功能。 39 | 40 | > 个人中心功能优化 41 | 42 | > 启动页面 43 | 44 | 45 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "winlee.com.my_wanandroid" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 10 | 11 | 15 | 22 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/winlee/com/my_wanandroid/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package winlee.com.my_wanandroid 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/android/app/src/main/res/mipmap-xxhdpi/logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.0' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableJetifier=true 3 | android.useAndroidX=true 4 | android.enableR8=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/images/logo.png -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Flutter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: This podspec is NOT to be published. It is only used as a local source! 3 | # 4 | 5 | Pod::Spec.new do |s| 6 | s.name = 'Flutter' 7 | s.version = '1.0.0' 8 | s.summary = 'High-performance, high-fidelity mobile apps.' 9 | s.description = <<-DESC 10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. 11 | DESC 12 | s.homepage = 'https://flutter.io' 13 | s.license = { :type => 'MIT' } 14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } 15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } 16 | s.ios.deployment_target = '8.0' 17 | s.vendored_frameworks = 'Flutter.framework' 18 | end 19 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=/Users/ppd-03020339/flutter/flutter" 4 | export "FLUTTER_APPLICATION_PATH=/Users/ppd-03020339/flutter/github/flutter_wanandroid" 5 | export "FLUTTER_TARGET=/Users/ppd-03020339/flutter/github/flutter_wanandroid/lib/main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build/ios" 8 | export "FLUTTER_FRAMEWORK_DIR=/Users/ppd-03020339/flutter/flutter/bin/cache/artifacts/engine/ios" 9 | export "FLUTTER_BUILD_NAME=1.0.0" 10 | export "FLUTTER_BUILD_NUMBER=1" 11 | export "TRACK_WIDGET_CREATION=true" 12 | -------------------------------------------------------------------------------- /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 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 37 | # referring to absolute paths on developers' machines. 38 | system('rm -rf .symlinks') 39 | system('mkdir -p .symlinks/plugins') 40 | 41 | # Flutter Pods 42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 43 | if generated_xcode_build_settings.empty? 44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." 45 | end 46 | generated_xcode_build_settings.map { |p| 47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 48 | symlink = File.join('.symlinks', 'flutter') 49 | File.symlink(File.dirname(p[:path]), symlink) 50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 51 | end 52 | } 53 | 54 | # Plugin Pods 55 | plugin_pods = parse_KV_file('../.flutter-plugins') 56 | plugin_pods.map { |p| 57 | symlink = File.join('.symlinks', 'plugins', p[:name]) 58 | File.symlink(p[:path], symlink) 59 | pod p[:name], :path => File.join(symlink, 'ios') 60 | } 61 | end 62 | 63 | post_install do |installer| 64 | installer.pods_project.targets.each do |target| 65 | target.build_configurations.each do |config| 66 | config.build_settings['ENABLE_BITCODE'] = 'NO' 67 | end 68 | end 69 | end 70 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_webview_plugin (0.0.1): 4 | - Flutter 5 | - shared_preferences (0.0.1): 6 | - Flutter 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `.symlinks/flutter/ios`) 10 | - flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`) 11 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) 12 | 13 | EXTERNAL SOURCES: 14 | Flutter: 15 | :path: ".symlinks/flutter/ios" 16 | flutter_webview_plugin: 17 | :path: ".symlinks/plugins/flutter_webview_plugin/ios" 18 | shared_preferences: 19 | :path: ".symlinks/plugins/shared_preferences/ios" 20 | 21 | SPEC CHECKSUMS: 22 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 23 | flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694 24 | shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523 25 | 26 | PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09 27 | 28 | COCOAPODS: 1.8.4 29 | -------------------------------------------------------------------------------- /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 | 0C3BDE2FDBD019BFC82B8B9E /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CDBE9B608E270B1DC66BC7FC /* libPods-Runner.a */; }; 11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = ""; 30 | dstSubfolderSpec = 10; 31 | files = ( 32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 34 | ); 35 | name = "Embed Frameworks"; 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 43 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 44 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 45 | 426774A32A9A6C709FF9D3FB /* 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 = ""; }; 46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 8A14A81ED94C22C49E9EF258 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | CDBE9B608E270B1DC66BC7FC /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | D2D08A6C7D1E5B039FE9B962 /* 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 = ""; }; 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 | 0C3BDE2FDBD019BFC82B8B9E /* libPods-Runner.a in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 1426D2D36D9306B79719F2F4 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | CDBE9B608E270B1DC66BC7FC /* 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 | E4AE1DDD2F9E18D20A074FE2 /* Pods */, 105 | 1426D2D36D9306B79719F2F4 /* 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 | E4AE1DDD2F9E18D20A074FE2 /* Pods */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 426774A32A9A6C709FF9D3FB /* Pods-Runner.debug.xcconfig */, 145 | D2D08A6C7D1E5B039FE9B962 /* Pods-Runner.release.xcconfig */, 146 | 8A14A81ED94C22C49E9EF258 /* Pods-Runner.profile.xcconfig */, 147 | ); 148 | name = Pods; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 97C146ED1CF9000F007C117D /* Runner */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 157 | buildPhases = ( 158 | 189504677EBE0DF0A53178CC /* [CP] Check Pods Manifest.lock */, 159 | 9740EEB61CF901F6004384FC /* Run Script */, 160 | 97C146EA1CF9000F007C117D /* Sources */, 161 | 97C146EB1CF9000F007C117D /* Frameworks */, 162 | 97C146EC1CF9000F007C117D /* Resources */, 163 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 164 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 165 | 59950DED49BBC63CA868C101 /* [CP] Embed Pods Frameworks */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | ); 171 | name = Runner; 172 | productName = Runner; 173 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 174 | productType = "com.apple.product-type.application"; 175 | }; 176 | /* End PBXNativeTarget section */ 177 | 178 | /* Begin PBXProject section */ 179 | 97C146E61CF9000F007C117D /* Project object */ = { 180 | isa = PBXProject; 181 | attributes = { 182 | LastUpgradeCheck = 0910; 183 | ORGANIZATIONNAME = "The Chromium Authors"; 184 | TargetAttributes = { 185 | 97C146ED1CF9000F007C117D = { 186 | CreatedOnToolsVersion = 7.3.1; 187 | }; 188 | }; 189 | }; 190 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 191 | compatibilityVersion = "Xcode 3.2"; 192 | developmentRegion = English; 193 | hasScannedForEncodings = 0; 194 | knownRegions = ( 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 97C146E51CF9000F007C117D; 199 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 97C146ED1CF9000F007C117D /* Runner */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | 97C146EC1CF9000F007C117D /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard 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 | 189504677EBE0DF0A53178CC /* [CP] Check Pods Manifest.lock */ = { 225 | isa = PBXShellScriptBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | ); 229 | inputFileListPaths = ( 230 | ); 231 | inputPaths = ( 232 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 233 | "${PODS_ROOT}/Manifest.lock", 234 | ); 235 | name = "[CP] Check Pods Manifest.lock"; 236 | outputFileListPaths = ( 237 | ); 238 | outputPaths = ( 239 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | 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"; 244 | showEnvVarsInLog = 0; 245 | }; 246 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 247 | isa = PBXShellScriptBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | inputPaths = ( 252 | ); 253 | name = "Thin Binary"; 254 | outputPaths = ( 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | shellPath = /bin/sh; 258 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 259 | }; 260 | 59950DED49BBC63CA868C101 /* [CP] Embed Pods Frameworks */ = { 261 | isa = PBXShellScriptBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | inputPaths = ( 266 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 267 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 268 | ); 269 | name = "[CP] Embed Pods Frameworks"; 270 | outputPaths = ( 271 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | shellPath = /bin/sh; 275 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 276 | showEnvVarsInLog = 0; 277 | }; 278 | 9740EEB61CF901F6004384FC /* Run Script */ = { 279 | isa = PBXShellScriptBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | inputPaths = ( 284 | ); 285 | name = "Run Script"; 286 | outputPaths = ( 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | shellPath = /bin/sh; 290 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 291 | }; 292 | /* End PBXShellScriptBuildPhase section */ 293 | 294 | /* Begin PBXSourcesBuildPhase section */ 295 | 97C146EA1CF9000F007C117D /* Sources */ = { 296 | isa = PBXSourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 300 | 97C146F31CF9000F007C117D /* main.m in Sources */, 301 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | /* End PBXSourcesBuildPhase section */ 306 | 307 | /* Begin PBXVariantGroup section */ 308 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 309 | isa = PBXVariantGroup; 310 | children = ( 311 | 97C146FB1CF9000F007C117D /* Base */, 312 | ); 313 | name = Main.storyboard; 314 | sourceTree = ""; 315 | }; 316 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 317 | isa = PBXVariantGroup; 318 | children = ( 319 | 97C147001CF9000F007C117D /* Base */, 320 | ); 321 | name = LaunchScreen.storyboard; 322 | sourceTree = ""; 323 | }; 324 | /* End PBXVariantGroup section */ 325 | 326 | /* Begin XCBuildConfiguration section */ 327 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 328 | isa = XCBuildConfiguration; 329 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 330 | buildSettings = { 331 | ALWAYS_SEARCH_USER_PATHS = NO; 332 | CLANG_ANALYZER_NONNULL = YES; 333 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 334 | CLANG_CXX_LIBRARY = "libc++"; 335 | CLANG_ENABLE_MODULES = YES; 336 | CLANG_ENABLE_OBJC_ARC = YES; 337 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 338 | CLANG_WARN_BOOL_CONVERSION = YES; 339 | CLANG_WARN_COMMA = YES; 340 | CLANG_WARN_CONSTANT_CONVERSION = YES; 341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 342 | CLANG_WARN_EMPTY_BODY = YES; 343 | CLANG_WARN_ENUM_CONVERSION = YES; 344 | CLANG_WARN_INFINITE_RECURSION = YES; 345 | CLANG_WARN_INT_CONVERSION = YES; 346 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 347 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 349 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 350 | CLANG_WARN_STRICT_PROTOTYPES = YES; 351 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 357 | ENABLE_NS_ASSERTIONS = NO; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_NO_COMMON_BLOCKS = YES; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 368 | MTL_ENABLE_DEBUG_INFO = NO; 369 | SDKROOT = iphoneos; 370 | TARGETED_DEVICE_FAMILY = "1,2"; 371 | VALIDATE_PRODUCT = YES; 372 | }; 373 | name = Profile; 374 | }; 375 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 376 | isa = XCBuildConfiguration; 377 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 378 | buildSettings = { 379 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 380 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 381 | DEVELOPMENT_TEAM = S8QB4VV633; 382 | ENABLE_BITCODE = NO; 383 | FRAMEWORK_SEARCH_PATHS = ( 384 | "$(inherited)", 385 | "$(PROJECT_DIR)/Flutter", 386 | ); 387 | INFOPLIST_FILE = Runner/Info.plist; 388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 389 | LIBRARY_SEARCH_PATHS = ( 390 | "$(inherited)", 391 | "$(PROJECT_DIR)/Flutter", 392 | ); 393 | PRODUCT_BUNDLE_IDENTIFIER = winlee.com.myWanandroid; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | VERSIONING_SYSTEM = "apple-generic"; 396 | }; 397 | name = Profile; 398 | }; 399 | 97C147031CF9000F007C117D /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 402 | buildSettings = { 403 | ALWAYS_SEARCH_USER_PATHS = NO; 404 | CLANG_ANALYZER_NONNULL = YES; 405 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 406 | CLANG_CXX_LIBRARY = "libc++"; 407 | CLANG_ENABLE_MODULES = YES; 408 | CLANG_ENABLE_OBJC_ARC = YES; 409 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 410 | CLANG_WARN_BOOL_CONVERSION = YES; 411 | CLANG_WARN_COMMA = YES; 412 | CLANG_WARN_CONSTANT_CONVERSION = YES; 413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 414 | CLANG_WARN_EMPTY_BODY = YES; 415 | CLANG_WARN_ENUM_CONVERSION = YES; 416 | CLANG_WARN_INFINITE_RECURSION = YES; 417 | CLANG_WARN_INT_CONVERSION = YES; 418 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 419 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 421 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 422 | CLANG_WARN_STRICT_PROTOTYPES = YES; 423 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 424 | CLANG_WARN_UNREACHABLE_CODE = YES; 425 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 426 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 427 | COPY_PHASE_STRIP = NO; 428 | DEBUG_INFORMATION_FORMAT = dwarf; 429 | ENABLE_STRICT_OBJC_MSGSEND = YES; 430 | ENABLE_TESTABILITY = YES; 431 | GCC_C_LANGUAGE_STANDARD = gnu99; 432 | GCC_DYNAMIC_NO_PIC = NO; 433 | GCC_NO_COMMON_BLOCKS = YES; 434 | GCC_OPTIMIZATION_LEVEL = 0; 435 | GCC_PREPROCESSOR_DEFINITIONS = ( 436 | "DEBUG=1", 437 | "$(inherited)", 438 | ); 439 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 440 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 441 | GCC_WARN_UNDECLARED_SELECTOR = YES; 442 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 443 | GCC_WARN_UNUSED_FUNCTION = YES; 444 | GCC_WARN_UNUSED_VARIABLE = YES; 445 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 446 | MTL_ENABLE_DEBUG_INFO = YES; 447 | ONLY_ACTIVE_ARCH = YES; 448 | SDKROOT = iphoneos; 449 | TARGETED_DEVICE_FAMILY = "1,2"; 450 | }; 451 | name = Debug; 452 | }; 453 | 97C147041CF9000F007C117D /* Release */ = { 454 | isa = XCBuildConfiguration; 455 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 456 | buildSettings = { 457 | ALWAYS_SEARCH_USER_PATHS = NO; 458 | CLANG_ANALYZER_NONNULL = YES; 459 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 460 | CLANG_CXX_LIBRARY = "libc++"; 461 | CLANG_ENABLE_MODULES = YES; 462 | CLANG_ENABLE_OBJC_ARC = YES; 463 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 464 | CLANG_WARN_BOOL_CONVERSION = YES; 465 | CLANG_WARN_COMMA = YES; 466 | CLANG_WARN_CONSTANT_CONVERSION = YES; 467 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 468 | CLANG_WARN_EMPTY_BODY = YES; 469 | CLANG_WARN_ENUM_CONVERSION = YES; 470 | CLANG_WARN_INFINITE_RECURSION = YES; 471 | CLANG_WARN_INT_CONVERSION = YES; 472 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 473 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 474 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 475 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 476 | CLANG_WARN_STRICT_PROTOTYPES = YES; 477 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 478 | CLANG_WARN_UNREACHABLE_CODE = YES; 479 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 480 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 481 | COPY_PHASE_STRIP = NO; 482 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 483 | ENABLE_NS_ASSERTIONS = NO; 484 | ENABLE_STRICT_OBJC_MSGSEND = YES; 485 | GCC_C_LANGUAGE_STANDARD = gnu99; 486 | GCC_NO_COMMON_BLOCKS = YES; 487 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 488 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 489 | GCC_WARN_UNDECLARED_SELECTOR = YES; 490 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 491 | GCC_WARN_UNUSED_FUNCTION = YES; 492 | GCC_WARN_UNUSED_VARIABLE = YES; 493 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 494 | MTL_ENABLE_DEBUG_INFO = NO; 495 | SDKROOT = iphoneos; 496 | TARGETED_DEVICE_FAMILY = "1,2"; 497 | VALIDATE_PRODUCT = YES; 498 | }; 499 | name = Release; 500 | }; 501 | 97C147061CF9000F007C117D /* Debug */ = { 502 | isa = XCBuildConfiguration; 503 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 504 | buildSettings = { 505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 506 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 507 | ENABLE_BITCODE = NO; 508 | FRAMEWORK_SEARCH_PATHS = ( 509 | "$(inherited)", 510 | "$(PROJECT_DIR)/Flutter", 511 | ); 512 | INFOPLIST_FILE = Runner/Info.plist; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 514 | LIBRARY_SEARCH_PATHS = ( 515 | "$(inherited)", 516 | "$(PROJECT_DIR)/Flutter", 517 | ); 518 | PRODUCT_BUNDLE_IDENTIFIER = winlee.com.myWanandroid; 519 | PRODUCT_NAME = "$(TARGET_NAME)"; 520 | VERSIONING_SYSTEM = "apple-generic"; 521 | }; 522 | name = Debug; 523 | }; 524 | 97C147071CF9000F007C117D /* Release */ = { 525 | isa = XCBuildConfiguration; 526 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 527 | buildSettings = { 528 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 529 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 530 | ENABLE_BITCODE = NO; 531 | FRAMEWORK_SEARCH_PATHS = ( 532 | "$(inherited)", 533 | "$(PROJECT_DIR)/Flutter", 534 | ); 535 | INFOPLIST_FILE = Runner/Info.plist; 536 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 537 | LIBRARY_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "$(PROJECT_DIR)/Flutter", 540 | ); 541 | PRODUCT_BUNDLE_IDENTIFIER = winlee.com.myWanandroid; 542 | PRODUCT_NAME = "$(TARGET_NAME)"; 543 | VERSIONING_SYSTEM = "apple-generic"; 544 | }; 545 | name = Release; 546 | }; 547 | /* End XCBuildConfiguration section */ 548 | 549 | /* Begin XCConfigurationList section */ 550 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 97C147031CF9000F007C117D /* Debug */, 554 | 97C147041CF9000F007C117D /* Release */, 555 | 249021D3217E4FDB00AE95B9 /* Profile */, 556 | ); 557 | defaultConfigurationIsVisible = 0; 558 | defaultConfigurationName = Release; 559 | }; 560 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 561 | isa = XCConfigurationList; 562 | buildConfigurations = ( 563 | 97C147061CF9000F007C117D /* Debug */, 564 | 97C147071CF9000F007C117D /* Release */, 565 | 249021D4217E4FDB00AE95B9 /* Profile */, 566 | ); 567 | defaultConfigurationIsVisible = 0; 568 | defaultConfigurationName = Release; 569 | }; 570 | /* End XCConfigurationList section */ 571 | }; 572 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 573 | } 574 | -------------------------------------------------------------------------------- /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.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/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 | my_wanandroid 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/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/dao/home_article_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:my_wanandroid/http/API.dart'; 5 | import 'package:my_wanandroid/model/article_model.dart'; 6 | 7 | class HomeArticleDao { 8 | static Future fetch(int offset) async { 9 | var result = await http 10 | .get(API.HOME_ARTICLE_URL_BEFORE + offset.toString() + API.HOME_ARTICLE_URL_AFTER); 11 | if (result?.statusCode == 200) { 12 | Utf8Decoder utf8decoder = new Utf8Decoder(); 13 | var model = json.decode(utf8decoder.convert(result.bodyBytes)); 14 | var finalModel = ArticleModel.fromJson(model); 15 | if (finalModel.errorCode == 0) { 16 | return finalModel; 17 | } else { 18 | throw Exception('服务器异常'); 19 | } 20 | } else { 21 | throw Exception('网络错误'); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/dao/home_banner_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | 4 | import 'package:http/http.dart' as http; 5 | import 'package:my_wanandroid/http/API.dart'; 6 | import 'package:my_wanandroid/model/home_banner_model.dart'; 7 | 8 | class HomeBannerDao { 9 | static Future fetch() async { 10 | var homeModel = await http.get(API.HOME_BANNER_URL); 11 | if (homeModel?.statusCode == 200) { 12 | Utf8Decoder utf8decoder = new Utf8Decoder(); 13 | var result = json.decode(utf8decoder.convert(homeModel.bodyBytes)); 14 | var model = HomeBannerModel.fromJson(result); 15 | if (model.errorCode == 0) { 16 | return model; 17 | } else { 18 | throw new Exception("服务器异常"); 19 | } 20 | } else { 21 | throw new Exception("网络错误"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/dao/login_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | 4 | import 'package:http/http.dart' as http; 5 | import 'package:my_wanandroid/http/API.dart'; 6 | import 'package:my_wanandroid/model/BaseModel.dart'; 7 | 8 | class LoginDao { 9 | static Future fetch(String name, String password) async { 10 | // Map params = LinkedHashMap(); 11 | // params.putIfAbsent("username", () => name); 12 | // params.putIfAbsent("password", () => password); 13 | var result = await http.post(API.LOGIN_URL, body: {'username': name, 'password': password}); 14 | if (result.statusCode == 200) { 15 | Utf8Decoder utf8decoder = new Utf8Decoder(); 16 | var convert = json.decode(utf8decoder.convert(result.bodyBytes)); 17 | var model = BaseModel.fromJson(convert); 18 | print("=====model=====$model"); 19 | if (model.errorCode == 0) { 20 | return model; 21 | } else { 22 | throw Exception(model.errorMsg); 23 | } 24 | } else { 25 | throw Exception('网络异常'); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/dao/navi_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:my_wanandroid/http/API.dart'; 5 | import 'package:my_wanandroid/model/navi_model.dart'; 6 | import 'package:my_wanandroid/model/project_tab_model.dart'; 7 | 8 | class NaviDao { 9 | static Future fetch() async { 10 | var result = await http.get(API.NAVI_URL); 11 | if (result?.statusCode == 200) { 12 | Utf8Decoder utf8decoder = new Utf8Decoder(); 13 | var model = json.decode(utf8decoder.convert(result.bodyBytes)); 14 | var finalModel = NaviModel.fromJson(model); 15 | if (finalModel.errorCode == 0) { 16 | return finalModel; 17 | } else { 18 | throw Exception('服务器异常'); 19 | } 20 | } else { 21 | throw Exception('网络错误'); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/dao/project_item_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:my_wanandroid/http/API.dart'; 5 | import 'package:my_wanandroid/model/article_model.dart'; 6 | 7 | class ProjectItemDao { 8 | static Future fetch(int offset, int cid) async { 9 | var result = await http.get(API.PROJECT_PAGE_URL_BEFORE + 10 | offset.toString() + 11 | API.PROJECT_PAGE_URL_AFTER + 12 | cid.toString()); 13 | if (result?.statusCode == 200) { 14 | Utf8Decoder utf8decoder = new Utf8Decoder(); 15 | var model = json.decode(utf8decoder.convert(result.bodyBytes)); 16 | var finalModel = ArticleModel.fromJson(model); 17 | if (finalModel.errorCode == 0) { 18 | return finalModel; 19 | } else { 20 | throw Exception('服务器异常'); 21 | } 22 | } else { 23 | throw Exception('网络错误'); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/dao/project_tab_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:my_wanandroid/http/API.dart'; 5 | import 'package:my_wanandroid/model/project_tab_model.dart'; 6 | 7 | class ProjectTabDao { 8 | static Future fetch() async { 9 | var result = await http.get(API.PROJECT_TAB_URL); 10 | if (result?.statusCode == 200) { 11 | Utf8Decoder utf8decoder = new Utf8Decoder(); 12 | var model = json.decode(utf8decoder.convert(result.bodyBytes)); 13 | var finalModel = ProjectTabModel.fromJson(model); 14 | if (finalModel.errorCode == 0) { 15 | return finalModel; 16 | } else { 17 | throw Exception('服务器异常'); 18 | } 19 | } else { 20 | throw Exception('网络错误'); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/dao/register_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | 4 | import 'package:http/http.dart' as http; 5 | import 'package:my_wanandroid/http/API.dart'; 6 | import 'package:my_wanandroid/model/BaseModel.dart'; 7 | 8 | class RegisterDao { 9 | static Future fetch( 10 | String name, String password, String repassword) async { 11 | // Map params = LinkedHashMap(); 12 | // params.putIfAbsent("username", () => name); 13 | // params.putIfAbsent("password", () => password); 14 | var result = await http.post(API.REGISTER_URL, body: { 15 | 'username': name, 16 | 'password': password, 17 | 'repassword': repassword 18 | }); 19 | if (result.statusCode == 200) { 20 | Utf8Decoder utf8decoder = new Utf8Decoder(); 21 | var convert = json.decode(utf8decoder.convert(result.bodyBytes)); 22 | var model = BaseModel.fromJson(convert); 23 | print("=====model=====$model"); 24 | if (model.errorCode == 0) { 25 | return model; 26 | } else { 27 | throw Exception(model.errorMsg); 28 | } 29 | } else { 30 | throw Exception('网络异常'); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/dao/tree_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:my_wanandroid/http/API.dart'; 5 | import 'package:my_wanandroid/model/project_tab_model.dart'; 6 | import 'package:my_wanandroid/model/tree_model.dart'; 7 | 8 | class TreeDao { 9 | static Future fetch() async { 10 | var result = await http.get(API.TREE_URL); 11 | if (result?.statusCode == 200) { 12 | Utf8Decoder utf8decoder = new Utf8Decoder(); 13 | var model = json.decode(utf8decoder.convert(result.bodyBytes)); 14 | var finalModel = TreeModel.fromJson(model); 15 | if (finalModel.errorCode == 0) { 16 | return finalModel; 17 | } else { 18 | throw Exception('服务器异常'); 19 | } 20 | } else { 21 | throw Exception('网络错误'); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/dao/tree_item_dao.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:my_wanandroid/http/API.dart'; 5 | import 'package:my_wanandroid/model/article_model.dart'; 6 | 7 | class TreeItemDao { 8 | static Future fetch(int offset, int cid) async { 9 | var result = await http.get(API.TREE_ITEM_BEFORE + 10 | offset.toString() + 11 | API.TREE_ITEM_AFTER + 12 | cid.toString()); 13 | if (result?.statusCode == 200) { 14 | Utf8Decoder utf8decoder = new Utf8Decoder(); 15 | var model = json.decode(utf8decoder.convert(result.bodyBytes)); 16 | var finalModel = ArticleModel.fromJson(model); 17 | if (finalModel.errorCode == 0) { 18 | return finalModel; 19 | } else { 20 | throw Exception('服务器异常'); 21 | } 22 | } else { 23 | throw Exception('网络错误'); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/http/API.dart: -------------------------------------------------------------------------------- 1 | class API { 2 | 3 | static const HOME_BANNER_URL = 'https://www.wanandroid.com/banner/json'; 4 | 5 | static const HOME_ARTICLE_URL_BEFORE = 6 | 'https://www.wanandroid.com/article/list/'; 7 | static const HOME_ARTICLE_URL_AFTER = '/json'; 8 | 9 | static const PROJECT_TAB_URL = 'https://www.wanandroid.com/project/tree/json'; 10 | 11 | static const PROJECT_PAGE_URL_BEFORE = 12 | 'https://www.wanandroid.com/project/list/'; 13 | static const PROJECT_PAGE_URL_AFTER = '/json?cid='; 14 | 15 | static const TREE_URL = 'https://www.wanandroid.com/tree/json'; 16 | 17 | static const TREE_ITEM_BEFORE = 'https://www.wanandroid.com/article/list/'; 18 | static const TREE_ITEM_AFTER = '/json?cid='; 19 | 20 | static const NAVI_URL = 'https://www.wanandroid.com/navi/json'; 21 | 22 | static const LOGIN_URL = 'https://www.wanandroid.com/user/login'; 23 | static const REGISTER_URL = 'https://www.wanandroid.com/user/register'; 24 | } 25 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/page/home_page.dart'; 3 | import 'package:my_wanandroid/page/login_page.dart'; 4 | import 'package:my_wanandroid/page/regist_page.dart'; 5 | 6 | import 'navigationbar/navigation_bar_tab.dart'; 7 | 8 | void main() => runApp(MyApp()); 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | return MaterialApp( 14 | title: "玩安卓", 15 | theme: ThemeData(fontFamily: 'noto', primaryColor: Colors.blue), 16 | home: NavigationBarTab(), 17 | routes: {'/HomePage': (context) => HomePage(), 18 | '/LoginPage':(context) => LoginPage(), 19 | '/RegisterPage':(context) => RegisterPage()}, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/model/BaseModel.dart: -------------------------------------------------------------------------------- 1 | class BaseModel { 2 | 3 | int errorCode; 4 | String errorMsg; 5 | 6 | BaseModel({this.errorCode, this.errorMsg}); 7 | 8 | BaseModel.fromJson(Map json) { 9 | errorCode = json['errorCode']; 10 | errorMsg = json['errorMsg']; 11 | } 12 | 13 | Map toJson() { 14 | final Map data = new Map(); 15 | data['errorCode'] = this.errorCode; 16 | data['errorMsg'] = this.errorMsg; 17 | return data; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/model/article_model.dart: -------------------------------------------------------------------------------- 1 | class ArticleModel { 2 | ArticleData data; 3 | int errorCode; 4 | String errorMsg; 5 | 6 | ArticleModel({this.data, this.errorCode, this.errorMsg}); 7 | 8 | ArticleModel.fromJson(Map json) { 9 | data = json['data'] != null ? new ArticleData.fromJson(json['data']) : null; 10 | errorCode = json['errorCode']; 11 | errorMsg = json['errorMsg']; 12 | } 13 | 14 | Map toJson() { 15 | final Map data = new Map(); 16 | if (this.data != null) { 17 | data['data'] = this.data.toJson(); 18 | } 19 | data['errorCode'] = this.errorCode; 20 | data['errorMsg'] = this.errorMsg; 21 | return data; 22 | } 23 | } 24 | 25 | class ArticleData { 26 | int curPage; 27 | List itemList; 28 | int offset; 29 | bool over; 30 | int pageCount; 31 | int size; 32 | int total; 33 | 34 | ArticleData( 35 | {this.curPage, 36 | this.itemList, 37 | this.offset, 38 | this.over, 39 | this.pageCount, 40 | this.size, 41 | this.total}); 42 | 43 | ArticleData.fromJson(Map json) { 44 | curPage = json['curPage']; 45 | if (json['datas'] != null) { 46 | itemList = new List(); 47 | json['datas'].forEach((v) { 48 | itemList.add(new ArticleItem.fromJson(v)); 49 | }); 50 | } 51 | offset = json['offset']; 52 | over = json['over']; 53 | pageCount = json['pageCount']; 54 | size = json['size']; 55 | total = json['total']; 56 | } 57 | 58 | Map toJson() { 59 | final Map data = new Map(); 60 | data['curPage'] = this.curPage; 61 | if (this.itemList != null) { 62 | data['datas'] = this.itemList.map((v) => v.toJson()).toList(); 63 | } 64 | data['offset'] = this.offset; 65 | data['over'] = this.over; 66 | data['pageCount'] = this.pageCount; 67 | data['size'] = this.size; 68 | data['total'] = this.total; 69 | return data; 70 | } 71 | } 72 | 73 | class ArticleItem { 74 | String apkLink; 75 | String author; 76 | int chapterId; 77 | String chapterName; 78 | bool collect; 79 | int courseId; 80 | String desc; 81 | String envelopePic; 82 | bool fresh; 83 | int id; 84 | String link; 85 | String niceDate; 86 | String origin; 87 | String prefix; 88 | String projectLink; 89 | int publishTime; 90 | int superChapterId; 91 | String superChapterName; 92 | List tags; 93 | String title; 94 | int type; 95 | int userId; 96 | int visible; 97 | int zan; 98 | String shareUser; 99 | 100 | ArticleItem( 101 | {this.apkLink, 102 | this.author, 103 | this.chapterId, 104 | this.chapterName, 105 | this.collect, 106 | this.courseId, 107 | this.desc, 108 | this.envelopePic, 109 | this.fresh, 110 | this.id, 111 | this.link, 112 | this.niceDate, 113 | this.origin, 114 | this.prefix, 115 | this.projectLink, 116 | this.publishTime, 117 | this.superChapterId, 118 | this.superChapterName, 119 | this.tags, 120 | this.title, 121 | this.type, 122 | this.userId, 123 | this.visible, 124 | this.zan, 125 | this.shareUser}); 126 | 127 | ArticleItem.fromJson(Map json) { 128 | apkLink = json['apkLink']; 129 | author = json['author']; 130 | chapterId = json['chapterId']; 131 | chapterName = json['chapterName']; 132 | collect = json['collect']; 133 | courseId = json['courseId']; 134 | desc = json['desc']; 135 | envelopePic = json['envelopePic']; 136 | fresh = json['fresh']; 137 | id = json['id']; 138 | link = json['link']; 139 | niceDate = json['niceDate']; 140 | origin = json['origin']; 141 | prefix = json['prefix']; 142 | projectLink = json['projectLink']; 143 | publishTime = json['publishTime']; 144 | superChapterId = json['superChapterId']; 145 | superChapterName = json['superChapterName']; 146 | if (json['tags'] != null) { 147 | tags = new List(); 148 | json['tags'].forEach((v) { 149 | tags.add(new Tags.fromJson(v)); 150 | }); 151 | } 152 | title = json['title']; 153 | type = json['type']; 154 | userId = json['userId']; 155 | visible = json['visible']; 156 | zan = json['zan']; 157 | shareUser = json['shareUser']; 158 | } 159 | 160 | Map toJson() { 161 | final Map data = new Map(); 162 | data['apkLink'] = this.apkLink; 163 | data['author'] = this.author; 164 | data['chapterId'] = this.chapterId; 165 | data['chapterName'] = this.chapterName; 166 | data['collect'] = this.collect; 167 | data['courseId'] = this.courseId; 168 | data['desc'] = this.desc; 169 | data['envelopePic'] = this.envelopePic; 170 | data['fresh'] = this.fresh; 171 | data['id'] = this.id; 172 | data['link'] = this.link; 173 | data['niceDate'] = this.niceDate; 174 | data['origin'] = this.origin; 175 | data['prefix'] = this.prefix; 176 | data['projectLink'] = this.projectLink; 177 | data['publishTime'] = this.publishTime; 178 | data['superChapterId'] = this.superChapterId; 179 | data['superChapterName'] = this.superChapterName; 180 | if (this.tags != null) { 181 | data['tags'] = this.tags.map((v) => v.toJson()).toList(); 182 | } 183 | data['title'] = this.title; 184 | data['type'] = this.type; 185 | data['userId'] = this.userId; 186 | data['visible'] = this.visible; 187 | data['zan'] = this.zan; 188 | data['shareUser'] = this.shareUser; 189 | return data; 190 | } 191 | } 192 | 193 | class Tags { 194 | String name; 195 | String url; 196 | 197 | Tags({this.name, this.url}); 198 | 199 | Tags.fromJson(Map json) { 200 | name = json['name']; 201 | url = json['url']; 202 | } 203 | 204 | Map toJson() { 205 | final Map data = new Map(); 206 | data['name'] = this.name; 207 | data['url'] = this.url; 208 | return data; 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /lib/model/home_banner_model.dart: -------------------------------------------------------------------------------- 1 | class HomeBannerModel { 2 | List data; 3 | int errorCode; 4 | String errorMsg; 5 | 6 | HomeBannerModel({this.data, this.errorCode, this.errorMsg}); 7 | 8 | HomeBannerModel.fromJson(Map json) { 9 | if (json['data'] != null) { 10 | data = new List(); 11 | json['data'].forEach((v) { 12 | data.add(new BannerData.fromJson(v)); 13 | }); 14 | } 15 | errorCode = json['errorCode']; 16 | errorMsg = json['errorMsg']; 17 | } 18 | 19 | Map toJson() { 20 | final Map data = new Map(); 21 | if (this.data != null) { 22 | data['data'] = this.data.map((v) => v.toJson()).toList(); 23 | } 24 | data['errorCode'] = this.errorCode; 25 | data['errorMsg'] = this.errorMsg; 26 | return data; 27 | } 28 | } 29 | 30 | class BannerData { 31 | String desc; 32 | int id; 33 | String imagePath; 34 | int isVisible; 35 | int order; 36 | String title; 37 | int type; 38 | String url; 39 | 40 | BannerData( 41 | {this.desc, 42 | this.id, 43 | this.imagePath, 44 | this.isVisible, 45 | this.order, 46 | this.title, 47 | this.type, 48 | this.url}); 49 | 50 | BannerData.fromJson(Map json) { 51 | desc = json['desc']; 52 | id = json['id']; 53 | imagePath = json['imagePath']; 54 | isVisible = json['isVisible']; 55 | order = json['order']; 56 | title = json['title']; 57 | type = json['type']; 58 | url = json['url']; 59 | } 60 | 61 | Map toJson() { 62 | final Map data = new Map(); 63 | data['desc'] = this.desc; 64 | data['id'] = this.id; 65 | data['imagePath'] = this.imagePath; 66 | data['isVisible'] = this.isVisible; 67 | data['order'] = this.order; 68 | data['title'] = this.title; 69 | data['type'] = this.type; 70 | data['url'] = this.url; 71 | return data; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/model/navi_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:my_wanandroid/model/article_model.dart'; 2 | 3 | class NaviModel { 4 | List naviData; 5 | int errorCode; 6 | String errorMsg; 7 | 8 | NaviModel({this.naviData, this.errorCode, this.errorMsg}); 9 | 10 | NaviModel.fromJson(Map json) { 11 | if (json['data'] != null) { 12 | naviData = new List(); 13 | json['data'].forEach((v) { 14 | naviData.add(new NaviData.fromJson(v)); 15 | }); 16 | } 17 | errorCode = json['errorCode']; 18 | errorMsg = json['errorMsg']; 19 | } 20 | 21 | Map toJson() { 22 | final Map data = new Map(); 23 | if (this.naviData != null) { 24 | data['data'] = this.naviData.map((v) => v.toJson()).toList(); 25 | } 26 | data['errorCode'] = this.errorCode; 27 | data['errorMsg'] = this.errorMsg; 28 | return data; 29 | } 30 | } 31 | 32 | class NaviData { 33 | List articles; 34 | int cid; 35 | String name; 36 | 37 | NaviData({this.articles, this.cid, this.name}); 38 | 39 | NaviData.fromJson(Map json) { 40 | if (json['articles'] != null) { 41 | articles = new List(); 42 | json['articles'].forEach((v) { 43 | articles.add(new ArticleItem.fromJson(v)); 44 | }); 45 | } 46 | cid = json['cid']; 47 | name = json['name']; 48 | } 49 | 50 | Map toJson() { 51 | final Map data = new Map(); 52 | if (this.articles != null) { 53 | data['articles'] = this.articles.map((v) => v.toJson()).toList(); 54 | } 55 | data['cid'] = this.cid; 56 | data['name'] = this.name; 57 | return data; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/model/project_tab_model.dart: -------------------------------------------------------------------------------- 1 | class ProjectTabModel { 2 | List tabItems; 3 | int errorCode; 4 | String errorMsg; 5 | 6 | ProjectTabModel({this.tabItems, this.errorCode, this.errorMsg}); 7 | 8 | ProjectTabModel.fromJson(Map json) { 9 | if (json['data'] != null) { 10 | tabItems = new List(); 11 | json['data'].forEach((v) { 12 | tabItems.add(new TabItems.fromJson(v)); 13 | }); 14 | } 15 | errorCode = json['errorCode']; 16 | errorMsg = json['errorMsg']; 17 | } 18 | 19 | Map toJson() { 20 | final Map data = new Map(); 21 | if (this.tabItems != null) { 22 | data['data'] = this.tabItems.map((v) => v.toJson()).toList(); 23 | } 24 | data['errorCode'] = this.errorCode; 25 | data['errorMsg'] = this.errorMsg; 26 | return data; 27 | } 28 | } 29 | 30 | class TabItems { 31 | int courseId; 32 | int id; 33 | String name; 34 | int order; 35 | int parentChapterId; 36 | bool userControlSetTop; 37 | int visible; 38 | 39 | TabItems( 40 | {this.courseId, 41 | this.id, 42 | this.name, 43 | this.order, 44 | this.parentChapterId, 45 | this.userControlSetTop, 46 | this.visible}); 47 | 48 | TabItems.fromJson(Map json) { 49 | courseId = json['courseId']; 50 | id = json['id']; 51 | name = json['name']; 52 | order = json['order']; 53 | parentChapterId = json['parentChapterId']; 54 | userControlSetTop = json['userControlSetTop']; 55 | visible = json['visible']; 56 | } 57 | 58 | Map toJson() { 59 | final Map data = new Map(); 60 | data['courseId'] = this.courseId; 61 | data['id'] = this.id; 62 | data['name'] = this.name; 63 | data['order'] = this.order; 64 | data['parentChapterId'] = this.parentChapterId; 65 | data['userControlSetTop'] = this.userControlSetTop; 66 | data['visible'] = this.visible; 67 | return data; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/model/tree_model.dart: -------------------------------------------------------------------------------- 1 | 2 | class TreeModel { 3 | List data; 4 | int errorCode; 5 | String errorMsg; 6 | 7 | TreeModel({this.data, this.errorCode, this.errorMsg}); 8 | 9 | TreeModel.fromJson(Map json) { 10 | if (json['data'] != null) { 11 | data = new List(); 12 | json['data'].forEach((v) { 13 | data.add(new TreeItems.fromJson(v)); 14 | }); 15 | } 16 | errorCode = json['errorCode']; 17 | errorMsg = json['errorMsg']; 18 | } 19 | 20 | Map toJson() { 21 | final Map data = new Map(); 22 | if (this.data != null) { 23 | data['data'] = this.data.map((v) => v.toJson()).toList(); 24 | } 25 | data['errorCode'] = this.errorCode; 26 | data['errorMsg'] = this.errorMsg; 27 | return data; 28 | } 29 | } 30 | 31 | class TreeItems { 32 | List detailItem; 33 | int courseId; 34 | int id; 35 | String name; 36 | int order; 37 | int parentChapterId; 38 | bool userControlSetTop; 39 | int visible; 40 | 41 | TreeItems( 42 | {this.detailItem, 43 | this.courseId, 44 | this.id, 45 | this.name, 46 | this.order, 47 | this.parentChapterId, 48 | this.userControlSetTop, 49 | this.visible}); 50 | 51 | TreeItems.fromJson(Map json) { 52 | if (json['children'] != null) { 53 | detailItem = new List(); 54 | json['children'].forEach((v) { 55 | detailItem.add(new TreeItemsDetail.fromJson(v)); 56 | }); 57 | } 58 | courseId = json['courseId']; 59 | id = json['id']; 60 | name = json['name']; 61 | order = json['order']; 62 | parentChapterId = json['parentChapterId']; 63 | userControlSetTop = json['userControlSetTop']; 64 | visible = json['visible']; 65 | } 66 | 67 | Map toJson() { 68 | final Map data = new Map(); 69 | if (this.detailItem != null) { 70 | data['children'] = this.detailItem.map((v) => v.toJson()).toList(); 71 | } 72 | data['courseId'] = this.courseId; 73 | data['id'] = this.id; 74 | data['name'] = this.name; 75 | data['order'] = this.order; 76 | data['parentChapterId'] = this.parentChapterId; 77 | data['userControlSetTop'] = this.userControlSetTop; 78 | data['visible'] = this.visible; 79 | return data; 80 | } 81 | } 82 | 83 | class TreeItemsDetail { 84 | int courseId; 85 | int id; 86 | String name; 87 | int order; 88 | int parentChapterId; 89 | bool userControlSetTop; 90 | int visible; 91 | 92 | TreeItemsDetail( 93 | {this.courseId, 94 | this.id, 95 | this.name, 96 | this.order, 97 | this.parentChapterId, 98 | this.userControlSetTop, 99 | this.visible}); 100 | 101 | TreeItemsDetail.fromJson(Map json) { 102 | courseId = json['courseId']; 103 | id = json['id']; 104 | name = json['name']; 105 | order = json['order']; 106 | parentChapterId = json['parentChapterId']; 107 | userControlSetTop = json['userControlSetTop']; 108 | visible = json['visible']; 109 | } 110 | 111 | Map toJson() { 112 | final Map data = new Map(); 113 | data['courseId'] = this.courseId; 114 | data['id'] = this.id; 115 | data['name'] = this.name; 116 | data['order'] = this.order; 117 | data['parentChapterId'] = this.parentChapterId; 118 | data['userControlSetTop'] = this.userControlSetTop; 119 | data['visible'] = this.visible; 120 | return data; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/navigationbar/navigation_bar_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/page/home_page.dart'; 3 | import 'package:my_wanandroid/page/navi_page.dart'; 4 | import 'package:my_wanandroid/page/project_page.dart'; 5 | import 'package:my_wanandroid/page/tree_page.dart'; 6 | 7 | class NavigationBarTab extends StatefulWidget { 8 | @override 9 | _NavigationBarTabState createState() => _NavigationBarTabState(); 10 | } 11 | 12 | class _NavigationBarTabState extends State { 13 | var _currentIndex = 0; 14 | final PageController _controller = PageController(); 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | } 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Scaffold( 24 | bottomNavigationBar: BottomNavigationBar( 25 | onTap: _onTap, 26 | currentIndex: _currentIndex, 27 | type: BottomNavigationBarType.fixed, 28 | items: [ 29 | _createBottomNavigationBarItem( 30 | Icons.home, Colors.grey, Colors.blue, 0, '首页'), 31 | _createBottomNavigationBarItem( 32 | Icons.school, Colors.grey, Colors.blue, 1, '项目'), 33 | _createBottomNavigationBarItem(Icons.format_indent_decrease, 34 | Colors.grey, Colors.blue, 2, '体系'), 35 | _createBottomNavigationBarItem( 36 | Icons.picture_in_picture_alt, Colors.grey, Colors.blue, 3, '导航'), 37 | ]), 38 | body: PageView( 39 | physics: NeverScrollableScrollPhysics(), 40 | controller: _controller, 41 | onPageChanged: _onPageChange, 42 | children: [HomePage(), ProjectPage(), TreePage(), NaviPage()], 43 | ), 44 | ); 45 | } 46 | 47 | _createBottomNavigationBarItem(IconData icon, Color unSelectColor, 48 | Color selectColor, int index, String tabName) { 49 | return BottomNavigationBarItem( 50 | icon: Icon( 51 | icon, 52 | color: unSelectColor, 53 | ), 54 | title: Text( 55 | tabName, 56 | style: TextStyle( 57 | color: _currentIndex == index ? Colors.blue : Colors.grey), 58 | ), 59 | activeIcon: Icon( 60 | icon, 61 | color: selectColor, 62 | )); 63 | } 64 | 65 | void _onTap(int index) { 66 | setState(() { 67 | _controller.jumpToPage(index); 68 | _currentIndex = index; 69 | }); 70 | } 71 | 72 | void _onPageChange(int index) { 73 | setState(() { 74 | _currentIndex = index; 75 | }); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/page/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_swiper/flutter_swiper.dart'; 3 | import 'package:my_wanandroid/dao/home_article_dao.dart'; 4 | import 'package:my_wanandroid/dao/home_banner_dao.dart'; 5 | import 'package:my_wanandroid/model/article_model.dart'; 6 | import 'package:my_wanandroid/model/home_banner_model.dart'; 7 | import 'package:my_wanandroid/widget/article_card.dart'; 8 | import 'package:my_wanandroid/widget/home_drawer.dart'; 9 | import 'package:my_wanandroid/widget/webview.dart'; 10 | import 'package:toast/toast.dart'; 11 | 12 | const double SCROLL_PIXELS_OFFSET = 500; 13 | 14 | class HomePage extends StatefulWidget { 15 | @override 16 | _HomePageState createState() => _HomePageState(); 17 | } 18 | 19 | class _HomePageState extends State with AutomaticKeepAliveClientMixin { 20 | 21 | 22 | @override 23 | bool get wantKeepAlive => true; 24 | 25 | List bannerList = []; 26 | List articleData = []; 27 | 28 | int offset = 0; 29 | double scrollPixels = 0; 30 | 31 | ScrollController _scrollController = new ScrollController(); 32 | 33 | @override 34 | void initState() { 35 | super.initState(); 36 | 37 | _loadBannerData(); 38 | _loadArticle(); 39 | 40 | _scrollController.addListener(() { 41 | if (_scrollController.position.pixels == 42 | _scrollController.position.maxScrollExtent) { 43 | offset++; 44 | _loadArticle(); 45 | } 46 | }); 47 | } 48 | 49 | @override 50 | Widget build(BuildContext context) { 51 | return Scaffold( 52 | appBar: AppBar( 53 | title: Text( 54 | '首页', 55 | style: TextStyle(color: Colors.white), 56 | ), 57 | backgroundColor: Colors.blue, 58 | centerTitle: true, 59 | leading: Builder( 60 | builder: (context) => GestureDetector( 61 | onTap: () => Scaffold.of(context).openDrawer(), 62 | child: Icon( 63 | Icons.dehaze, 64 | color: Colors.white, 65 | ), 66 | )), 67 | ), 68 | floatingActionButton: scrollPixels > SCROLL_PIXELS_OFFSET 69 | ? FloatingActionButton( 70 | onPressed: () { 71 | _scrollController.animateTo(0, 72 | duration: Duration(milliseconds: 100), 73 | curve: Curves.ease); 74 | }, 75 | backgroundColor: Colors.lightBlue, 76 | child: Icon( 77 | Icons.arrow_upward, 78 | color: Colors.white, 79 | ), 80 | ) 81 | : null, 82 | drawer: HomeDrawer(), 83 | body: articleData.length > 0 84 | ? NotificationListener( 85 | onNotification: (onNotification) { 86 | if (onNotification is ScrollUpdateNotification) { 87 | if (onNotification.depth == 0) { 88 | //防止banner滚动监听 89 | setState(() { 90 | scrollPixels = onNotification.metrics.pixels; 91 | }); 92 | } 93 | } 94 | }, 95 | child: RefreshIndicator( 96 | child: ListView.builder( 97 | physics: ClampingScrollPhysics(), 98 | controller: _scrollController, 99 | itemCount: articleData.length, 100 | itemBuilder: (context, index) { 101 | return _homePageItem(index); 102 | }), 103 | onRefresh: _onRefresh)) 104 | : Center( 105 | child: CircularProgressIndicator(), 106 | )); 107 | } 108 | 109 | Future _onRefresh() async { 110 | offset = 0; 111 | HomeArticleDao.fetch(offset).then((model) { 112 | setState(() { 113 | articleData = model.data.itemList; 114 | }); 115 | }).catchError((error) { 116 | print(error.toString()); 117 | }); 118 | return null; 119 | } 120 | 121 | void _loadBannerData() { 122 | HomeBannerDao.fetch().then((model) { 123 | setState(() { 124 | bannerList = model.data; 125 | }); 126 | }).catchError((error) { 127 | Toast.show(error.toString(), context, 128 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 129 | }); 130 | } 131 | 132 | _banner() { 133 | return bannerList.length > 0 134 | ? Container( 135 | height: 180, 136 | child: Swiper( 137 | itemBuilder: (BuildContext context, int index) { 138 | return GestureDetector( 139 | onTap: () { 140 | Navigator.of(context).push(MaterialPageRoute( 141 | builder: (context) => WebView( 142 | url: bannerList[index].url, 143 | title: bannerList[index].title, 144 | ))); 145 | }, 146 | child: new Image.network( 147 | bannerList[index].imagePath, 148 | fit: BoxFit.fill, 149 | ), 150 | ); 151 | }, 152 | itemCount: bannerList.length, 153 | autoplay: true, 154 | pagination: new SwiperPagination(), 155 | ), 156 | ) 157 | : Container(); 158 | } 159 | 160 | void _loadArticle() { 161 | HomeArticleDao.fetch(offset).then((model) { 162 | setState(() { 163 | if (offset == 0) { 164 | articleData = model.data.itemList; 165 | } else { 166 | articleData.addAll(model.data.itemList); 167 | } 168 | }); 169 | }).catchError((error) { 170 | Toast.show(error.toString(), context, 171 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 172 | }); 173 | } 174 | 175 | _homePageItem(int index) { 176 | return index == 0 177 | ? _banner() 178 | : ArticleCard( 179 | articleItem: articleData[index], 180 | ); 181 | } 182 | 183 | } 184 | -------------------------------------------------------------------------------- /lib/page/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/login_dao.dart'; 3 | import 'package:my_wanandroid/page/regist_page.dart'; 4 | import 'package:my_wanandroid/utils/images_provider.dart'; 5 | import 'package:my_wanandroid/utils/prefs_provider.dart'; 6 | import 'package:toast/toast.dart'; 7 | import 'package:shared_preferences/shared_preferences.dart'; 8 | 9 | class LoginPage extends StatefulWidget { 10 | @override 11 | _LoginPageState createState() => _LoginPageState(); 12 | } 13 | 14 | class _LoginPageState extends State { 15 | bool showPhoneClose = false; 16 | bool showPasswordClose = false; 17 | String phone; 18 | String password; 19 | TextEditingController _onPhoneController = TextEditingController(); 20 | TextEditingController _onPasswordController = TextEditingController(); 21 | SharedPreferences prefs; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | initSharedPreferences(); 27 | } 28 | 29 | void initSharedPreferences() async { 30 | prefs = await SharedPreferences.getInstance(); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Scaffold( 36 | resizeToAvoidBottomPadding: false, 37 | appBar: AppBar( 38 | title: Text('登录'), 39 | centerTitle: true, 40 | ), 41 | body: Column( 42 | children: [ 43 | Container( 44 | alignment: Alignment.center, 45 | margin: EdgeInsets.only(top: 50, bottom: 10), 46 | child: Image.asset( 47 | ImagesProvider.getImagePath('logo'), 48 | width: 100, 49 | height: 100, 50 | ), 51 | ), 52 | createInput(_onPhoneChange, _onPhoneController, Icons.phone_android, 53 | showPhoneClose, true), 54 | createInput(_onPasswordChange, _onPasswordController, 55 | Icons.lock_outline, showPasswordClose, false), 56 | Padding( 57 | padding: EdgeInsets.fromLTRB(30, 20, 30, 20), 58 | child: Row( 59 | children: [ 60 | Expanded( 61 | child: Container( 62 | height: 45, 63 | child: RaisedButton( 64 | onPressed: _login, 65 | shape: RoundedRectangleBorder( 66 | borderRadius: BorderRadius.circular(5)), 67 | child: Text( 68 | '登录', 69 | style: TextStyle(color: Colors.white), 70 | ), 71 | color: Colors.lightBlue, 72 | highlightColor: Colors.blue, 73 | ), 74 | ), 75 | ) 76 | ], 77 | ), 78 | ), 79 | Row( 80 | mainAxisAlignment: MainAxisAlignment.center, 81 | children: [ 82 | Text('没有账号?'), 83 | InkWell( 84 | onTap: () { 85 | // Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context){ 86 | // return RegisterPage(); 87 | // }),ModalRoute.withName('/HomePage')); 88 | Navigator.pop(context); 89 | Navigator.pushNamed(context, '/RegisterPage'); 90 | }, 91 | child: Text( 92 | '去注册', 93 | style: TextStyle(color: Colors.blue), 94 | ), 95 | ) 96 | ], 97 | ) 98 | ], 99 | ), 100 | ); 101 | } 102 | 103 | createInput(ValueChanged onChanged, TextEditingController controller, 104 | IconData icon, bool close, bool isPhone) { 105 | return Container( 106 | margin: EdgeInsets.only(left: 20, right: 20, top: 20), 107 | padding: EdgeInsets.only(left: 10), 108 | decoration: BoxDecoration( 109 | border: Border.all(color: Colors.blue), 110 | borderRadius: BorderRadius.circular(5)), 111 | child: Stack( 112 | alignment: Alignment.centerRight, 113 | children: [ 114 | TextField( 115 | obscureText: isPhone ? false : true, 116 | style: TextStyle( 117 | fontSize: 16, 118 | ), 119 | // maxLength: 10, 120 | maxLines: 1, 121 | onChanged: onChanged, 122 | controller: controller, 123 | decoration: InputDecoration( 124 | contentPadding: EdgeInsets.fromLTRB(0, 5, 50, 5), 125 | border: InputBorder.none, 126 | icon: Icon( 127 | icon, 128 | color: Colors.blue, 129 | ), 130 | labelText: isPhone ? '请输入用户名' : '请输入密码', 131 | ), 132 | ), 133 | close 134 | ? Container( 135 | margin: EdgeInsets.only(right: 20), 136 | child: InkWell( 137 | onTap: () { 138 | controller.clear(); 139 | setState(() { 140 | isPhone 141 | ? showPhoneClose = false 142 | : showPasswordClose = false; 143 | }); 144 | }, 145 | child: Icon( 146 | Icons.close, 147 | color: Colors.grey, 148 | ), 149 | ), 150 | ) 151 | : Container() 152 | ], 153 | ), 154 | ); 155 | } 156 | 157 | void _onPhoneChange(String text) { 158 | phone = text; 159 | if (text.length > 0) { 160 | setState(() { 161 | showPhoneClose = true; 162 | }); 163 | } else { 164 | setState(() { 165 | showPhoneClose = false; 166 | }); 167 | } 168 | } 169 | 170 | void _onPasswordChange(String text) { 171 | password = text; 172 | if (text.length > 0) { 173 | setState(() { 174 | showPasswordClose = true; 175 | }); 176 | } else { 177 | setState(() { 178 | showPasswordClose = false; 179 | }); 180 | } 181 | } 182 | 183 | void _login() { 184 | LoginDao.fetch(phone, password).then((model) { 185 | Toast.show('登录成功', context, 186 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 187 | prefs.setString(PrefsProvider.USER_NAME, phone); 188 | Navigator.pop(context); 189 | }).catchError((error) { 190 | Toast.show(error.toString(), context, 191 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 192 | }); 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /lib/page/navi_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/navi_dao.dart'; 3 | import 'package:my_wanandroid/model/article_model.dart'; 4 | import 'package:my_wanandroid/model/navi_model.dart'; 5 | import 'package:my_wanandroid/widget/webview.dart'; 6 | import 'package:toast/toast.dart'; 7 | 8 | class NaviPage extends StatefulWidget { 9 | @override 10 | _NaviPageState createState() => _NaviPageState(); 11 | } 12 | 13 | class _NaviPageState extends State with AutomaticKeepAliveClientMixin{ 14 | 15 | @override 16 | bool get wantKeepAlive => true; 17 | 18 | List naviData = []; 19 | int isSelected = 0; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _loadData(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( 31 | title: Text('网站导航'), 32 | centerTitle: true, 33 | ), 34 | body: naviData.length > 0 35 | ? Row( 36 | children: [ 37 | Expanded( 38 | flex: 1, 39 | child: ListView.builder( 40 | itemCount: naviData.length, 41 | itemBuilder: (context, index) { 42 | return InkWell( 43 | onTap: () { 44 | setState(() { 45 | isSelected = index; 46 | }); 47 | }, 48 | child: Container( 49 | alignment: Alignment.center, 50 | padding: EdgeInsets.only(top: 15, bottom: 15), 51 | decoration: BoxDecoration( 52 | color: isSelected == index 53 | ? Color(0XFFFFFFFF) 54 | : Color(0XFFF0F0F0), 55 | ), 56 | child: Text( 57 | naviData[index].name, 58 | style: TextStyle(color: Colors.black), 59 | ), 60 | ), 61 | ); 62 | })), 63 | Expanded( 64 | flex: 2, 65 | child: Container( 66 | color: Colors.white, 67 | child: GridView.count( 68 | crossAxisCount: 2, 69 | children: naviData[isSelected] 70 | .articles 71 | .map((ArticleItem item) { 72 | return InkWell( 73 | onTap: () { 74 | Navigator.push(context, 75 | MaterialPageRoute(builder: (context) { 76 | return WebView( 77 | title: item.title, 78 | url: item.link, 79 | ); 80 | })); 81 | }, 82 | child: Container( 83 | padding: EdgeInsets.all(5), 84 | decoration: 85 | BoxDecoration(color: Color(0XFFF0F0F0)), 86 | margin: EdgeInsets.all(5), 87 | child: Text(item.title), 88 | alignment: Alignment.center, 89 | ), 90 | ); 91 | }).toList(), 92 | ), 93 | )) 94 | ], 95 | ) 96 | : Center( 97 | child: CircularProgressIndicator(), 98 | ), 99 | ); 100 | } 101 | 102 | void _loadData() { 103 | NaviDao.fetch().then((model) { 104 | setState(() { 105 | naviData = model.naviData; 106 | }); 107 | }).catchError((error) { 108 | Toast.show(error.toString(), context, 109 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 110 | }); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /lib/page/project_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/project_tab_dao.dart'; 3 | import 'package:my_wanandroid/model/project_tab_model.dart'; 4 | import 'package:my_wanandroid/widget/project_item_page.dart'; 5 | import 'package:toast/toast.dart'; 6 | 7 | class ProjectPage extends StatefulWidget { 8 | @override 9 | _ProjectPageState createState() => _ProjectPageState(); 10 | } 11 | 12 | class _ProjectPageState extends State 13 | with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin { 14 | 15 | @override 16 | bool get wantKeepAlive => true; 17 | 18 | List tabItems = []; 19 | TabController _tabController; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _loadTabsData(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return tabItems.length > 0 30 | ? Column( 31 | children: [ 32 | Container( 33 | padding: EdgeInsets.only(top: 30), 34 | color: Colors.blue, 35 | child: TabBar( 36 | isScrollable: true, 37 | controller: _tabController, 38 | labelPadding: EdgeInsets.all(10), 39 | indicatorColor: Colors.white, 40 | indicatorPadding: EdgeInsets.all(5), 41 | tabs: tabItems.map((items) { 42 | return Text( 43 | items.name, 44 | style: TextStyle(color: Colors.white, fontSize: 16), 45 | ); 46 | }).toList()), 47 | ), 48 | Expanded( 49 | child: TabBarView( 50 | controller: _tabController, 51 | children: tabItems.map((items) { 52 | return ProjectItemPage( 53 | cid: items.id, 54 | ); 55 | }).toList())) 56 | ], 57 | ) 58 | : Center( 59 | child: CircularProgressIndicator(), 60 | ); 61 | } 62 | 63 | void _loadTabsData() { 64 | ProjectTabDao.fetch().then((model) { 65 | setState(() { 66 | tabItems = model.tabItems; 67 | _tabController = 68 | new TabController(length: tabItems.length, vsync: this); 69 | }); 70 | }).catchError((error) => 71 | Toast.show(error.toString(), context, 72 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER) 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/page/regist_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/login_dao.dart'; 3 | import 'package:my_wanandroid/dao/register_dao.dart'; 4 | import 'package:my_wanandroid/page/login_page.dart'; 5 | import 'package:my_wanandroid/utils/images_provider.dart'; 6 | import 'package:my_wanandroid/utils/prefs_provider.dart'; 7 | import 'package:toast/toast.dart'; 8 | import 'package:shared_preferences/shared_preferences.dart'; 9 | 10 | class RegisterPage extends StatefulWidget { 11 | @override 12 | _RegisterPageState createState() => _RegisterPageState(); 13 | } 14 | 15 | class _RegisterPageState extends State { 16 | bool showPhoneClose = false; 17 | bool showPasswordClose = false; 18 | bool showRePasswordClose = false; 19 | String phone; 20 | String password; 21 | String rePassword; 22 | TextEditingController _onPhoneController = TextEditingController(); 23 | TextEditingController _onPasswordController = TextEditingController(); 24 | TextEditingController _onRePasswordController = TextEditingController(); 25 | SharedPreferences prefs; 26 | 27 | @override 28 | void initState() { 29 | super.initState(); 30 | initSharedPreferences(); 31 | } 32 | 33 | void initSharedPreferences() async { 34 | prefs = await SharedPreferences.getInstance(); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return Scaffold( 40 | resizeToAvoidBottomPadding: false, 41 | appBar: AppBar( 42 | title: Text('注册'), 43 | centerTitle: true, 44 | ), 45 | body: Column( 46 | children: [ 47 | Container( 48 | alignment: Alignment.center, 49 | margin: EdgeInsets.only(top: 30, bottom: 5), 50 | child: Image.asset( 51 | ImagesProvider.getImagePath('logo'), 52 | width: 100, 53 | height: 100, 54 | ), 55 | ), 56 | createInput(_onPhoneChange, _onPhoneController, Icons.phone_android, 57 | showPhoneClose, 58 | isPhone: true), 59 | createInput( 60 | _onPasswordChange, 61 | _onPasswordController, 62 | Icons.lock_outline, 63 | showPasswordClose, 64 | ), 65 | createInput(_onRePasswordChange, _onRePasswordController, Icons.lock, 66 | showRePasswordClose, 67 | isRePassword: true), 68 | Padding( 69 | padding: EdgeInsets.fromLTRB(30, 20, 30, 20), 70 | child: Row( 71 | children: [ 72 | Expanded( 73 | child: Container( 74 | height: 45, 75 | child: RaisedButton( 76 | onPressed: _register, 77 | shape: RoundedRectangleBorder( 78 | borderRadius: BorderRadius.circular(5)), 79 | child: Text( 80 | ' 注册', 81 | style: TextStyle(color: Colors.white), 82 | ), 83 | color: Colors.lightBlue, 84 | highlightColor: Colors.blue, 85 | ), 86 | ), 87 | ) 88 | ], 89 | ), 90 | ), 91 | Row( 92 | mainAxisAlignment: MainAxisAlignment.center, 93 | children: [ 94 | Text('已有账号?'), 95 | InkWell( 96 | onTap: () { 97 | // Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context){ 98 | // return LoginPage(); 99 | // }),ModalRoute.withName('/HomePage')); 100 | Navigator.pop(context); 101 | Navigator.pushNamed(context, '/LoginPage'); 102 | }, 103 | child: Text( 104 | '去登录', 105 | style: TextStyle(color: Colors.blue), 106 | ), 107 | ) 108 | ], 109 | ) 110 | ], 111 | ), 112 | ); 113 | } 114 | 115 | createInput(ValueChanged onChanged, TextEditingController controller, 116 | IconData icon, bool close, 117 | {bool isPhone = false, bool isRePassword = false}) { 118 | return Container( 119 | margin: EdgeInsets.only(left: 20, right: 20, top: 20), 120 | padding: EdgeInsets.only(left: 10), 121 | decoration: BoxDecoration( 122 | border: Border.all(color: Colors.blue), 123 | borderRadius: BorderRadius.circular(5)), 124 | child: Stack( 125 | alignment: Alignment.centerRight, 126 | children: [ 127 | TextField( 128 | obscureText: isPhone ? false : true, 129 | style: TextStyle( 130 | fontSize: 16, 131 | ), 132 | // maxLength: 10, 133 | maxLines: 1, 134 | onChanged: onChanged, 135 | controller: controller, 136 | decoration: InputDecoration( 137 | contentPadding: EdgeInsets.fromLTRB(0, 5, 50, 5), 138 | border: InputBorder.none, 139 | icon: Icon( 140 | icon, 141 | color: Colors.blue, 142 | ), 143 | labelText: isPhone ? '请输入用户名' : isRePassword ? '请确认密码' : '请输入密码', 144 | ), 145 | ), 146 | close 147 | ? Container( 148 | margin: EdgeInsets.only(right: 20), 149 | child: InkWell( 150 | onTap: () { 151 | controller.clear(); 152 | setState(() { 153 | isPhone 154 | ? showPhoneClose = false 155 | : isRePassword 156 | ? showRePasswordClose = false 157 | : showPasswordClose = false; 158 | }); 159 | }, 160 | child: Icon( 161 | Icons.close, 162 | color: Colors.grey, 163 | ), 164 | ), 165 | ) 166 | : Container() 167 | ], 168 | ), 169 | ); 170 | } 171 | 172 | void _onPhoneChange(String text) { 173 | phone = text; 174 | if (text.length > 0) { 175 | setState(() { 176 | showPhoneClose = true; 177 | }); 178 | } else { 179 | setState(() { 180 | showPhoneClose = false; 181 | }); 182 | } 183 | } 184 | 185 | void _onPasswordChange(String text) { 186 | password = text; 187 | if (text.length > 0) { 188 | setState(() { 189 | showPasswordClose = true; 190 | }); 191 | } else { 192 | setState(() { 193 | showPasswordClose = false; 194 | }); 195 | } 196 | } 197 | 198 | void _onRePasswordChange(String text) { 199 | rePassword = text; 200 | if (text.length > 0) { 201 | setState(() { 202 | showRePasswordClose = true; 203 | }); 204 | } else { 205 | setState(() { 206 | showRePasswordClose = false; 207 | }); 208 | } 209 | } 210 | 211 | void _register() { 212 | RegisterDao.fetch(phone, password, rePassword).then((model) { 213 | Toast.show('注册成功', context, 214 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 215 | prefs.setString(PrefsProvider.USER_NAME, phone); 216 | Navigator.pop(context); 217 | }).catchError((error) { 218 | Toast.show(error.toString(), context, 219 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 220 | }); 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /lib/page/tree_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/tree_dao.dart'; 3 | import 'package:my_wanandroid/model/tree_model.dart'; 4 | import 'package:my_wanandroid/widget/tree_item_page.dart'; 5 | import 'package:toast/toast.dart'; 6 | 7 | class TreePage extends StatefulWidget { 8 | @override 9 | _TreePageState createState() => _TreePageState(); 10 | } 11 | 12 | class _TreePageState extends State with AutomaticKeepAliveClientMixin{ 13 | 14 | @override 15 | bool get wantKeepAlive => true; 16 | 17 | List _itemList = []; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | _loadData(); 23 | } 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | appBar: AppBar( 29 | title: Text('体系'), 30 | centerTitle: true, 31 | ), 32 | body: _itemList.length > 0 33 | ? ListView.builder( 34 | itemCount: _itemList.length, 35 | itemBuilder: (context, index) { 36 | return _items(_itemList[index], _itemList[index].detailItem); 37 | }) 38 | : Center( 39 | child: CircularProgressIndicator(), 40 | ), 41 | ); 42 | } 43 | 44 | _items(TreeItems item, List detailItem) { 45 | return Column( 46 | crossAxisAlignment: CrossAxisAlignment.start, 47 | children: [ 48 | Container( 49 | margin: EdgeInsets.only(top: 10, bottom: 10, left: 18), 50 | child: Text(item.name, 51 | style: TextStyle( 52 | fontSize: 16, 53 | color: Colors.black, 54 | fontWeight: FontWeight.bold)), 55 | ), 56 | Wrap( 57 | children: detailItem.map((items) { 58 | return Padding( 59 | padding: EdgeInsets.only(left: 15), 60 | child: Chip( 61 | backgroundColor: _getColor(items.name), 62 | label: InkWell( 63 | onTap: () { 64 | Navigator.push(context, 65 | MaterialPageRoute(builder: (context) { 66 | return TreeItemPage( 67 | cid: items.id, 68 | title: items.name, 69 | ); 70 | })); 71 | }, 72 | child: Text( 73 | items.name, 74 | style: TextStyle(color: Colors.black, fontSize: 14), 75 | ), 76 | ), 77 | ), 78 | ); 79 | }).toList(), 80 | ), 81 | Divider( 82 | color: Colors.grey, 83 | height: 10, 84 | indent: 15, 85 | ) 86 | ], 87 | ); 88 | } 89 | 90 | void _loadData() { 91 | TreeDao.fetch().then((model) { 92 | setState(() { 93 | _itemList = model.data; 94 | }); 95 | }).catchError((error) { 96 | Toast.show(error.toString(), context, 97 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 98 | }); 99 | } 100 | 101 | _getColor(String name) { 102 | final int hash = name.hashCode & 0xffff; 103 | final double hue = (360.0 * hash / (1 << 11)) % 360.0; 104 | return HSVColor.fromAHSV(1.0, hue, 0.4, 0.90).toColor(); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /lib/utils/images_provider.dart: -------------------------------------------------------------------------------- 1 | class ImagesProvider { 2 | /* 3 | * 根据name获取图片路径 4 | */ 5 | static String getImagePath(String imageName) { 6 | return "images/$imageName.png"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /lib/utils/prefs_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class PrefsProvider { 4 | 5 | static const USER_NAME = 'user_name'; 6 | } 7 | -------------------------------------------------------------------------------- /lib/widget/article_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/model/article_model.dart'; 3 | import 'package:my_wanandroid/widget/webview.dart'; 4 | import 'package:toast/toast.dart'; 5 | 6 | class ArticleCard extends StatefulWidget { 7 | final ArticleItem articleItem; 8 | 9 | const ArticleCard({Key key, this.articleItem}) : super(key: key); 10 | 11 | @override 12 | _ArticleCardState createState() => _ArticleCardState(); 13 | } 14 | 15 | class _ArticleCardState extends State { 16 | String name = "作者"; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | if (widget.articleItem.author.isEmpty) { 21 | name = "推荐者"; 22 | if (widget.articleItem.shareUser.isEmpty) { 23 | widget.articleItem.author = "佚名"; 24 | } else { 25 | widget.articleItem.author = widget.articleItem.shareUser; 26 | } 27 | } 28 | 29 | return GestureDetector( 30 | onTap: () => Navigator.of(context).push(MaterialPageRoute( 31 | builder: (context) => WebView( 32 | url: widget.articleItem.link, 33 | title: widget.articleItem.title, 34 | ))), 35 | child: Card( 36 | elevation: 5, 37 | margin: EdgeInsets.only(left: 10, right: 10, top: 8), 38 | child: Container( 39 | padding: EdgeInsets.all(16), 40 | child: Column( 41 | crossAxisAlignment: CrossAxisAlignment.start, 42 | children: [ 43 | Container( 44 | child: Text( 45 | widget.articleItem.title, 46 | maxLines: 1, 47 | overflow: TextOverflow.ellipsis, 48 | style: TextStyle(color: Colors.black, fontSize: 16), 49 | ), 50 | ), 51 | Container( 52 | margin: EdgeInsets.only(top: 5, bottom: 10), 53 | child: Text( 54 | widget.articleItem.desc == "" 55 | ? widget.articleItem.title * 2 56 | : widget.articleItem.desc, 57 | maxLines: 2, 58 | overflow: TextOverflow.ellipsis, 59 | style: TextStyle(color: Colors.black54, fontSize: 14), 60 | ), 61 | ), 62 | Row( 63 | children: [ 64 | _itemTags(widget.articleItem.superChapterName, 65 | widget.articleItem.projectLink), 66 | _itemTags(widget.articleItem.chapterName, 67 | widget.articleItem.projectLink) 68 | ], 69 | ), 70 | Row( 71 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 72 | children: [ 73 | Container( 74 | child: Text( 75 | '$name:${widget.articleItem.author}', 76 | style: TextStyle(fontSize: 12), 77 | ), 78 | ), 79 | Text( 80 | widget.articleItem.niceDate, 81 | style: TextStyle(fontSize: 12), 82 | ), 83 | ], 84 | ) 85 | ], 86 | ), 87 | )), 88 | ); 89 | } 90 | 91 | _itemTags(String name, String projectLink) { 92 | return GestureDetector( 93 | onTap: () => projectLink != "" 94 | ? Navigator.of(context).push(MaterialPageRoute( 95 | builder: (context) => WebView( 96 | url: projectLink, 97 | title: name, 98 | ))) 99 | : Toast.show("暂无项目地址", context, 100 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER), 101 | child: Container( 102 | height: 22, 103 | alignment: Alignment.center, 104 | margin: EdgeInsets.only(bottom: 10, right: 10), 105 | padding: EdgeInsets.fromLTRB(5, 1, 5, 1), 106 | decoration: BoxDecoration( 107 | border: Border.all(color: Colors.green), 108 | borderRadius: BorderRadius.all(Radius.circular(4))), 109 | child: Text( 110 | name, 111 | style: TextStyle(fontSize: 12), 112 | ), 113 | ), 114 | ); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /lib/widget/home_drawer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:my_wanandroid/page/login_page.dart'; 5 | import 'package:my_wanandroid/utils/prefs_provider.dart'; 6 | import 'package:my_wanandroid/widget/webview.dart'; 7 | import 'package:shared_preferences/shared_preferences.dart'; 8 | 9 | class HomeDrawer extends StatefulWidget { 10 | @override 11 | _HomeDrawerState createState() => _HomeDrawerState(); 12 | } 13 | 14 | class _HomeDrawerState extends State { 15 | String userName = ''; 16 | 17 | @override 18 | void initState() { 19 | super.initState(); 20 | getUserName(); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return Container( 26 | width: MediaQueryData.fromWindow(window).size.width * 0.8, 27 | decoration: BoxDecoration(color: Colors.white), 28 | child: Column( 29 | children: [ 30 | UserAccountsDrawerHeader( 31 | decoration: BoxDecoration(color: Colors.black12), 32 | accountName: Text( 33 | userName, 34 | style: TextStyle(color: Colors.black), 35 | ), 36 | accountEmail: Text( 37 | '长风破浪会有时,直挂云帆济沧海。', 38 | style: TextStyle(color: Colors.black), 39 | ), 40 | currentAccountPicture: CircleAvatar( 41 | child: Icon(Icons.person), 42 | ), 43 | otherAccountsPictures: [ 44 | userName.length == 0 45 | ? Container( 46 | padding: EdgeInsets.all(5), 47 | child: InkWell( 48 | onTap: () { 49 | Navigator.pop(context); 50 | Navigator.push(context, 51 | MaterialPageRoute(builder: (context) { 52 | return LoginPage(); 53 | })); 54 | }, 55 | child: Text( 56 | '登录', 57 | style: TextStyle(color: Colors.black), 58 | ), 59 | ), 60 | ) 61 | : null 62 | ], 63 | ), 64 | ListTile( 65 | title: Text( 66 | '收藏', 67 | style: TextStyle(fontSize: 16), 68 | ), 69 | leading: Icon(Icons.grade), 70 | ), 71 | ListTile( 72 | title: Text( 73 | '趣图', 74 | style: TextStyle(fontSize: 16), 75 | ), 76 | leading: Icon(Icons.picture_in_picture), 77 | ), 78 | InkWell( 79 | onTap: () { 80 | Navigator.push(context, MaterialPageRoute(builder: (context) { 81 | return WebView( 82 | title: '玩安卓', 83 | url: 'https://www.wanandroid.com', 84 | ); 85 | })); 86 | }, 87 | child: ListTile( 88 | title: Text( 89 | '玩安卓', 90 | style: TextStyle(fontSize: 16), 91 | ), 92 | leading: Icon(Icons.android), 93 | ), 94 | ), 95 | userName.length != 0 96 | ? InkWell( 97 | onTap: () { 98 | showLogoutDialog(); 99 | }, 100 | child: ListTile( 101 | title: Text( 102 | '注销', 103 | style: TextStyle(fontSize: 16), 104 | ), 105 | leading: Icon(Icons.power_settings_new), 106 | ), 107 | ) 108 | : Container(), 109 | ], 110 | ), 111 | ); 112 | } 113 | 114 | void getUserName() async { 115 | SharedPreferences prefs = await SharedPreferences.getInstance(); 116 | userName = prefs.getString(PrefsProvider.USER_NAME) ?? ''; 117 | setState(() {}); 118 | } 119 | 120 | void showLogoutDialog() { 121 | showDialog( 122 | barrierDismissible: false, 123 | context: context, 124 | builder: (_) => new AlertDialog( 125 | title: new Text("退出登录"), 126 | content: new Text("确认退出?"), 127 | actions: [ 128 | new FlatButton( 129 | child: new Text("取消"), 130 | onPressed: () { 131 | Navigator.of(context).pop(); 132 | }, 133 | ), 134 | new FlatButton( 135 | child: new Text("确定"), 136 | onPressed: () { 137 | logout(); 138 | Navigator.of(context).pop(); 139 | }, 140 | ) 141 | ])); 142 | } 143 | 144 | void logout() async { 145 | SharedPreferences prefs = await SharedPreferences.getInstance(); 146 | prefs.clear(); 147 | setState(() { 148 | userName = ''; 149 | }); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /lib/widget/project_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/model/article_model.dart'; 3 | import 'package:my_wanandroid/widget/webview.dart'; 4 | import 'package:toast/toast.dart'; 5 | 6 | class ProjectCard extends StatefulWidget { 7 | final ArticleItem articleItem; 8 | final int index; 9 | 10 | const ProjectCard({Key key, this.articleItem, this.index}) : super(key: key); 11 | 12 | @override 13 | _ProjectCardState createState() => _ProjectCardState(); 14 | } 15 | 16 | class _ProjectCardState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return GestureDetector( 20 | onTap: () => Navigator.of(context).push(MaterialPageRoute( 21 | builder: (context) => WebView( 22 | url: widget.articleItem.link, 23 | title: widget.articleItem.title, 24 | ))), 25 | child: Card( 26 | elevation: 3, 27 | child: Container( 28 | padding: EdgeInsets.all(16), 29 | child: Column( 30 | crossAxisAlignment: CrossAxisAlignment.start, 31 | children: [ 32 | Container( 33 | height: widget.index % 2 == 0 ? 140 : 80, 34 | width: 200, 35 | child: Image.network( 36 | widget.articleItem.envelopePic, 37 | fit: BoxFit.cover, 38 | ), 39 | ), 40 | Container( 41 | margin: EdgeInsets.only(top: 5, bottom: 10), 42 | child: Text( 43 | widget.articleItem.title, 44 | maxLines: 2, 45 | overflow: TextOverflow.ellipsis, 46 | style: TextStyle(color: Colors.black, fontSize: 15), 47 | ), 48 | ), 49 | Row( 50 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 51 | children: [ 52 | Container( 53 | child: LimitedBox( 54 | maxWidth: 50, 55 | child: Text( 56 | '${widget.articleItem.author}', 57 | overflow: TextOverflow.ellipsis, 58 | style: TextStyle(fontSize: 12), 59 | ), 60 | ), 61 | ), 62 | Text( 63 | widget.articleItem.niceDate, 64 | style: TextStyle(fontSize: 12), 65 | ), 66 | ], 67 | ) 68 | ], 69 | ), 70 | )), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/widget/project_item_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/project_item_dao.dart'; 3 | import 'package:my_wanandroid/model/article_model.dart'; 4 | import 'package:my_wanandroid/widget/article_card.dart'; 5 | import 'package:my_wanandroid/widget/project_card.dart'; 6 | import 'package:toast/toast.dart'; 7 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 8 | 9 | class ProjectItemPage extends StatefulWidget { 10 | final int cid; 11 | 12 | const ProjectItemPage({Key key, this.cid}) : super(key: key); 13 | 14 | @override 15 | _ProjectItemPageState createState() => _ProjectItemPageState(); 16 | } 17 | 18 | class _ProjectItemPageState extends State { 19 | List itemList = []; 20 | int offset = 0; 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | _loadItemPage(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return itemList.length > 0 31 | ? MediaQuery.removePadding( 32 | removeTop: true, 33 | context: context, 34 | child: NotificationListener( 35 | onNotification: (onNotification) { 36 | if (onNotification is ScrollUpdateNotification) { 37 | if (onNotification.metrics.pixels == 38 | onNotification.metrics.maxScrollExtent) { 39 | offset++; 40 | _loadItemPage(); 41 | } 42 | } 43 | }, 44 | child: RefreshIndicator( 45 | onRefresh: _onRefresh, 46 | child: Container( 47 | margin: EdgeInsets.only(left: 5, right: 5), 48 | child: new StaggeredGridView.countBuilder( 49 | crossAxisCount: 4, 50 | itemCount: itemList.length, 51 | itemBuilder: (BuildContext context, int index) => 52 | new Container( 53 | child: ProjectCard( 54 | articleItem: itemList[index], 55 | index: index, 56 | )), 57 | staggeredTileBuilder: (int index) => 58 | new StaggeredTile.fit(2), 59 | ), 60 | ), 61 | ))) 62 | : Center( 63 | child: CircularProgressIndicator(), 64 | ); 65 | } 66 | 67 | void _loadItemPage() { 68 | ProjectItemDao.fetch(offset, widget.cid).then((model) { 69 | setState(() { 70 | if (offset == 0) { 71 | itemList = model.data.itemList; 72 | } else { 73 | itemList.addAll(model.data.itemList); 74 | } 75 | }); 76 | }).catchError((error) { 77 | Toast.show(error.toString(), context, 78 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 79 | }); 80 | } 81 | 82 | Future _onRefresh() async { 83 | offset = 0; 84 | _loadItemPage(); 85 | return null; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/widget/tree_item_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:my_wanandroid/dao/tree_item_dao.dart'; 3 | import 'package:my_wanandroid/model/article_model.dart'; 4 | import 'package:my_wanandroid/widget/article_card.dart'; 5 | import 'package:toast/toast.dart'; 6 | 7 | class TreeItemPage extends StatefulWidget { 8 | final int cid; 9 | final String title; 10 | 11 | const TreeItemPage({Key key, this.cid, this.title}) : super(key: key); 12 | 13 | @override 14 | _TreeItemPageState createState() => _TreeItemPageState(); 15 | } 16 | 17 | class _TreeItemPageState extends State { 18 | List itemList = []; 19 | int offset = 0; 20 | 21 | @override 22 | void initState() { 23 | super.initState(); 24 | _loadItemPage(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( 31 | title: Text(widget.title), 32 | centerTitle: true, 33 | ), 34 | body: itemList.length > 0 35 | ? MediaQuery.removePadding( 36 | removeTop: true, 37 | context: context, 38 | child: NotificationListener( 39 | onNotification: (onNotification) { 40 | if (onNotification is ScrollUpdateNotification) { 41 | if (onNotification.metrics.pixels == 42 | onNotification.metrics.maxScrollExtent) { 43 | offset++; 44 | _loadItemPage(); 45 | } 46 | } 47 | }, 48 | child: SafeArea( 49 | child: RefreshIndicator( 50 | child: ListView.builder( 51 | itemCount: itemList.length, 52 | itemBuilder: (context, index) { 53 | return ArticleCard( 54 | articleItem: itemList[index], 55 | ); 56 | }), 57 | onRefresh: _onRefresh)))) 58 | : Center( 59 | child: CircularProgressIndicator(), 60 | ), 61 | ); 62 | } 63 | 64 | void _loadItemPage() { 65 | TreeItemDao.fetch(offset, widget.cid).then((model) { 66 | setState(() { 67 | if (offset == 0) { 68 | itemList = model.data.itemList; 69 | } else { 70 | itemList.addAll(model.data.itemList); 71 | } 72 | }); 73 | }).catchError((error) { 74 | Toast.show(error.toString(), context, 75 | duration: Toast.LENGTH_SHORT, gravity: Toast.CENTER); 76 | }); 77 | } 78 | 79 | Future _onRefresh() async { 80 | offset = 0; 81 | _loadItemPage(); 82 | return null; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/widget/webview.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; 3 | 4 | class WebView extends StatefulWidget { 5 | final String url; 6 | final String title; 7 | 8 | const WebView({Key key, this.url, this.title}) : super(key: key); 9 | 10 | @override 11 | _WebViewState createState() => _WebViewState(); 12 | } 13 | 14 | class _WebViewState extends State { 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | } 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return WebviewScaffold( 24 | appBar: AppBar( 25 | title: Text(widget.title), 26 | centerTitle: true, 27 | leading: GestureDetector( 28 | onTap: () => Navigator.of(context).pop(), 29 | child:Container(child: Icon(Icons.close),padding: EdgeInsets.all(5),), 30 | ), 31 | ), 32 | url: widget.url, 33 | withZoom: true, 34 | hidden: true, 35 | initialChild: Center(child: CircularProgressIndicator()), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.0.10" 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.3.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.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.3" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "0.1.2" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_page_indicator: 73 | dependency: transitive 74 | description: 75 | name: flutter_page_indicator 76 | url: "https://pub.flutter-io.cn" 77 | source: hosted 78 | version: "0.0.3" 79 | flutter_staggered_grid_view: 80 | dependency: "direct main" 81 | description: 82 | name: flutter_staggered_grid_view 83 | url: "https://pub.flutter-io.cn" 84 | source: hosted 85 | version: "0.3.0" 86 | flutter_swiper: 87 | dependency: "direct main" 88 | description: 89 | name: flutter_swiper 90 | url: "https://pub.flutter-io.cn" 91 | source: hosted 92 | version: "1.1.6" 93 | flutter_test: 94 | dependency: "direct dev" 95 | description: flutter 96 | source: sdk 97 | version: "0.0.0" 98 | flutter_webview_plugin: 99 | dependency: "direct main" 100 | description: 101 | name: flutter_webview_plugin 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "0.3.5" 105 | http: 106 | dependency: "direct main" 107 | description: 108 | name: http 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "0.12.0+2" 112 | http_parser: 113 | dependency: transitive 114 | description: 115 | name: http_parser 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "3.1.3" 119 | image: 120 | dependency: transitive 121 | description: 122 | name: image 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "2.1.4" 126 | matcher: 127 | dependency: transitive 128 | description: 129 | name: matcher 130 | url: "https://pub.flutter-io.cn" 131 | source: hosted 132 | version: "0.12.5" 133 | meta: 134 | dependency: transitive 135 | description: 136 | name: meta 137 | url: "https://pub.flutter-io.cn" 138 | source: hosted 139 | version: "1.1.7" 140 | path: 141 | dependency: transitive 142 | description: 143 | name: path 144 | url: "https://pub.flutter-io.cn" 145 | source: hosted 146 | version: "1.6.4" 147 | pedantic: 148 | dependency: transitive 149 | description: 150 | name: pedantic 151 | url: "https://pub.flutter-io.cn" 152 | source: hosted 153 | version: "1.8.0+1" 154 | petitparser: 155 | dependency: transitive 156 | description: 157 | name: petitparser 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "2.4.0" 161 | quiver: 162 | dependency: transitive 163 | description: 164 | name: quiver 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "2.0.5" 168 | shared_preferences: 169 | dependency: "direct main" 170 | description: 171 | name: shared_preferences 172 | url: "https://pub.flutter-io.cn" 173 | source: hosted 174 | version: "0.5.3+1" 175 | sky_engine: 176 | dependency: transitive 177 | description: flutter 178 | source: sdk 179 | version: "0.0.99" 180 | source_span: 181 | dependency: transitive 182 | description: 183 | name: source_span 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.5.5" 187 | stack_trace: 188 | dependency: transitive 189 | description: 190 | name: stack_trace 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "1.9.3" 194 | stream_channel: 195 | dependency: transitive 196 | description: 197 | name: stream_channel 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "2.0.0" 201 | string_scanner: 202 | dependency: transitive 203 | description: 204 | name: string_scanner 205 | url: "https://pub.flutter-io.cn" 206 | source: hosted 207 | version: "1.0.5" 208 | term_glyph: 209 | dependency: transitive 210 | description: 211 | name: term_glyph 212 | url: "https://pub.flutter-io.cn" 213 | source: hosted 214 | version: "1.1.0" 215 | test_api: 216 | dependency: transitive 217 | description: 218 | name: test_api 219 | url: "https://pub.flutter-io.cn" 220 | source: hosted 221 | version: "0.2.5" 222 | toast: 223 | dependency: "direct main" 224 | description: 225 | name: toast 226 | url: "https://pub.flutter-io.cn" 227 | source: hosted 228 | version: "0.1.4" 229 | transformer_page_view: 230 | dependency: transitive 231 | description: 232 | name: transformer_page_view 233 | url: "https://pub.flutter-io.cn" 234 | source: hosted 235 | version: "0.1.6" 236 | typed_data: 237 | dependency: transitive 238 | description: 239 | name: typed_data 240 | url: "https://pub.flutter-io.cn" 241 | source: hosted 242 | version: "1.1.6" 243 | vector_math: 244 | dependency: transitive 245 | description: 246 | name: vector_math 247 | url: "https://pub.flutter-io.cn" 248 | source: hosted 249 | version: "2.0.8" 250 | xml: 251 | dependency: transitive 252 | description: 253 | name: xml 254 | url: "https://pub.flutter-io.cn" 255 | source: hosted 256 | version: "3.5.0" 257 | sdks: 258 | dart: ">=2.4.0 <3.0.0" 259 | flutter: ">=1.6.0 <2.0.0" 260 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: my_wanandroid 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | flutter_swiper : ^1.1.6 27 | http: ^0.12.0+2 28 | flutter_webview_plugin: ^0.3.5 29 | toast: ^0.1.3 30 | shared_preferences: ^0.5.3+1 31 | flutter_staggered_grid_view: ^0.3.0 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | 38 | # For information on the generic Dart part of this file, see the 39 | # following page: https://www.dartlang.org/tools/pub/pubspec 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | assets: 51 | - images/logo.png 52 | # - images/a_dot_ham.jpeg 53 | 54 | # An image asset can refer to one or more resolution-specific "variants", see 55 | # https://flutter.dev/assets-and-images/#resolution-aware. 56 | 57 | # For details regarding adding assets from package dependencies, see 58 | # https://flutter.dev/assets-and-images/#from-packages 59 | 60 | # To add custom fonts to your application, add a fonts section here, 61 | # in this "flutter" section. Each entry in this list should have a 62 | # "family" key with the font family name, and a "fonts" key with a 63 | # list giving the asset and other descriptors for the font. For 64 | # example: 65 | # fonts: 66 | # - family: Schyler 67 | # fonts: 68 | # - asset: fonts/Schyler-Regular.ttf 69 | # - asset: fonts/Schyler-Italic.ttf 70 | # style: italic 71 | # - family: Trajan Pro 72 | # fonts: 73 | # - asset: fonts/TrajanPro.ttf 74 | # - asset: fonts/TrajanPro_Bold.ttf 75 | # weight: 700 76 | # 77 | # For details regarding fonts from package dependencies, 78 | # see https://flutter.dev/custom-fonts/#from-packages 79 | -------------------------------------------------------------------------------- /source/img/drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/source/img/drawer.png -------------------------------------------------------------------------------- /source/img/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/source/img/h5.png -------------------------------------------------------------------------------- /source/img/体系.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/source/img/体系.png -------------------------------------------------------------------------------- /source/img/导航.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/source/img/导航.png -------------------------------------------------------------------------------- /source/img/项目.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/source/img/项目.png -------------------------------------------------------------------------------- /source/img/首页.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlee28/flutter-WanAndroid/05c8322afadb86937a88634319e1cde53bb53fdc/source/img/首页.png -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:my_wanandroid/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------