├── .gitignore ├── .metadata ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── yibh │ │ │ │ └── meimei │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ └── styles.xml │ │ │ └── xml │ │ │ └── network_security_config.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── key.properties ├── settings.gradle ├── yuey.jks └── yuey_sign.jks ├── img ├── 1.png ├── 2.png └── 3.png ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── bean │ ├── meitu.dart │ ├── trend.dart │ ├── wan_android.dart │ └── zhihu.dart ├── constant │ ├── constant.dart │ ├── string.dart │ └── ycolors.dart ├── home_root.dart ├── http │ ├── http_api.dart │ ├── http_response.dart │ └── httputil.dart ├── leisure │ ├── leisure.dart │ └── zhihu_page.dart ├── main.dart ├── meitu.dart ├── trend │ └── trend_page.dart ├── utils │ ├── route_util.dart │ └── screen_util.dart ├── wan │ └── wan_page.dart └── widget │ ├── img_widget.dart │ ├── web_page.dart │ └── ybanner.dart ├── pubspec.lock ├── pubspec.yaml └── 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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/ServiceDefinitions.json 65 | **/ios/Runner/GeneratedPluginRegistrant.* 66 | 67 | # Exceptions to above rules. 68 | !**/ios/**/default.mode1v3 69 | !**/ios/**/default.mode2v3 70 | !**/ios/**/default.pbxuser 71 | !**/ios/**/default.perspectivev3 72 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 73 | -------------------------------------------------------------------------------- /.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: 20e59316b8b8474554b38493b8ca888794b0234a 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YueY 2 | 3 | Fluttter 写的一个简约的app.图片列表,知乎日报,Flutter动态,玩安卓动态等浏览. 4 | 5 | [体验地址](https://www.pgyer.com/YueY) 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | def keystoreProperties = new Properties() 29 | def keystorePropertiesFile = rootProject.file('key.properties') 30 | if (keystorePropertiesFile.exists()) { 31 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 32 | } 33 | android { 34 | compileSdkVersion 28 35 | 36 | sourceSets { 37 | main.java.srcDirs += 'src/main/kotlin' 38 | } 39 | 40 | lintOptions { 41 | disable 'InvalidPackage' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.yibh.meimei" 47 | minSdkVersion 16 48 | targetSdkVersion 28 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 52 | } 53 | 54 | signingConfigs { 55 | release { 56 | keyAlias keystoreProperties['keyAlias'] 57 | keyPassword keystoreProperties['keyPassword'] 58 | storeFile file(keystoreProperties['storeFile']) 59 | storePassword keystoreProperties['storePassword'] 60 | } 61 | } 62 | buildTypes { 63 | release { 64 | signingConfig signingConfigs.release 65 | } 66 | } 67 | 68 | } 69 | 70 | flutter { 71 | source '../..' 72 | } 73 | 74 | dependencies { 75 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 76 | testImplementation 'junit:junit:4.12' 77 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 78 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 79 | } 80 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 23 | 27 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/yibh/meimei/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.yibh.meimei 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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | -------------------------------------------------------------------------------- /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/key.properties: -------------------------------------------------------------------------------- 1 | storePassword=yuey123 2 | keyPassword=yuey123 3 | keyAlias=yuey 4 | storeFile=../yuey.jks -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /android/yuey.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/android/yuey.jks -------------------------------------------------------------------------------- /android/yuey_sign.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/android/yuey_sign.jks -------------------------------------------------------------------------------- /img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/img/1.png -------------------------------------------------------------------------------- /img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/img/2.png -------------------------------------------------------------------------------- /img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/img/3.png -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | 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 pub 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 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 64 | install! 'cocoapods', :disable_input_output_paths => true 65 | 66 | post_install do |installer| 67 | installer.pods_project.targets.each do |target| 68 | target.build_configurations.each do |config| 69 | config.build_settings['ENABLE_BITCODE'] = 'NO' 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 1020; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = en; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 276 | CLANG_WARN_EMPTY_BODY = YES; 277 | CLANG_WARN_ENUM_CONVERSION = YES; 278 | CLANG_WARN_INFINITE_RECURSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 282 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 284 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 285 | CLANG_WARN_STRICT_PROTOTYPES = YES; 286 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 287 | CLANG_WARN_UNREACHABLE_CODE = YES; 288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 289 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 290 | COPY_PHASE_STRIP = NO; 291 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 292 | ENABLE_NS_ASSERTIONS = NO; 293 | ENABLE_STRICT_OBJC_MSGSEND = YES; 294 | GCC_C_LANGUAGE_STANDARD = gnu99; 295 | GCC_NO_COMMON_BLOCKS = YES; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 303 | MTL_ENABLE_DEBUG_INFO = NO; 304 | SDKROOT = iphoneos; 305 | TARGETED_DEVICE_FAMILY = "1,2"; 306 | VALIDATE_PRODUCT = YES; 307 | }; 308 | name = Profile; 309 | }; 310 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 311 | isa = XCBuildConfiguration; 312 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 313 | buildSettings = { 314 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 315 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 316 | DEVELOPMENT_TEAM = S8QB4VV633; 317 | ENABLE_BITCODE = NO; 318 | FRAMEWORK_SEARCH_PATHS = ( 319 | "$(inherited)", 320 | "$(PROJECT_DIR)/Flutter", 321 | ); 322 | INFOPLIST_FILE = Runner/Info.plist; 323 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 324 | LIBRARY_SEARCH_PATHS = ( 325 | "$(inherited)", 326 | "$(PROJECT_DIR)/Flutter", 327 | ); 328 | PRODUCT_BUNDLE_IDENTIFIER = com.yibh.meimei; 329 | PRODUCT_NAME = "$(TARGET_NAME)"; 330 | VERSIONING_SYSTEM = "apple-generic"; 331 | }; 332 | name = Profile; 333 | }; 334 | 97C147031CF9000F007C117D /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 337 | buildSettings = { 338 | ALWAYS_SEARCH_USER_PATHS = NO; 339 | CLANG_ANALYZER_NONNULL = YES; 340 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 341 | CLANG_CXX_LIBRARY = "libc++"; 342 | CLANG_ENABLE_MODULES = YES; 343 | CLANG_ENABLE_OBJC_ARC = YES; 344 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 345 | CLANG_WARN_BOOL_CONVERSION = YES; 346 | CLANG_WARN_COMMA = YES; 347 | CLANG_WARN_CONSTANT_CONVERSION = YES; 348 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 349 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 350 | CLANG_WARN_EMPTY_BODY = YES; 351 | CLANG_WARN_ENUM_CONVERSION = YES; 352 | CLANG_WARN_INFINITE_RECURSION = YES; 353 | CLANG_WARN_INT_CONVERSION = YES; 354 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = NO; 365 | DEBUG_INFORMATION_FORMAT = dwarf; 366 | ENABLE_STRICT_OBJC_MSGSEND = YES; 367 | ENABLE_TESTABILITY = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu99; 369 | GCC_DYNAMIC_NO_PIC = NO; 370 | GCC_NO_COMMON_BLOCKS = YES; 371 | GCC_OPTIMIZATION_LEVEL = 0; 372 | GCC_PREPROCESSOR_DEFINITIONS = ( 373 | "DEBUG=1", 374 | "$(inherited)", 375 | ); 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 383 | MTL_ENABLE_DEBUG_INFO = YES; 384 | ONLY_ACTIVE_ARCH = YES; 385 | SDKROOT = iphoneos; 386 | TARGETED_DEVICE_FAMILY = "1,2"; 387 | }; 388 | name = Debug; 389 | }; 390 | 97C147041CF9000F007C117D /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_ANALYZER_NONNULL = YES; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_COMMA = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INFINITE_RECURSION = YES; 409 | CLANG_WARN_INT_CONVERSION = YES; 410 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 412 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 414 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 415 | CLANG_WARN_STRICT_PROTOTYPES = YES; 416 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 417 | CLANG_WARN_UNREACHABLE_CODE = YES; 418 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 419 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 420 | COPY_PHASE_STRIP = NO; 421 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | GCC_C_LANGUAGE_STANDARD = gnu99; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 427 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 428 | GCC_WARN_UNDECLARED_SELECTOR = YES; 429 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 430 | GCC_WARN_UNUSED_FUNCTION = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | SDKROOT = iphoneos; 435 | TARGETED_DEVICE_FAMILY = "1,2"; 436 | VALIDATE_PRODUCT = YES; 437 | }; 438 | name = Release; 439 | }; 440 | 97C147061CF9000F007C117D /* Debug */ = { 441 | isa = XCBuildConfiguration; 442 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.yibh.meimei; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | VERSIONING_SYSTEM = "apple-generic"; 460 | }; 461 | name = Debug; 462 | }; 463 | 97C147071CF9000F007C117D /* Release */ = { 464 | isa = XCBuildConfiguration; 465 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 466 | buildSettings = { 467 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 468 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 469 | ENABLE_BITCODE = NO; 470 | FRAMEWORK_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | INFOPLIST_FILE = Runner/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 476 | LIBRARY_SEARCH_PATHS = ( 477 | "$(inherited)", 478 | "$(PROJECT_DIR)/Flutter", 479 | ); 480 | PRODUCT_BUNDLE_IDENTIFIER = com.yibh.meimei; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | VERSIONING_SYSTEM = "apple-generic"; 483 | }; 484 | name = Release; 485 | }; 486 | /* End XCBuildConfiguration section */ 487 | 488 | /* Begin XCConfigurationList section */ 489 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 97C147031CF9000F007C117D /* Debug */, 493 | 97C147041CF9000F007C117D /* Release */, 494 | 249021D3217E4FDB00AE95B9 /* Profile */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | 97C147061CF9000F007C117D /* Debug */, 503 | 97C147071CF9000F007C117D /* Release */, 504 | 249021D4217E4FDB00AE95B9 /* Profile */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | /* End XCConfigurationList section */ 510 | }; 511 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 512 | } 513 | -------------------------------------------------------------------------------- /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 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yihaha/YueY/be44959b31557434c5271334572714185e6d12cd/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 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | meimei 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/bean/meitu.dart: -------------------------------------------------------------------------------- 1 | class MeiTuBean { 2 | final String desc; 3 | final String url; 4 | 5 | MeiTuBean(this.desc, this.url); 6 | 7 | MeiTuBean.fromJson(Map json) 8 | : desc = json['desc'], 9 | url = json['url']; 10 | 11 | Map toJson() => { 12 | 'desc': desc, 13 | 'url': url, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /lib/bean/trend.dart: -------------------------------------------------------------------------------- 1 | ///动态 2 | class TrendBean { 3 | final String url; //网页介绍地址 4 | final String dateS; //时间 5 | final String title; //标题 6 | final String author; //作者 7 | 8 | TrendBean(this.url, this.dateS, this.title, this.author); 9 | 10 | TrendBean.fromJson(Map json) 11 | : url = json['originalUrl'], 12 | dateS = json['updatedAt'], 13 | author = json['user']['username'], 14 | title = json['title']; 15 | 16 | // Map toJson() => { 17 | // 'desc': desc, 18 | // 'url': url, 19 | // }; 20 | } 21 | -------------------------------------------------------------------------------- /lib/bean/wan_android.dart: -------------------------------------------------------------------------------- 1 | ///玩安卓项目列表item 2 | class WanAndroid { 3 | final String desc; 4 | final String url; //网页介绍地址 5 | final String proUrl; //项目地址 6 | final String imgUrl; //图片地址 7 | final String dateS; //时间 8 | final String title; //标题 9 | final String author; //作者 10 | 11 | WanAndroid(this.desc, this.url, this.proUrl, this.imgUrl, this.dateS, 12 | this.title, this.author); 13 | 14 | WanAndroid.fromJson(Map json) 15 | : desc = json['desc'], 16 | url = json['link'], 17 | proUrl = json['projectLink'], 18 | imgUrl = json['envelopePic'], 19 | dateS = json['niceDate'], 20 | author = json['author'], 21 | title = json['title']; 22 | 23 | // Map toJson() => { 24 | // 'desc': desc, 25 | // 'url': url, 26 | // }; 27 | } 28 | -------------------------------------------------------------------------------- /lib/bean/zhihu.dart: -------------------------------------------------------------------------------- 1 | class ZhiHuBanner { 2 | final String title; 3 | final int id; 4 | final String image; 5 | 6 | ZhiHuBanner(this.title, this.id, this.image); 7 | 8 | ZhiHuBanner.fromJson(Map json) 9 | : title = json['title'], 10 | image = json['image'], 11 | id = json['id']; 12 | 13 | Map toJson() => {'title': title, 'image': image, 'id': id}; 14 | } 15 | 16 | class ZHItemBean { 17 | final String title; 18 | final int id; 19 | final String image; 20 | 21 | ZHItemBean(this.title, this.id, this.image); 22 | 23 | ZHItemBean.fromJson(Map json) 24 | : title = json['title'], 25 | image = json['image'], 26 | id = json['id']; 27 | 28 | Map toJson() => {'title': title, 'image': image, 'id': id}; 29 | } 30 | -------------------------------------------------------------------------------- /lib/constant/constant.dart: -------------------------------------------------------------------------------- 1 | class Constant { 2 | ///知乎最新信息 3 | static const String ZhiHu_Last = 4 | 'https://news-at.zhihu.com/api/4/news/latest'; 5 | 6 | ///后面拼接上id,跳转到具体页面 7 | static const String ZhiHu_Web_Url = 'https://daily.zhihu.com/story/'; 8 | 9 | ///后面拼接上日期(例如: 20190811),获取日期对应列表 10 | static const String ZhiHu_Item_Url = 11 | 'https://news-at.zhihu.com/api/4/news/before/'; 12 | 13 | ///玩安卓 14 | static const String WanA_Base = 'https://www.wanandroid.com/project/list/'; 15 | 16 | ///加上页码和上面链接拼接 17 | static const String WanA_Pro = '/json?cid=294'; 18 | 19 | ///动态列表 20 | static const String Trend_Url='https://timeline-merger-ms.juejin.im/v1/get_tag_entry?src=web&tagId=5a96291f6fb9a0535b535438&sort=rankIndex'; 21 | } 22 | -------------------------------------------------------------------------------- /lib/constant/string.dart: -------------------------------------------------------------------------------- 1 | class YString { 2 | static const String NETWORK_NOT = '网络连接错误'; 3 | } 4 | -------------------------------------------------------------------------------- /lib/constant/ycolors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppColors { 4 | ///藤萝紫 5 | static const Color PRIMARY_TLZ_COLOR = const Color(0xFFF8076a3); 6 | } 7 | -------------------------------------------------------------------------------- /lib/home_root.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:meimei/constant/ycolors.dart'; 3 | 4 | import 'package:meimei/leisure/leisure.dart'; 5 | import 'meitu.dart'; 6 | 7 | //首页根布局,包含首页和其他页 8 | class HomeRootPage extends StatefulWidget { 9 | @override 10 | State createState() => HomeRootPageState(); 11 | } 12 | 13 | class HomeRootPageState extends State { 14 | List _tabTextList = ['美图', '休闲']; 15 | List _tabIconList = [Icons.face, Icons.free_breakfast]; 16 | int _tabIndex = 0; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | body: IndexedStack( 22 | children: [ 23 | MeiTu(), 24 | Leisure(), 25 | ], 26 | index: _tabIndex, 27 | ), 28 | bottomNavigationBar: BottomNavigationBar( 29 | items: [ 30 | BottomNavigationBarItem(icon: _getTabIcon(0), title: _getTabText(0)), 31 | BottomNavigationBarItem(icon: _getTabIcon(1), title: _getTabText(1)), 32 | ], 33 | currentIndex: _tabIndex, 34 | onTap: (index) { 35 | setState(() { 36 | _tabIndex = index; 37 | print('当前点击索引 $_tabIndex'); 38 | }); 39 | }, 40 | ), 41 | ); 42 | } 43 | 44 | //切换tab文字,改变颜色 45 | Text _getTabText(int index) { 46 | if (index == _tabIndex) { 47 | return Text( 48 | _tabTextList[index], 49 | style: TextStyle( 50 | color: AppColors.PRIMARY_TLZ_COLOR, fontWeight: FontWeight.w300), 51 | ); 52 | } else { 53 | return Text( 54 | _tabTextList[index], 55 | style: TextStyle( 56 | color: IconTheme.of(context).color, fontWeight: FontWeight.w300), 57 | ); 58 | } 59 | } 60 | 61 | //切换tab图片,改变颜色 62 | Icon _getTabIcon(int index) { 63 | if (index == _tabIndex) { 64 | return Icon( 65 | _tabIconList[index], 66 | color: AppColors.PRIMARY_TLZ_COLOR, 67 | ); 68 | } else { 69 | return Icon( 70 | _tabIconList[index], 71 | color: IconTheme.of(context).color, 72 | ); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/http/http_api.dart: -------------------------------------------------------------------------------- 1 | import 'package:flustars/flustars.dart'; 2 | import 'package:meimei/constant/constant.dart'; 3 | 4 | import 'http_response.dart'; 5 | import 'httputil.dart'; 6 | 7 | class HttpApi { 8 | ///获取图片 9 | static getMeiTuData(page, {count: 20}) async { 10 | String url = 'http://gank.io/api/data/福利/$count/$page'; 11 | print('美图请求链接 $url'); 12 | HttpResponse httpResponse = await HttpUtil.instance.request(url); 13 | return httpResponse.data; 14 | } 15 | 16 | ///获取知乎banner列表 17 | static getZhiHuBanner() async { 18 | String url = Constant.ZhiHu_Last; 19 | HttpResponse httpResponse = await HttpUtil.instance.request(url); 20 | return httpResponse.data; 21 | } 22 | 23 | ///获取知乎item列表 24 | static getZhiHuItem({String date}) async { 25 | print('最终日期: $date'); 26 | if (date.isEmpty) { 27 | date = DateUtil.formatDate(DateTime.now(), format: 'yyyyMMdd'); 28 | } 29 | String url = Constant.ZhiHu_Item_Url + date; 30 | print('请求链接: $url'); 31 | HttpResponse httpResponse = await HttpUtil.instance.request(url); 32 | return httpResponse.data; 33 | } 34 | 35 | ///玩安卓项目列表 36 | static wanAndroidList({int page: 1}) async { 37 | String url = Constant.WanA_Base + '$page' + Constant.WanA_Pro; 38 | print('玩安卓链接 $url'); 39 | HttpResponse httpResponse = await HttpUtil.instance.request(url); 40 | return httpResponse.data; 41 | } 42 | 43 | static trendList({int currPage: 1}) async { 44 | String url = Constant.Trend_Url; 45 | HttpResponse httpResponse = await HttpUtil.instance.request(url, params: { 46 | 'pageSize': 20, 47 | 'page': currPage 48 | }, header: { 49 | 'accept-language': 'zh-cn', 50 | 'content-type': 'application/json' 51 | }); 52 | return httpResponse.data; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/http/http_response.dart: -------------------------------------------------------------------------------- 1 | //返回统一处理 2 | class HttpResponse { 3 | int code; 4 | bool ySuccess; 5 | var data; 6 | 7 | HttpResponse(this.code, this.ySuccess, this.data); 8 | } 9 | -------------------------------------------------------------------------------- /lib/http/httputil.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | 3 | import 'package:connectivity/connectivity.dart'; 4 | import 'package:dio/dio.dart'; 5 | 6 | import 'package:meimei/constant/string.dart'; 7 | import 'http_response.dart'; 8 | 9 | class HttpUtil { 10 | Dio mDio; 11 | 12 | //这里用到了单例,下面是单例模式 13 | static HttpUtil get instance => _getInstance(); 14 | static HttpUtil _instance; 15 | 16 | //构造方法 17 | HttpUtil._internal() { 18 | if (mDio == null) { 19 | mDio = Dio(); 20 | } 21 | } 22 | 23 | static HttpUtil _getInstance() { 24 | if (_instance == null) { 25 | _instance = HttpUtil._internal(); 26 | } 27 | return _instance; 28 | } 29 | 30 | Future request(url, {meth: 'get', params, header}) async { 31 | //请求头 32 | Map headerMap = HashMap(); 33 | if (null != header) { 34 | headerMap.addAll(header); 35 | } 36 | 37 | Options yOptions = Options(); 38 | yOptions.headers = headerMap; 39 | yOptions.method = meth; 40 | yOptions.connectTimeout = 5 * 60 * 1000; 41 | yOptions.receiveTimeout = 5 * 60 * 1000; 42 | 43 | //是否有网络 44 | var connectivityResult = await (Connectivity().checkConnectivity()); 45 | if (connectivityResult == ConnectivityResult.none) { 46 | //无网络 47 | return HttpResponse(-1, false, YString.NETWORK_NOT); 48 | } 49 | 50 | Response response; 51 | try { 52 | response = await mDio.request(url, data: params, options: yOptions); 53 | } catch (e) { 54 | return HttpResponse(-1, false, e.toString()); 55 | } 56 | 57 | try { 58 | if (response.statusCode == 200 || response.statusCode == 201) { 59 | return HttpResponse(1, true, response.data); 60 | } 61 | } catch (e) { 62 | return HttpResponse(-1, false, e.toString()); 63 | } 64 | 65 | return HttpResponse(response.statusCode, true, 'Error'); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/leisure/leisure.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:meimei/leisure/zhihu_page.dart'; 3 | import 'package:meimei/trend/trend_page.dart'; 4 | import 'package:meimei/wan/wan_page.dart'; 5 | 6 | class Leisure extends StatefulWidget { 7 | @override 8 | State createState() => LeisureState(); 9 | } 10 | 11 | class LeisureState extends State with SingleTickerProviderStateMixin { 12 | List _tabTitleList = ['知乎日报', 'Flutter动态', '完整项目']; 13 | TabController _tabController; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _tabController = TabController(length: _tabTitleList.length, vsync: this); 19 | } 20 | 21 | @override 22 | void dispose() { 23 | _tabController.dispose(); 24 | super.dispose(); 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( 31 | centerTitle: true, 32 | title: TabBar( 33 | controller: _tabController, 34 | isScrollable: true, 35 | indicatorSize: TabBarIndicatorSize.label, 36 | indicatorColor: Colors.white, 37 | labelColor: Colors.white, 38 | tabs: _tabTitleList 39 | .map((st) => Tab( 40 | text: st, 41 | )) 42 | .toList(), 43 | 44 | ///设置选中/非选中字体大小不同,可以有动画效果 45 | labelStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), 46 | unselectedLabelStyle: 47 | TextStyle(fontSize: 14, fontWeight: FontWeight.normal), 48 | ), 49 | ), 50 | body: TabBarView( 51 | children: _tabTitleList.map((st) { 52 | if (st == '知乎日报') { 53 | return ZhiHuPage(); 54 | } else if (st == 'Flutter动态') { 55 | return TrendPage(); 56 | } else { 57 | return WanAndroidPage(); 58 | } 59 | }).toList(), 60 | controller: _tabController, 61 | ), 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /lib/leisure/zhihu_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flustars/flustars.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:meimei/bean/zhihu.dart'; 8 | import 'package:meimei/constant/constant.dart'; 9 | import 'package:meimei/http/http_api.dart'; 10 | import 'package:meimei/utils/route_util.dart'; 11 | import 'package:meimei/utils/screen_util.dart'; 12 | import 'package:meimei/widget/ybanner.dart'; 13 | import 'package:pull_to_refresh/pull_to_refresh.dart'; 14 | 15 | class ZhiHuPage extends StatefulWidget { 16 | @override 17 | State createState() => ZhihuState(); 18 | } 19 | 20 | class ZhihuState extends State with AutomaticKeepAliveClientMixin { 21 | bool _isLoading = true; //加载中... 22 | RefreshController _mRefreshController; 23 | ScrollController controller = ScrollController(); 24 | bool isShowFloatButton = false; 25 | 26 | ///存储banner数据 27 | List _banners = []; 28 | 29 | ///条目 30 | List _zhiHlist = []; 31 | 32 | DateTime _currDate = DateTime.now(); 33 | 34 | @override 35 | void initState() { 36 | super.initState(); 37 | 38 | ///默认不显示回首页按钮 39 | _mRefreshController = RefreshController(); 40 | controller.addListener(() { 41 | var offset = controller.offset; 42 | var wHeight = YScreenUtil.getWinHeight(); 43 | // print('滑动位置 $offset '); 44 | // \n 屏幕高度 $wHeight'); 45 | ///查看log,发现这个位置相对比较合适 46 | if (offset < wHeight / 3 && isShowFloatButton) { 47 | setState(() { 48 | isShowFloatButton = false; 49 | }); 50 | } else if (offset > wHeight / 3 && !isShowFloatButton) { 51 | setState(() { 52 | isShowFloatButton = true; 53 | }); 54 | } 55 | }); 56 | 57 | initData(); 58 | } 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | return Stack( 63 | children: [ 64 | Offstage( 65 | offstage: _isLoading, 66 | child: SmartRefresher( 67 | header: Platform.isAndroid 68 | ? MaterialClassicHeader( 69 | ///下拉状态的颜色 70 | color: Theme.of(context).primaryColor, 71 | ) 72 | : ClassicHeader(), 73 | onRefresh: toRefresh, 74 | onLoading: getMore, 75 | controller: _mRefreshController, 76 | enablePullUp: true, 77 | child: listviewBuild(), 78 | ), 79 | ), 80 | yFloatingActionButton(), 81 | Offstage( 82 | offstage: !_isLoading, 83 | child: Center( 84 | child: CupertinoActivityIndicator(), 85 | ), 86 | ) 87 | ], 88 | ); 89 | } 90 | 91 | ///回到顶部按钮 92 | Widget yFloatingActionButton() { 93 | return Positioned( 94 | right: 20, 95 | bottom: 60, 96 | 97 | ///加个淡入淡出效果 98 | child: AnimatedOpacity( 99 | opacity: isShowFloatButton ? 1.0 : 0.0, 100 | duration: Duration(milliseconds: 300), 101 | child: FloatingActionButton( 102 | heroTag: 'zhihu_up_first', 103 | onPressed: () { 104 | ///显示的时候才响应点击事件 105 | if (isShowFloatButton) { 106 | ///回到顶部 107 | controller.animateTo(0, 108 | duration: Duration(milliseconds: 300), 109 | curve: Curves.linear); 110 | } 111 | }, 112 | backgroundColor: Theme.of(context).primaryColor, 113 | child: Icon(Icons.keyboard_arrow_up), 114 | ))); 115 | } 116 | 117 | void initData() async { 118 | // var data = await getBanner(); 119 | var data = await HttpApi.getZhiHuBanner(); 120 | List banners = data['top_stories'] 121 | .map((bean) => ZhiHuBanner.fromJson(bean)) 122 | .toList(); 123 | 124 | String lastDate = data['date']; //最新日报的时间 125 | //不相同就以lastdate为准 126 | _currDate = DateTime.parse(lastDate); 127 | String date = DateUtil.formatDate(_currDate, format: 'yyyyMMdd'); 128 | 129 | var ddd = data['stories']; 130 | print(ddd.toString()); 131 | 132 | /// mounted 为 true 表示当前页面挂在到构件树中,为 false 时未挂载当前页面 133 | if (!mounted) { 134 | return; 135 | } 136 | if (_isLoading) { 137 | setState(() { 138 | _isLoading = false; 139 | _banners.addAll(banners); 140 | _zhiHlist.addAll(formatZhItem(data)); 141 | }); 142 | } 143 | 144 | var data2 = await getZHItem(date: date); 145 | setState(() { 146 | if (_isLoading) { 147 | _isLoading = false; 148 | } 149 | _zhiHlist.addAll(formatZhItem(data2)); 150 | }); 151 | } 152 | 153 | ///获取banner列表 154 | Future getBanner() async { 155 | var data = await HttpApi.getZhiHuBanner(); 156 | List banners = data['top_stories'] 157 | .map((bean) => ZhiHuBanner.fromJson(bean)) 158 | .toList(); 159 | return banners; 160 | } 161 | 162 | ///下拉刷新 163 | void toRefresh() async { 164 | var data = await HttpApi.getZhiHuBanner(); 165 | List banners = data['top_stories'] 166 | .map((bean) => ZhiHuBanner.fromJson(bean)) 167 | .toList(); 168 | 169 | await Future.delayed(Duration(milliseconds: 1000)); 170 | _mRefreshController.refreshCompleted(); 171 | setState(() { 172 | _banners = banners; 173 | _zhiHlist = formatZhItem(data); 174 | }); 175 | 176 | String lastDate = data['date']; //最新日报的时间 177 | //不相同就以lastdate为准 178 | _currDate = DateTime.parse(lastDate); 179 | String date = DateUtil.formatDate(_currDate, format: 'yyyyMMdd'); 180 | 181 | var data2 = await getZHItem(date: date); 182 | setState(() { 183 | _isLoading = false; 184 | _zhiHlist.addAll(formatZhItem(data2)); 185 | }); 186 | } 187 | 188 | ///上拉加载更多 189 | void getMore() async { 190 | _currDate = _currDate.add(Duration(days: -1)); 191 | String date = DateUtil.formatDate(_currDate, format: 'yyyyMMdd'); 192 | print('more_date:${_currDate.add(Duration(days: -1))} : $date'); 193 | var data = await getZHItem(date: date); 194 | await Future.delayed(Duration(milliseconds: 1000)); 195 | _mRefreshController.loadComplete(); 196 | setState(() { 197 | _zhiHlist.addAll(formatZhItem(data)); 198 | }); 199 | } 200 | 201 | Future getZHItem({String date}) async { 202 | var data = await HttpApi.getZhiHuItem(date: date); 203 | return data; 204 | } 205 | 206 | ///统一格式化item 207 | List formatZhItem(var data) { 208 | ///最新消息接口带有条目 209 | List zhiHList = []; 210 | var ddd = data['stories']; 211 | ddd.map((bean) { 212 | // print(bean['images'][0].toString()); 213 | bean['image'] = bean['images'][0].toString(); 214 | // print('测试图片链接 ${bean['image']}'); 215 | zhiHList.add(ZHItemBean.fromJson(bean)); 216 | }).toList(); 217 | return zhiHList; 218 | } 219 | 220 | ///ListView 221 | ListView listviewBuild() { 222 | return ListView.builder( 223 | itemBuilder: (context, index) { 224 | if (index == 0) { 225 | return YBanner( 226 | _banners.map((banner) => banner.image).toList(), 227 | titleList: _banners.map((banner) => banner.title).toList(), 228 | onClickIndex: (index) { 229 | ///跳转到webview 230 | RouteUtil.routeToWeb( 231 | context, Constant.ZhiHu_Web_Url + '${_banners[index].id}', 232 | title: _banners[index].title); 233 | }, 234 | ); 235 | } else { 236 | return zhiHItemView(index - 1); 237 | } 238 | }, 239 | controller: controller, 240 | itemCount: _zhiHlist.length + 1, 241 | ); 242 | } 243 | 244 | ///具体条目 245 | Widget zhiHItemView(int index) { 246 | // print('具体条目索引 $index'); 247 | return InkWell( 248 | onTap: () { 249 | ///跳转到webview 250 | RouteUtil.routeToWeb( 251 | context, Constant.ZhiHu_Web_Url + '${_zhiHlist[index].id}', 252 | title: _zhiHlist[index].title); 253 | }, 254 | child: Padding( 255 | padding: EdgeInsets.symmetric(horizontal: 10), 256 | child: Column( 257 | children: [ 258 | Container( 259 | color: Colors.white, 260 | height: 100, 261 | child: Align( 262 | alignment: Alignment.center, 263 | child: Container( 264 | height: 80, 265 | child: Row( 266 | crossAxisAlignment: CrossAxisAlignment.start, 267 | children: [ 268 | Expanded( 269 | child: Text( 270 | _zhiHlist[index].title, 271 | style: TextStyle( 272 | fontSize: 13, 273 | color: Colors.black87, 274 | fontWeight: FontWeight.w600), 275 | softWrap: true, 276 | )), 277 | SizedBox( 278 | width: 8, 279 | ), 280 | CachedNetworkImage( 281 | width: 90, 282 | height: 80, 283 | imageUrl: _zhiHlist[index].image, 284 | fit: BoxFit.cover, 285 | ) 286 | ], 287 | ), 288 | ), 289 | ), 290 | ), 291 | 292 | ///添加分割线 293 | Divider( 294 | color: Colors.grey, 295 | height: 0.5, 296 | ) 297 | ], 298 | )), 299 | ); 300 | } 301 | 302 | @override 303 | bool get wantKeepAlive => true; 304 | } 305 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:meimei/constant/ycolors.dart'; 5 | 6 | import 'home_root.dart'; 7 | 8 | void main() => runApp(MyApp()); 9 | 10 | class MyApp extends StatelessWidget { 11 | @override 12 | Widget build(BuildContext context) { 13 | if (Platform.isAndroid) { 14 | //anroid状态栏颜色统一 15 | SystemUiOverlayStyle systemUiOverlayStyle = 16 | SystemUiOverlayStyle(statusBarColor: Colors.transparent); 17 | SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); 18 | } 19 | return MaterialApp( 20 | title: 'YueY', 21 | theme: ThemeData( 22 | primaryColor: AppColors.PRIMARY_TLZ_COLOR, 23 | ), 24 | home: HomeRootPage(), 25 | //去掉debug logo 26 | debugShowCheckedModeBanner: false, 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/meitu.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'dart:ui'; 4 | 5 | import 'package:cached_network_image/cached_network_image.dart'; 6 | import 'package:flutter/cupertino.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter/services.dart'; 9 | import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 10 | import 'package:meimei/utils/route_util.dart'; 11 | import 'package:meimei/utils/screen_util.dart'; 12 | import 'package:pull_to_refresh/pull_to_refresh.dart'; 13 | 14 | import 'bean/meitu.dart'; 15 | import 'http/http_api.dart'; 16 | 17 | class MeiTu extends StatefulWidget { 18 | @override 19 | State createState() => MeiTuState(); 20 | } 21 | 22 | class MeiTuState extends State with AutomaticKeepAliveClientMixin { 23 | int _currPage = 1; 24 | bool _isLoading = true; //加载中... 25 | RefreshController _mRefreshController; 26 | ScrollController controller = ScrollController(); 27 | List _tuList = []; 28 | bool _isOneColumn = false; //默认两列 29 | bool isShowFloatButton = false; 30 | double yNavigationShow = 0; //控制顶部导航栏是否显示1显示,0隐藏 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | Timer(Duration(milliseconds: 1000), () { 36 | YScreenUtil.updateStatusBarStyle(SystemUiOverlayStyle.dark); 37 | }); 38 | 39 | ///默认不显示回首页按钮 40 | _mRefreshController = RefreshController(); 41 | controller.addListener(() { 42 | var offset = controller.offset; 43 | var wHeight = window.physicalSize.height; 44 | // print('滑动位置 $offset '); 45 | // \n 屏幕高度 $wHeight'); 46 | ///查看log,发现这个位置相对比较合适 47 | if (offset < wHeight / 3 && isShowFloatButton) { 48 | setState(() { 49 | isShowFloatButton = false; 50 | }); 51 | } else if (offset > wHeight / 3 && !isShowFloatButton) { 52 | setState(() { 53 | isShowFloatButton = true; 54 | }); 55 | } 56 | 57 | ///控制导航栏的显示与隐藏 58 | if (offset <= kToolbarHeight + MediaQuery.of(context).padding.top) { 59 | ///隐藏 60 | setState(() { 61 | YScreenUtil.updateStatusBarStyle(SystemUiOverlayStyle.dark); 62 | yNavigationShow = 0; 63 | }); 64 | } else { 65 | setState(() { 66 | YScreenUtil.updateStatusBarStyle(SystemUiOverlayStyle.light); 67 | yNavigationShow = 1; 68 | }); 69 | } 70 | }); 71 | 72 | initData(); 73 | } 74 | 75 | void initData() async { 76 | var list = await _getData(); 77 | setState(() { 78 | _tuList.addAll(list); 79 | _isLoading = false; 80 | }); 81 | } 82 | 83 | ///网络请求数据 84 | Future _getData() async { 85 | var data = await HttpApi.getMeiTuData(_currPage); 86 | print('获取的数据' + data['results'].toString()); 87 | var meiTuList = data['results'] 88 | .map((item) => MeiTuBean.fromJson(item)) 89 | .toList(); 90 | print('转换后的shuju' + meiTuList[0].desc); 91 | return meiTuList; 92 | } 93 | 94 | @override 95 | Widget build(BuildContext context) { 96 | super.build(context); 97 | return Container( 98 | child: Stack( 99 | children: [ 100 | Offstage( 101 | offstage: _isLoading, 102 | child: SmartRefresher( 103 | header: Platform.isAndroid 104 | ? MaterialClassicHeader( 105 | ///下拉状态的颜色 106 | color: Theme.of(context).primaryColor, 107 | ) 108 | : ClassicHeader(), 109 | onRefresh: toRefresh, 110 | onLoading: getMore, 111 | controller: _mRefreshController, 112 | enablePullUp: true, 113 | // child: GridView.builder( 114 | // controller: controller, 115 | // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 116 | // crossAxisCount: _isOneColumn ? 1 : 2, 117 | // childAspectRatio: 3 / (_isOneColumn ? 3.5 : 4), 118 | // crossAxisSpacing: 8), 119 | // itemCount: _tuList.length, 120 | // padding: EdgeInsets.fromLTRB( 121 | // 8, ScreenUtil.getStatusHeight(), 8, 8), 122 | // itemBuilder: (context, index) { 123 | // var itemBean = _tuList[index]; 124 | // return GestureDetector( 125 | // onTap: () { 126 | // RouteUtil.routeToImg( 127 | // context, 128 | // _tuList.map((bean) { 129 | // return bean.url; 130 | // }).toList(), 131 | // _tuList.map((bean) { 132 | // return bean.desc; 133 | // }).toList(), 134 | // position: index); 135 | // }, 136 | // child: Padding( 137 | // padding: const EdgeInsets.only(bottom: 8), 138 | // child: _tuItemView(itemBean), 139 | // )); 140 | // }), 141 | // 142 | child: StaggeredGridView.countBuilder( 143 | controller: controller, 144 | 145 | ///两列值是4 146 | crossAxisCount: _isOneColumn ? 1 : 4, 147 | // crossAxisCount: 4, 148 | itemCount: _tuList.length, 149 | // childAspectRatio: 3 / (_isOneColumn ? 3.5 : 4), 150 | crossAxisSpacing: 8, 151 | padding: 152 | EdgeInsets.fromLTRB(8, YScreenUtil.getStatusHeight(), 8, 8), 153 | itemBuilder: (context, index) { 154 | var itemBean = _tuList[index]; 155 | return GestureDetector( 156 | onTap: () { 157 | RouteUtil.routeToImg( 158 | context, 159 | _tuList.map((bean) { 160 | return bean.url; 161 | }).toList(), 162 | _tuList.map((bean) { 163 | return bean.desc; 164 | }).toList(), 165 | position: index); 166 | }, 167 | child: Padding( 168 | padding: const EdgeInsets.only(bottom: 8), 169 | child: _tuItemView(itemBean), 170 | )); 171 | }, 172 | 173 | staggeredTileBuilder: (index) => StaggeredTile.count( 174 | 175 | ///两列值需要是2 176 | _isOneColumn ? 1 : 2, 177 | _isOneColumn ? 1.05 : (index.isEven ? 3.3 : 2.5)), 178 | ), 179 | 180 | /// 181 | ), 182 | ), 183 | yFloatingActionButton(), 184 | yNavigationBar(), 185 | Offstage( 186 | offstage: !_isLoading, 187 | child: Center( 188 | child: CupertinoActivityIndicator(), 189 | ), 190 | ) 191 | ], 192 | ), 193 | ); 194 | } 195 | 196 | ///下拉刷新 197 | void toRefresh() async { 198 | _currPage = 1; 199 | var tuList = await _getData(); 200 | await Future.delayed(Duration(milliseconds: 1000)); 201 | _mRefreshController.refreshCompleted(); 202 | setState(() { 203 | _tuList = tuList; 204 | }); 205 | } 206 | 207 | ///上拉加载更多 208 | void getMore() async { 209 | _currPage++; 210 | var tuList = await _getData(); 211 | await Future.delayed(Duration(milliseconds: 1000)); 212 | _mRefreshController.loadComplete(); 213 | setState(() { 214 | _tuList.addAll(tuList); 215 | }); 216 | } 217 | 218 | ///图片item 219 | Widget _tuItemView(item) { 220 | return ClipRRect( 221 | borderRadius: BorderRadius.all(Radius.circular(5)), 222 | child: Stack( 223 | children: [ 224 | Positioned.fill( 225 | child: CachedNetworkImage( 226 | imageUrl: item.url, 227 | fit: BoxFit.cover, 228 | )), 229 | Positioned( 230 | bottom: 0, 231 | child: Container( 232 | color: Colors.black38, 233 | // width: MediaQuery.of(context).size.width, 234 | width: window.physicalSize.width / 2, 235 | child: Padding( 236 | padding: const EdgeInsets.fromLTRB(16, 8, 0, 8), 237 | child: Text( 238 | item.desc, 239 | style: TextStyle( 240 | fontSize: 11, 241 | color: Colors.white, 242 | fontWeight: FontWeight.bold), 243 | ), 244 | ), 245 | )), 246 | ], 247 | ), 248 | ); 249 | } 250 | 251 | ///回到顶部按钮 252 | Widget yFloatingActionButton() { 253 | return Positioned( 254 | right: 20, 255 | bottom: 60, 256 | 257 | ///加个淡入淡出效果 258 | child: AnimatedOpacity( 259 | opacity: isShowFloatButton ? 1.0 : 0.0, 260 | duration: Duration(milliseconds: 300), 261 | child: FloatingActionButton( 262 | heroTag: 'meitu_up_first', 263 | onPressed: () { 264 | ///显示的时候才响应点击事件 265 | if (isShowFloatButton) { 266 | ///回到顶部 267 | controller.animateTo(0, 268 | duration: Duration(milliseconds: 300), 269 | curve: Curves.linear); 270 | } 271 | }, 272 | backgroundColor: Theme.of(context).primaryColor, 273 | child: Icon(Icons.keyboard_arrow_up), 274 | ))); 275 | } 276 | 277 | ///顶部导航 278 | Widget yNavigationBar() { 279 | return AnimatedOpacity( 280 | opacity: yNavigationShow, 281 | duration: Duration(milliseconds: 300), 282 | child: Container( 283 | color: Theme.of(context).primaryColor, 284 | 285 | ///appbar高度+状态栏高度 286 | height: 287 | kToolbarHeight + MediaQueryData.fromWindow(window).padding.top, 288 | // padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), 289 | 290 | // height: 70, 291 | padding: EdgeInsets.only(top: 15), 292 | child: Row( 293 | crossAxisAlignment: CrossAxisAlignment.center, 294 | children: [ 295 | Expanded( 296 | child: Stack( 297 | children: [ 298 | Align( 299 | alignment: Alignment.center, 300 | child: Text( 301 | '福利', 302 | style: TextStyle( 303 | fontSize: 18, 304 | color: Colors.white, 305 | fontWeight: FontWeight.bold), 306 | ), 307 | ), 308 | Positioned( 309 | right: 16, 310 | top: 1, 311 | bottom: 1, 312 | child: GestureDetector( 313 | onTap: () { 314 | if (yNavigationShow == 1) { 315 | setState(() { 316 | _isOneColumn = !_isOneColumn; 317 | }); 318 | } 319 | }, 320 | child: Icon(Icons.view_quilt, color: Colors.white), 321 | )) 322 | ], 323 | ), 324 | ) 325 | ], 326 | )), 327 | ); 328 | } 329 | 330 | @override 331 | bool get wantKeepAlive => true; 332 | 333 | @override 334 | void dispose() { 335 | _mRefreshController.dispose(); 336 | controller.dispose(); 337 | super.dispose(); 338 | } 339 | } 340 | -------------------------------------------------------------------------------- /lib/trend/trend_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flustars/flustars.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:meimei/bean/trend.dart'; 8 | import 'package:meimei/http/http_api.dart'; 9 | import 'package:meimei/utils/route_util.dart'; 10 | import 'package:meimei/utils/screen_util.dart'; 11 | import 'package:pull_to_refresh/pull_to_refresh.dart'; 12 | 13 | class TrendPage extends StatefulWidget { 14 | @override 15 | State createState() => TrendState(); 16 | } 17 | 18 | class TrendState extends State with AutomaticKeepAliveClientMixin { 19 | bool _isLoading = true; //加载中... 20 | RefreshController _mRefreshController; 21 | ScrollController controller = ScrollController(); 22 | bool isShowFloatButton = false; 23 | int _currPage = 1; 24 | 25 | ///条目 26 | List _trendList = []; 27 | 28 | @override 29 | void initState() { 30 | super.initState(); 31 | 32 | ///默认不显示回首页按钮 33 | _mRefreshController = RefreshController(); 34 | controller.addListener(() { 35 | var offset = controller.offset; 36 | var wHeight = YScreenUtil.getWinHeight(); 37 | // print('滑动位置 $offset '); 38 | // \n 屏幕高度 $wHeight'); 39 | ///查看log,发现这个位置相对比较合适 40 | if (offset < wHeight / 3 && isShowFloatButton) { 41 | setState(() { 42 | isShowFloatButton = false; 43 | }); 44 | } else if (offset > wHeight / 3 && !isShowFloatButton) { 45 | setState(() { 46 | isShowFloatButton = true; 47 | }); 48 | } 49 | }); 50 | 51 | initData(); 52 | } 53 | 54 | void initData() async { 55 | var data = await HttpApi.trendList(); 56 | List wanList = formatData(data); 57 | 58 | /// mounted 为 true 表示当前页面挂在到构件树中,为 false 时未挂载当前页面 59 | if (!mounted) { 60 | return; 61 | } 62 | if (_isLoading) { 63 | setState(() { 64 | _isLoading = false; 65 | _trendList.addAll(wanList); 66 | }); 67 | } 68 | } 69 | 70 | ///下拉刷新 71 | void toRefresh() async { 72 | _currPage = 1; 73 | var data = await HttpApi.trendList(currPage: _currPage); 74 | List wanList = formatData(data); 75 | 76 | await Future.delayed(Duration(milliseconds: 1000)); 77 | _mRefreshController.refreshCompleted(); 78 | setState(() { 79 | _trendList = wanList; 80 | }); 81 | } 82 | 83 | ///上拉加载更多 84 | void getMore() async { 85 | _currPage++; 86 | var data = await HttpApi.trendList(currPage: _currPage); 87 | List wanList = formatData(data); 88 | await Future.delayed(Duration(milliseconds: 1000)); 89 | _mRefreshController.loadComplete(); 90 | setState(() { 91 | _trendList.addAll(wanList); 92 | }); 93 | } 94 | 95 | List formatData(var data) { 96 | return data['d']['entrylist'] 97 | .map((bean) => TrendBean.fromJson(bean)) 98 | .toList(); 99 | } 100 | 101 | @override 102 | Widget build(BuildContext context) { 103 | return Stack( 104 | children: [ 105 | Offstage( 106 | offstage: _isLoading, 107 | child: SmartRefresher( 108 | header: Platform.isAndroid 109 | ? MaterialClassicHeader( 110 | ///下拉状态的颜色 111 | color: Theme.of(context).primaryColor, 112 | ) 113 | : ClassicHeader(), 114 | onRefresh: toRefresh, 115 | onLoading: getMore, 116 | controller: _mRefreshController, 117 | enablePullUp: true, 118 | child: listviewBuild(), 119 | ), 120 | ), 121 | yFloatingActionButton(), 122 | Offstage( 123 | offstage: !_isLoading, 124 | child: Center( 125 | child: CupertinoActivityIndicator(), 126 | ), 127 | ) 128 | ], 129 | ); 130 | } 131 | 132 | ///回到顶部按钮 133 | Widget yFloatingActionButton() { 134 | return Positioned( 135 | right: 20, 136 | bottom: 60, 137 | 138 | ///加个淡入淡出效果 139 | child: AnimatedOpacity( 140 | opacity: isShowFloatButton ? 1.0 : 0.0, 141 | duration: Duration(milliseconds: 300), 142 | child: FloatingActionButton( 143 | heroTag: 'trend_up_first', 144 | onPressed: () { 145 | ///显示的时候才响应点击事件 146 | if (isShowFloatButton) { 147 | ///回到顶部 148 | controller.animateTo(0, 149 | duration: Duration(milliseconds: 300), 150 | curve: Curves.linear); 151 | } 152 | }, 153 | backgroundColor: Theme.of(context).primaryColor, 154 | child: Icon(Icons.keyboard_arrow_up), 155 | ))); 156 | } 157 | 158 | ///ListView 159 | ListView listviewBuild() { 160 | return ListView.builder( 161 | itemBuilder: (context, index) { 162 | return itemView(index); 163 | }, 164 | controller: controller, 165 | itemCount: _trendList.length, 166 | ); 167 | } 168 | 169 | ///具体条目 170 | Widget itemView(int index) { 171 | // print('具体条目索引 $index'); 172 | return InkWell( 173 | onTap: () { 174 | ///跳转到webview 175 | RouteUtil.routeToWeb(context, _trendList[index].url, 176 | title: _trendList[index].title); 177 | }, 178 | child: Padding( 179 | padding: EdgeInsets.symmetric(horizontal: 10), 180 | child: Column( 181 | children: [ 182 | Container( 183 | color: Colors.white, 184 | width: YScreenUtil.getWinWidth() - 20, 185 | height: 100, 186 | child: Column( 187 | mainAxisAlignment: MainAxisAlignment.center, 188 | crossAxisAlignment: CrossAxisAlignment.start, 189 | children: [ 190 | Text( 191 | _trendList[index].title, 192 | style: TextStyle( 193 | fontSize: 13, 194 | color: Colors.black87, 195 | fontWeight: FontWeight.w600), 196 | softWrap: true, 197 | ), 198 | SizedBox( 199 | height: 18, 200 | ), 201 | 202 | ///作者 203 | Text( 204 | 'author: ${_trendList[index].author}', 205 | style: TextStyle( 206 | fontSize: 10, 207 | color: Colors.black54, 208 | fontWeight: FontWeight.w500), 209 | softWrap: true, 210 | ), 211 | SizedBox( 212 | height: 6, 213 | ), 214 | 215 | ///日期 216 | Text( 217 | 'date: ${DateUtil.formatDate(DateTime.parse(_trendList[index].dateS), format: 'yyyy年MM月dd日')}', 218 | style: TextStyle( 219 | fontSize: 10, 220 | color: Colors.black54, 221 | fontWeight: FontWeight.w500), 222 | softWrap: true, 223 | ) 224 | ], 225 | ), 226 | ), 227 | 228 | ///添加分割线 229 | Divider( 230 | color: Colors.grey, 231 | height: 0.5, 232 | ) 233 | ], 234 | )), 235 | ); 236 | } 237 | 238 | @override 239 | bool get wantKeepAlive => true; 240 | } 241 | -------------------------------------------------------------------------------- /lib/utils/route_util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:meimei/widget/img_widget.dart'; 3 | import 'package:meimei/widget/web_page.dart'; 4 | 5 | class RouteUtil { 6 | ///使用ios的跳转,有右滑动返回 7 | static push(BuildContext context, Widget wid) { 8 | Navigator.push(context, CupertinoPageRoute(builder: (context) => wid)); 9 | } 10 | 11 | ///跳转到图片查看页 12 | static routeToImg( 13 | BuildContext context, List urls, List titleList, 14 | {int position}) { 15 | push(context, ImgPage(urls, titleList, index: position)); 16 | } 17 | 18 | ///跳转到web页 19 | static routeToWeb(BuildContext context, url, {String title}) { 20 | push(context, YWebView(url, title: title)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/utils/screen_util.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:ui'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | 7 | class YScreenUtil { 8 | ///获取屏幕宽 ,注意: MediaQuery.of(context).padding.top 方法在release版本可能出现白屏 9 | static double getWinWidth() { 10 | return window.physicalSize.width; 11 | 12 | ///或者 13 | /// MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); 14 | /// return mediaQuery.size.width; 15 | } 16 | 17 | ///获取屏幕高度 18 | static double getWinHeight() { 19 | return window.physicalSize.height; 20 | 21 | ///或者 22 | /// MediaQueryData mediaQuery = MediaQueryData.fromWindow(ui.window); 23 | /// return mediaQuery.size.height; 24 | } 25 | 26 | ///获取appbar的高度 27 | static double getBarHeight() { 28 | MediaQueryData mediaQuery = MediaQueryData.fromWindow(window); 29 | return mediaQuery.padding.top + kToolbarHeight; 30 | } 31 | 32 | ///状态栏高度 33 | static double getStatusHeight() { 34 | MediaQueryData mediaQuery = MediaQueryData.fromWindow(window); 35 | return mediaQuery.padding.top; 36 | } 37 | 38 | ///更新状态栏样式,字体颜色改变 39 | static updateStatusBarStyle(SystemUiOverlayStyle style) { 40 | ///不加定时可能出现整个statusbar颜色改变 41 | Timer(Duration(milliseconds: 678), () { 42 | SystemChrome.setSystemUIOverlayStyle(style); 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/wan/wan_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flustars/flustars.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:meimei/bean/wan_android.dart'; 8 | import 'package:meimei/http/http_api.dart'; 9 | import 'package:meimei/utils/route_util.dart'; 10 | import 'package:meimei/utils/screen_util.dart'; 11 | import 'package:pull_to_refresh/pull_to_refresh.dart'; 12 | 13 | class WanAndroidPage extends StatefulWidget { 14 | @override 15 | State createState() => WanAndState(); 16 | } 17 | 18 | class WanAndState extends State 19 | with AutomaticKeepAliveClientMixin { 20 | bool _isLoading = true; //加载中... 21 | RefreshController _mRefreshController; 22 | ScrollController controller = ScrollController(); 23 | bool isShowFloatButton = false; 24 | int _currPage = 1; 25 | 26 | ///条目 27 | List _wanAList = []; 28 | 29 | @override 30 | void initState() { 31 | super.initState(); 32 | 33 | ///默认不显示回首页按钮 34 | _mRefreshController = RefreshController(); 35 | controller.addListener(() { 36 | var offset = controller.offset; 37 | var wHeight = YScreenUtil.getWinHeight(); 38 | // print('滑动位置 $offset '); 39 | // \n 屏幕高度 $wHeight'); 40 | ///查看log,发现这个位置相对比较合适 41 | if (offset < wHeight / 3 && isShowFloatButton) { 42 | setState(() { 43 | isShowFloatButton = false; 44 | }); 45 | } else if (offset > wHeight / 3 && !isShowFloatButton) { 46 | setState(() { 47 | isShowFloatButton = true; 48 | }); 49 | } 50 | }); 51 | 52 | initData(); 53 | } 54 | 55 | void initData() async { 56 | var data = await HttpApi.wanAndroidList(); 57 | List wanList = formatData(data); 58 | 59 | /// mounted 为 true 表示当前页面挂在到构件树中,为 false 时未挂载当前页面 60 | if (!mounted) { 61 | return; 62 | } 63 | if (_isLoading) { 64 | setState(() { 65 | _isLoading = false; 66 | _wanAList.addAll(wanList); 67 | }); 68 | } 69 | } 70 | 71 | ///下拉刷新 72 | void toRefresh() async { 73 | _currPage = 1; 74 | var data = await HttpApi.wanAndroidList(page: _currPage); 75 | List wanList = formatData(data); 76 | 77 | await Future.delayed(Duration(milliseconds: 1000)); 78 | _mRefreshController.refreshCompleted(); 79 | setState(() { 80 | _wanAList = wanList; 81 | }); 82 | } 83 | 84 | ///上拉加载更多 85 | void getMore() async { 86 | _currPage++; 87 | var data = await HttpApi.wanAndroidList(page: _currPage); 88 | List wanList = formatData(data); 89 | await Future.delayed(Duration(milliseconds: 1000)); 90 | _mRefreshController.loadComplete(); 91 | setState(() { 92 | _wanAList.addAll(wanList); 93 | }); 94 | } 95 | 96 | List formatData(var data) { 97 | return data['data']['datas'] 98 | .map((bean) => WanAndroid.fromJson(bean)) 99 | .toList(); 100 | } 101 | 102 | @override 103 | Widget build(BuildContext context) { 104 | return Stack( 105 | children: [ 106 | Offstage( 107 | offstage: _isLoading, 108 | child: SmartRefresher( 109 | header: Platform.isAndroid 110 | ? MaterialClassicHeader( 111 | ///下拉状态的颜色 112 | color: Theme.of(context).primaryColor, 113 | ) 114 | : ClassicHeader(), 115 | onRefresh: toRefresh, 116 | onLoading: getMore, 117 | controller: _mRefreshController, 118 | enablePullUp: true, 119 | child: listviewBuild(), 120 | ), 121 | ), 122 | yFloatingActionButton(), 123 | Offstage( 124 | offstage: !_isLoading, 125 | child: Center( 126 | child: CupertinoActivityIndicator(), 127 | ), 128 | ) 129 | ], 130 | ); 131 | } 132 | 133 | ///回到顶部按钮 134 | Widget yFloatingActionButton() { 135 | return Positioned( 136 | right: 20, 137 | bottom: 60, 138 | 139 | ///加个淡入淡出效果 140 | child: AnimatedOpacity( 141 | opacity: isShowFloatButton ? 1.0 : 0.0, 142 | duration: Duration(milliseconds: 300), 143 | child: FloatingActionButton( 144 | heroTag: 'wanandroid_up_first', 145 | onPressed: () { 146 | ///显示的时候才响应点击事件 147 | if (isShowFloatButton) { 148 | ///回到顶部 149 | controller.animateTo(0, 150 | duration: Duration(milliseconds: 300), 151 | curve: Curves.linear); 152 | } 153 | }, 154 | backgroundColor: Theme.of(context).primaryColor, 155 | child: Icon(Icons.keyboard_arrow_up), 156 | ))); 157 | } 158 | 159 | ///ListView 160 | ListView listviewBuild() { 161 | return ListView.builder( 162 | itemBuilder: (context, index) { 163 | return itemView(index); 164 | }, 165 | controller: controller, 166 | itemCount: _wanAList.length, 167 | ); 168 | } 169 | 170 | ///具体条目 171 | Widget itemView(int index) { 172 | // print('具体条目索引 $index'); 173 | return InkWell( 174 | onTap: () { 175 | ///跳转到webview 176 | RouteUtil.routeToWeb(context, _wanAList[index].url, 177 | title: _wanAList[index].title); 178 | }, 179 | child: Padding( 180 | padding: EdgeInsets.symmetric(horizontal: 10), 181 | child: Column( 182 | children: [ 183 | Container( 184 | color: Colors.white, 185 | height: 100, 186 | child: Row( 187 | crossAxisAlignment: CrossAxisAlignment.center, 188 | children: [ 189 | Expanded( 190 | child: Container( 191 | height: 80, 192 | child: Stack( 193 | children: [ 194 | Text( 195 | _wanAList[index].title, 196 | style: TextStyle( 197 | fontSize: 13, 198 | color: Colors.black87, 199 | fontWeight: FontWeight.w600), 200 | softWrap: true, 201 | maxLines: 2, 202 | overflow: TextOverflow.ellipsis, 203 | ), 204 | Positioned( 205 | bottom: 16, 206 | child: Text( 207 | 'author: ${_wanAList[index].author}', 208 | style: TextStyle( 209 | fontSize: 10, 210 | color: Colors.black54, 211 | fontWeight: FontWeight.w500), 212 | softWrap: true, 213 | ), 214 | ), 215 | 216 | ///日期 217 | Positioned( 218 | bottom: 0, 219 | child: Text( 220 | 'date: ${_wanAList[index].dateS}', 221 | style: TextStyle( 222 | fontSize: 10, 223 | color: Colors.black54, 224 | fontWeight: FontWeight.w500), 225 | softWrap: true, 226 | )), 227 | ], 228 | ), 229 | )), 230 | CachedNetworkImage( 231 | width: 90, 232 | height: 80, 233 | imageUrl: _wanAList[index].imgUrl, 234 | fit: BoxFit.cover, 235 | ) 236 | ], 237 | ), 238 | ), 239 | 240 | ///添加分割线 241 | Divider( 242 | color: Colors.grey, 243 | height: 0.5, 244 | ) 245 | ], 246 | )), 247 | ); 248 | } 249 | 250 | @override 251 | bool get wantKeepAlive => true; 252 | } 253 | -------------------------------------------------------------------------------- /lib/widget/img_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:meimei/utils/screen_util.dart'; 6 | import 'package:photo_view/photo_view.dart'; 7 | import 'package:photo_view/photo_view_gallery.dart'; 8 | 9 | ///图片浏览页面 10 | class ImgPage extends StatefulWidget { 11 | final List urlList; 12 | final List titleList; 13 | final int index; 14 | 15 | ImgPage(this.urlList, this.titleList, {this.index: 0}); 16 | 17 | @override 18 | State createState() => ImgPageState(); 19 | } 20 | 21 | class ImgPageState extends State { 22 | int _currIndex = 0; 23 | 24 | @override 25 | void initState() { 26 | super.initState(); 27 | _currIndex = widget.index; 28 | YScreenUtil.updateStatusBarStyle(SystemUiOverlayStyle.light); 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return Scaffold( 34 | appBar: AppBar( 35 | centerTitle: true, 36 | title: Text( 37 | widget.titleList[_currIndex], 38 | overflow: TextOverflow.ellipsis, 39 | maxLines: 1, 40 | style: TextStyle( 41 | fontWeight: FontWeight.bold, 42 | fontSize: 18, 43 | color: Colors.white, 44 | ), 45 | ), 46 | ), 47 | body: Container( 48 | child: PhotoViewGallery.builder( 49 | scrollPhysics: const BouncingScrollPhysics(), 50 | builder: (BuildContext context, int index) { 51 | // print('图片索引 $index'); 52 | // print('_currIndex图片索引 $_currIndex'); 53 | return PhotoViewGalleryPageOptions( 54 | imageProvider: CachedNetworkImageProvider(widget.urlList[index]), 55 | heroTag: widget.urlList[index], 56 | 57 | ///默认大小 58 | initialScale: PhotoViewComputedScale.contained * 0.98, 59 | 60 | ///最小界限 61 | minScale: PhotoViewComputedScale.contained * 0.15, 62 | ); 63 | }, 64 | itemCount: widget.urlList.length, 65 | loadingChild: CupertinoActivityIndicator(), 66 | backgroundDecoration: BoxDecoration(color: Colors.white), 67 | 68 | ///首次进入设置对应图片 69 | pageController: PageController(initialPage: _currIndex), 70 | onPageChanged: (index) { 71 | setState(() { 72 | _currIndex = index; 73 | }); 74 | }, 75 | ), 76 | ), 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /lib/widget/web_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; 3 | 4 | class YWebView extends StatelessWidget { 5 | final String url; 6 | final String title; 7 | 8 | YWebView(this.url, {this.title}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | child: WebviewScaffold( 14 | url: url, 15 | withJavascript: true, 16 | headers: {'Content-Security-Policy': 'upgrade-insecure-requests'}, 17 | withLocalStorage: true, 18 | scrollBar: false, 19 | appCacheEnabled: true, 20 | appBar: AppBar( 21 | centerTitle: true, 22 | title: Text( 23 | title, 24 | style: TextStyle( 25 | fontSize: 16, 26 | color: Colors.white, 27 | fontWeight: FontWeight.bold), 28 | maxLines: 1, 29 | overflow: TextOverflow.ellipsis, 30 | ), 31 | )), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/widget/ybanner.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:carousel_slider/carousel_slider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:meimei/utils/screen_util.dart'; 5 | 6 | ///封装的banner /图片,标题,指示器,点击回调 7 | class YBanner extends StatefulWidget { 8 | final List imgList; //图片列表 9 | final List titleList; //标题,可能有 10 | ///点击事件 11 | final Function(int index) onClickIndex; 12 | 13 | YBanner(this.imgList, {this.titleList, this.onClickIndex}); 14 | 15 | @override 16 | State createState() => YBannerState(); 17 | } 18 | 19 | class YBannerState extends State with AutomaticKeepAliveClientMixin { 20 | int _bannerIndex = 0; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | super.build(context); 25 | ///这里加上判断,否则会有异常log,但是页面不会显示错误 26 | if (widget.imgList.length == 0) { 27 | return SizedBox(); 28 | } else { 29 | return bannerView(); 30 | } 31 | } 32 | 33 | Widget bannerView() { 34 | return GestureDetector( 35 | onTap: () { 36 | if (null != widget.onClickIndex) { 37 | widget.onClickIndex(_bannerIndex); 38 | } 39 | }, 40 | child: Stack( 41 | children: [ 42 | carouselView(), 43 | bannerPoint(), 44 | ], 45 | ), 46 | ); 47 | } 48 | 49 | ///banner除指示器外的内容 50 | Widget carouselView() { 51 | return CarouselSlider( 52 | height: 130, 53 | aspectRatio: 2.0, 54 | viewportFraction: 1.0, 55 | //一屏显示一个 56 | autoPlay: true, 57 | enlargeCenterPage: false, 58 | pauseAutoPlayOnTouch: Duration(milliseconds: 400), 59 | onPageChanged: (index) { 60 | setState(() { 61 | _bannerIndex = index; 62 | }); 63 | }, 64 | items: widget.imgList 65 | .map( 66 | (url) => Stack( 67 | children: [ 68 | CachedNetworkImage( 69 | width: YScreenUtil.getWinWidth(), 70 | imageUrl: url, 71 | fit: BoxFit.cover, 72 | ), 73 | 74 | ///标题 75 | titleView() 76 | ], 77 | ), 78 | ) 79 | .toList()); 80 | } 81 | 82 | ///banner指示器 83 | Widget bannerPoint() { 84 | return Positioned( 85 | right: 30, 86 | bottom: 5, 87 | child: Row( 88 | mainAxisAlignment: MainAxisAlignment.center, 89 | children: ymap( 90 | widget.imgList, 91 | (index, url) { 92 | if (_bannerIndex == index) { 93 | return Container( 94 | width: 10.0, 95 | height: 4.0, 96 | margin: EdgeInsets.symmetric(vertical: 5.0, horizontal: 2.0), 97 | decoration: BoxDecoration( 98 | borderRadius: BorderRadius.circular(3.0), 99 | color: Colors.white), 100 | ); 101 | } else { 102 | return Container( 103 | width: 4.0, 104 | height: 4.0, 105 | margin: EdgeInsets.symmetric(vertical: 5.0, horizontal: 2.0), 106 | decoration: 107 | BoxDecoration(shape: BoxShape.circle, color: Colors.grey), 108 | ); 109 | } 110 | }, 111 | ), 112 | )); 113 | } 114 | 115 | ///标题 116 | Widget titleView() { 117 | if (null == widget.titleList || 118 | (null != widget.titleList && widget.titleList.length < 1)) { 119 | return SizedBox(); 120 | } else { 121 | return Positioned( 122 | bottom: 18, 123 | right: 10, 124 | left: 16, 125 | child: Text( 126 | widget.titleList[_bannerIndex], 127 | style: TextStyle( 128 | fontSize: 18, color: Colors.white, fontWeight: FontWeight.w600), 129 | softWrap: true, 130 | )); 131 | } 132 | } 133 | 134 | List ymap(List list, Function handler) { 135 | List result = []; 136 | for (var i = 0; i < list.length; i++) { 137 | result.add(handler(i, list[i])); 138 | } 139 | return result; 140 | } 141 | 142 | @override 143 | bool get wantKeepAlive => true; 144 | } 145 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | after_layout: 5 | dependency: transitive 6 | description: 7 | name: after_layout 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "1.0.7+2" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.2.0" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.0.4" 25 | cached_network_image: 26 | dependency: "direct main" 27 | description: 28 | name: cached_network_image 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.1.1" 32 | carousel_slider: 33 | dependency: "direct main" 34 | description: 35 | name: carousel_slider 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.3.0" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.1.2" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.14.11" 53 | common_utils: 54 | dependency: transitive 55 | description: 56 | name: common_utils 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "1.1.3" 60 | connectivity: 61 | dependency: "direct main" 62 | description: 63 | name: connectivity 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "0.4.3+6" 67 | convert: 68 | dependency: transitive 69 | description: 70 | name: convert 71 | url: "https://pub.flutter-io.cn" 72 | source: hosted 73 | version: "2.1.1" 74 | cookie_jar: 75 | dependency: transitive 76 | description: 77 | name: cookie_jar 78 | url: "https://pub.flutter-io.cn" 79 | source: hosted 80 | version: "1.0.1" 81 | crypto: 82 | dependency: transitive 83 | description: 84 | name: crypto 85 | url: "https://pub.flutter-io.cn" 86 | source: hosted 87 | version: "2.0.6" 88 | cupertino_icons: 89 | dependency: "direct main" 90 | description: 91 | name: cupertino_icons 92 | url: "https://pub.flutter-io.cn" 93 | source: hosted 94 | version: "0.1.2" 95 | decimal: 96 | dependency: transitive 97 | description: 98 | name: decimal 99 | url: "https://pub.flutter-io.cn" 100 | source: hosted 101 | version: "0.3.4" 102 | dio: 103 | dependency: "direct main" 104 | description: 105 | name: dio 106 | url: "https://pub.flutter-io.cn" 107 | source: hosted 108 | version: "2.1.13" 109 | flustars: 110 | dependency: "direct main" 111 | description: 112 | name: flustars 113 | url: "https://pub.flutter-io.cn" 114 | source: hosted 115 | version: "0.2.6+1" 116 | flutter: 117 | dependency: "direct main" 118 | description: flutter 119 | source: sdk 120 | version: "0.0.0" 121 | flutter_cache_manager: 122 | dependency: transitive 123 | description: 124 | name: flutter_cache_manager 125 | url: "https://pub.flutter-io.cn" 126 | source: hosted 127 | version: "1.1.1" 128 | flutter_staggered_grid_view: 129 | dependency: "direct main" 130 | description: 131 | name: flutter_staggered_grid_view 132 | url: "https://pub.flutter-io.cn" 133 | source: hosted 134 | version: "0.3.0" 135 | flutter_sticky_header: 136 | dependency: "direct main" 137 | description: 138 | name: flutter_sticky_header 139 | url: "https://pub.flutter-io.cn" 140 | source: hosted 141 | version: "0.4.0" 142 | flutter_test: 143 | dependency: "direct dev" 144 | description: flutter 145 | source: sdk 146 | version: "0.0.0" 147 | flutter_webview_plugin: 148 | dependency: "direct main" 149 | description: 150 | name: flutter_webview_plugin 151 | url: "https://pub.flutter-io.cn" 152 | source: hosted 153 | version: "0.3.5" 154 | http: 155 | dependency: transitive 156 | description: 157 | name: http 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "0.12.0+2" 161 | http_parser: 162 | dependency: transitive 163 | description: 164 | name: http_parser 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "3.1.3" 168 | matcher: 169 | dependency: transitive 170 | description: 171 | name: matcher 172 | url: "https://pub.flutter-io.cn" 173 | source: hosted 174 | version: "0.12.5" 175 | meta: 176 | dependency: transitive 177 | description: 178 | name: meta 179 | url: "https://pub.flutter-io.cn" 180 | source: hosted 181 | version: "1.1.6" 182 | path: 183 | dependency: transitive 184 | description: 185 | name: path 186 | url: "https://pub.flutter-io.cn" 187 | source: hosted 188 | version: "1.6.2" 189 | path_provider: 190 | dependency: transitive 191 | description: 192 | name: path_provider 193 | url: "https://pub.flutter-io.cn" 194 | source: hosted 195 | version: "1.2.0" 196 | pedantic: 197 | dependency: transitive 198 | description: 199 | name: pedantic 200 | url: "https://pub.flutter-io.cn" 201 | source: hosted 202 | version: "1.7.0" 203 | photo_view: 204 | dependency: "direct main" 205 | description: 206 | name: photo_view 207 | url: "https://pub.flutter-io.cn" 208 | source: hosted 209 | version: "0.4.2" 210 | pull_to_refresh: 211 | dependency: "direct main" 212 | description: 213 | name: pull_to_refresh 214 | url: "https://pub.flutter-io.cn" 215 | source: hosted 216 | version: "1.5.3" 217 | quiver: 218 | dependency: transitive 219 | description: 220 | name: quiver 221 | url: "https://pub.flutter-io.cn" 222 | source: hosted 223 | version: "2.0.3" 224 | rational: 225 | dependency: transitive 226 | description: 227 | name: rational 228 | url: "https://pub.flutter-io.cn" 229 | source: hosted 230 | version: "0.3.5" 231 | shared_preferences: 232 | dependency: transitive 233 | description: 234 | name: shared_preferences 235 | url: "https://pub.flutter-io.cn" 236 | source: hosted 237 | version: "0.5.3+4" 238 | sky_engine: 239 | dependency: transitive 240 | description: flutter 241 | source: sdk 242 | version: "0.0.99" 243 | source_span: 244 | dependency: transitive 245 | description: 246 | name: source_span 247 | url: "https://pub.flutter-io.cn" 248 | source: hosted 249 | version: "1.5.5" 250 | sqflite: 251 | dependency: transitive 252 | description: 253 | name: sqflite 254 | url: "https://pub.flutter-io.cn" 255 | source: hosted 256 | version: "1.1.6+3" 257 | stack_trace: 258 | dependency: transitive 259 | description: 260 | name: stack_trace 261 | url: "https://pub.flutter-io.cn" 262 | source: hosted 263 | version: "1.9.3" 264 | stream_channel: 265 | dependency: transitive 266 | description: 267 | name: stream_channel 268 | url: "https://pub.flutter-io.cn" 269 | source: hosted 270 | version: "2.0.0" 271 | string_scanner: 272 | dependency: transitive 273 | description: 274 | name: string_scanner 275 | url: "https://pub.flutter-io.cn" 276 | source: hosted 277 | version: "1.0.4" 278 | synchronized: 279 | dependency: transitive 280 | description: 281 | name: synchronized 282 | url: "https://pub.flutter-io.cn" 283 | source: hosted 284 | version: "2.1.0+1" 285 | term_glyph: 286 | dependency: transitive 287 | description: 288 | name: term_glyph 289 | url: "https://pub.flutter-io.cn" 290 | source: hosted 291 | version: "1.1.0" 292 | test_api: 293 | dependency: transitive 294 | description: 295 | name: test_api 296 | url: "https://pub.flutter-io.cn" 297 | source: hosted 298 | version: "0.2.5" 299 | typed_data: 300 | dependency: transitive 301 | description: 302 | name: typed_data 303 | url: "https://pub.flutter-io.cn" 304 | source: hosted 305 | version: "1.1.6" 306 | uuid: 307 | dependency: transitive 308 | description: 309 | name: uuid 310 | url: "https://pub.flutter-io.cn" 311 | source: hosted 312 | version: "2.0.2" 313 | vector_math: 314 | dependency: transitive 315 | description: 316 | name: vector_math 317 | url: "https://pub.flutter-io.cn" 318 | source: hosted 319 | version: "2.0.8" 320 | sdks: 321 | dart: ">=2.2.2 <3.0.0" 322 | flutter: ">=1.6.0 <2.0.0" 323 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: meimei 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+2 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 | #刷新 27 | pull_to_refresh: 1.5.3 28 | #加载图片 29 | cached_network_image: 1.1.1 30 | #网络请求 31 | dio: 2.1.13 32 | #WebView相关 33 | flutter_webview_plugin: 0.3.5 34 | # webview_flutter: 0.3.11+2 35 | #网络是否连接 36 | connectivity: 0.4.3+6 37 | #查看图片的库 38 | photo_view: 0.4.2 39 | #首页图片浏览 40 | flutter_staggered_grid_view: 0.3.0 41 | #可作为banner 42 | carousel_slider: 1.3.0 43 | #知乎日报滚动头 44 | flutter_sticky_header: 0.4.0 45 | #工具库 46 | flustars: 0.2.6+1 47 | 48 | dev_dependencies: 49 | flutter_test: 50 | sdk: flutter 51 | 52 | 53 | # For information on the generic Dart part of this file, see the 54 | # following page: https://dart.dev/tools/pub/pubspec 55 | 56 | # The following section is specific to Flutter. 57 | flutter: 58 | 59 | # The following line ensures that the Material Icons font is 60 | # included with your application, so that you can use the icons in 61 | # the material Icons class. 62 | uses-material-design: true 63 | 64 | # To add assets to your application, add an assets section, like this: 65 | # assets: 66 | # - images/a_dot_burr.jpeg 67 | # - images/a_dot_ham.jpeg 68 | 69 | # An image asset can refer to one or more resolution-specific "variants", see 70 | # https://flutter.dev/assets-and-images/#resolution-aware. 71 | 72 | # For details regarding adding assets from package dependencies, see 73 | # https://flutter.dev/assets-and-images/#from-packages 74 | 75 | # To add custom fonts to your application, add a fonts section here, 76 | # in this "flutter" section. Each entry in this list should have a 77 | # "family" key with the font family name, and a "fonts" key with a 78 | # list giving the asset and other descriptors for the font. For 79 | # example: 80 | # fonts: 81 | # - family: Schyler 82 | # fonts: 83 | # - asset: fonts/Schyler-Regular.ttf 84 | # - asset: fonts/Schyler-Italic.ttf 85 | # style: italic 86 | # - family: Trajan Pro 87 | # fonts: 88 | # - asset: fonts/TrajanPro.ttf 89 | # - asset: fonts/TrajanPro_Bold.ttf 90 | # weight: 700 91 | # 92 | # For details regarding fonts from package dependencies, 93 | # see https://flutter.dev/custom-fonts/#from-packages 94 | -------------------------------------------------------------------------------- /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:meimei/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 | --------------------------------------------------------------------------------