├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── fluttercuriosityapp
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ └── launch_background.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── detailAdd.png
├── feedComment.png
├── feedPraise.png
├── qdaily.png
├── toolbarShare.png
└── yellowDot.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
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── AppIcon29x29@2x.png
│ │ ├── AppIcon29x29@3x.png
│ │ ├── AppIcon40x40@2x.png
│ │ ├── AppIcon40x40@3x.png
│ │ ├── AppIcon60x60@2x.png
│ │ ├── AppIcon60x60@3x.png
│ │ └── Contents.json
│ └── 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
├── ColumnsDetail.dart
├── curiosityWebView.dart
├── main.dart
├── model
│ ├── model.dart
│ └── model.g.dart
├── news.dart
├── tool
│ ├── CommonUtils.dart
│ └── WidgetUtils.dart
└── widget
│ ├── ActivityWidget.dart
│ ├── BaseModuleWidget.dart
│ ├── ColumnsDetailSubWidget.dart
│ ├── ColumnsListWidget.dart
│ ├── ListImageRight.dart
│ ├── ListImageTop.dart
│ ├── NewsListWidget.dart
│ └── SwiperWidget.dart
└── pubspec.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/.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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
8 | channel: beta
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 欢迎Star
2 |
3 | > 基于Flutter开发,适配Android与iOS。
4 | 项目同时适合Flutter的练手学习,覆盖了基本框架的使用,与原生的交互等。
5 | #### 注意事项
6 | > 1.下载项目后报错是因为没有添加依赖,在pubspec.yaml文件中点击Packages get下载依赖,有时候会在这里出现卡死的情况,可以配置一下环境变量.在终端执行`vi ~/.bash_profile `,再添加`export PUB_HOSTED_URL=https://pub.flutter-io.cn`和
7 | `export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn`.详情请看[修改Flutter环境变量](https://flutter.io/community/china).
8 |
9 | >2.需要将File Encodings里的`Project Encoding设置为UTF-8`,否则有时候安卓会报错
10 |
11 | > 3.如果cocoapods不是最新可能会出现`Error Running Pod Install`,请更新cocoapods.
12 |
13 | > 4.由于[flutter_webview_plugin](https://pub.dartlang.org/packages/flutter_webview_plugin)这个插件只支持加载url,于是就需要做一些修改.
14 | >* iOS 在`FlutterWebviewPlugin.m`文件中的`- (void)navigate:(FlutterMethodCall*)call`方法中的最后一排,将`[self.webview loadRequest:request]`方法改为`[self.webview loadHTMLString:url baseURL:nil]`
15 | >* Android 在`WebViewManager.java`文件中`webView.loadUrl(url)`方法改为`webView.loadData(url, "text/html; charset=UTF-8", null);`,以及下面那排的`void reloadUrl(String url) { webView.loadUrl(url); }`改为`void reloadUrl(String url) { webView.loadData(url, "text/html; charset=UTF-8", null); }`
16 | # 相关文章
17 | # [Flutter实战详解--高仿好奇心日报](https://juejin.im/post/5c31f7236fb9a04a04412d0b)
18 | #### 示例图片
19 |
20 | 
21 | 
22 |
23 | 
24 | 
25 | 
26 | 
27 | 
28 | 
29 | 
30 |
31 |
--------------------------------------------------------------------------------
/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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 27
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.example.fluttercuriosityapp"
37 | minSdkVersion 16
38 | targetSdkVersion 27
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | testImplementation 'junit:junit:4.12'
59 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61 | }
62 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/fluttercuriosityapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.fluttercuriosityapp;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.2.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | gradle.projectsEvaluated {
14 | tasks.withType(JavaCompile) {
15 | options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
16 | }
17 | }
18 | repositories {
19 | google()
20 | jcenter()
21 | }
22 | }
23 |
24 | rootProject.buildDir = '../build'
25 | subprojects {
26 | project.buildDir = "${rootProject.buildDir}/${project.name}"
27 | }
28 | subprojects {
29 | project.evaluationDependsOn(':app')
30 | }
31 |
32 | task clean(type: Delete) {
33 | delete rootProject.buildDir
34 | }
35 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/assets/detailAdd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/assets/detailAdd.png
--------------------------------------------------------------------------------
/assets/feedComment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/assets/feedComment.png
--------------------------------------------------------------------------------
/assets/feedPraise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/assets/feedPraise.png
--------------------------------------------------------------------------------
/assets/qdaily.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/assets/qdaily.png
--------------------------------------------------------------------------------
/assets/toolbarShare.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/assets/toolbarShare.png
--------------------------------------------------------------------------------
/assets/yellowDot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/assets/yellowDot.png
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/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 packages get is executed first."
45 | end
46 | generated_xcode_build_settings.map { |p|
47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48 | symlink = File.join('.symlinks', 'flutter')
49 | File.symlink(File.dirname(p[:path]), symlink)
50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51 | end
52 | }
53 |
54 | # Plugin Pods
55 | plugin_pods = parse_KV_file('../.flutter-plugins')
56 | plugin_pods.map { |p|
57 | symlink = File.join('.symlinks', 'plugins', p[:name])
58 | File.symlink(p[:path], symlink)
59 | pod p[:name], :path => File.join(symlink, 'ios')
60 | }
61 | end
62 |
63 | post_install do |installer|
64 | installer.pods_project.targets.each do |target|
65 | target.build_configurations.each do |config|
66 | config.build_settings['ENABLE_BITCODE'] = 'NO'
67 | end
68 | end
69 | end
70 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
23 | F54E40FE805EB4826F773847 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CBC42D6B17E76DA8D813F587 /* libPods-Runner.a */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXCopyFilesBuildPhase section */
27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
28 | isa = PBXCopyFilesBuildPhase;
29 | buildActionMask = 2147483647;
30 | dstPath = "";
31 | dstSubfolderSpec = 10;
32 | files = (
33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
35 | );
36 | name = "Embed Frameworks";
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXCopyFilesBuildPhase section */
40 |
41 | /* Begin PBXFileReference section */
42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
44 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
45 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
47 | 72DAF73E070739C715160A2F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
49 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
50 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
51 | 828FCDA608C8FE97A1E3C9BB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
52 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
53 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
54 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
55 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
56 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
57 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
58 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
59 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
60 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
61 | 9C90CE6A5B2767F49C58C760 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
62 | CBC42D6B17E76DA8D813F587 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
63 | /* End PBXFileReference section */
64 |
65 | /* Begin PBXFrameworksBuildPhase section */
66 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
67 | isa = PBXFrameworksBuildPhase;
68 | buildActionMask = 2147483647;
69 | files = (
70 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
71 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
72 | F54E40FE805EB4826F773847 /* libPods-Runner.a in Frameworks */,
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | /* End PBXFrameworksBuildPhase section */
77 |
78 | /* Begin PBXGroup section */
79 | 9740EEB11CF90186004384FC /* Flutter */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
83 | 3B80C3931E831B6300D905FE /* App.framework */,
84 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
85 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
86 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
87 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
88 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
89 | );
90 | name = Flutter;
91 | sourceTree = "";
92 | };
93 | 97C146E51CF9000F007C117D = {
94 | isa = PBXGroup;
95 | children = (
96 | 9740EEB11CF90186004384FC /* Flutter */,
97 | 97C146F01CF9000F007C117D /* Runner */,
98 | 97C146EF1CF9000F007C117D /* Products */,
99 | DCCADFD210BE9485E6BC5807 /* Pods */,
100 | A40031ED51422C0761C5DD58 /* Frameworks */,
101 | );
102 | sourceTree = "";
103 | };
104 | 97C146EF1CF9000F007C117D /* Products */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 97C146EE1CF9000F007C117D /* Runner.app */,
108 | );
109 | name = Products;
110 | sourceTree = "";
111 | };
112 | 97C146F01CF9000F007C117D /* Runner */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
116 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
117 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
118 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
119 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
120 | 97C147021CF9000F007C117D /* Info.plist */,
121 | 97C146F11CF9000F007C117D /* Supporting Files */,
122 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
123 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
124 | );
125 | path = Runner;
126 | sourceTree = "";
127 | };
128 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
129 | isa = PBXGroup;
130 | children = (
131 | 97C146F21CF9000F007C117D /* main.m */,
132 | );
133 | name = "Supporting Files";
134 | sourceTree = "";
135 | };
136 | A40031ED51422C0761C5DD58 /* Frameworks */ = {
137 | isa = PBXGroup;
138 | children = (
139 | CBC42D6B17E76DA8D813F587 /* libPods-Runner.a */,
140 | );
141 | name = Frameworks;
142 | sourceTree = "";
143 | };
144 | DCCADFD210BE9485E6BC5807 /* Pods */ = {
145 | isa = PBXGroup;
146 | children = (
147 | 9C90CE6A5B2767F49C58C760 /* Pods-Runner.debug.xcconfig */,
148 | 72DAF73E070739C715160A2F /* Pods-Runner.release.xcconfig */,
149 | 828FCDA608C8FE97A1E3C9BB /* Pods-Runner.profile.xcconfig */,
150 | );
151 | path = Pods;
152 | sourceTree = "";
153 | };
154 | /* End PBXGroup section */
155 |
156 | /* Begin PBXNativeTarget section */
157 | 97C146ED1CF9000F007C117D /* Runner */ = {
158 | isa = PBXNativeTarget;
159 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
160 | buildPhases = (
161 | 3D665C4DFB4CD6EE4CD4D6AC /* [CP] Check Pods Manifest.lock */,
162 | 9740EEB61CF901F6004384FC /* Run Script */,
163 | 97C146EA1CF9000F007C117D /* Sources */,
164 | 97C146EB1CF9000F007C117D /* Frameworks */,
165 | 97C146EC1CF9000F007C117D /* Resources */,
166 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
167 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
168 | 23D5E0158B48BA4BF70BF73E /* [CP] Embed Pods Frameworks */,
169 | );
170 | buildRules = (
171 | );
172 | dependencies = (
173 | );
174 | name = Runner;
175 | productName = Runner;
176 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
177 | productType = "com.apple.product-type.application";
178 | };
179 | /* End PBXNativeTarget section */
180 |
181 | /* Begin PBXProject section */
182 | 97C146E61CF9000F007C117D /* Project object */ = {
183 | isa = PBXProject;
184 | attributes = {
185 | LastUpgradeCheck = 0910;
186 | ORGANIZATIONNAME = "The Chromium Authors";
187 | TargetAttributes = {
188 | 97C146ED1CF9000F007C117D = {
189 | CreatedOnToolsVersion = 7.3.1;
190 | };
191 | };
192 | };
193 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
194 | compatibilityVersion = "Xcode 3.2";
195 | developmentRegion = English;
196 | hasScannedForEncodings = 0;
197 | knownRegions = (
198 | en,
199 | Base,
200 | );
201 | mainGroup = 97C146E51CF9000F007C117D;
202 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
203 | projectDirPath = "";
204 | projectRoot = "";
205 | targets = (
206 | 97C146ED1CF9000F007C117D /* Runner */,
207 | );
208 | };
209 | /* End PBXProject section */
210 |
211 | /* Begin PBXResourcesBuildPhase section */
212 | 97C146EC1CF9000F007C117D /* Resources */ = {
213 | isa = PBXResourcesBuildPhase;
214 | buildActionMask = 2147483647;
215 | files = (
216 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
217 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
218 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
219 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
220 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
221 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
222 | );
223 | runOnlyForDeploymentPostprocessing = 0;
224 | };
225 | /* End PBXResourcesBuildPhase section */
226 |
227 | /* Begin PBXShellScriptBuildPhase section */
228 | 23D5E0158B48BA4BF70BF73E /* [CP] Embed Pods Frameworks */ = {
229 | isa = PBXShellScriptBuildPhase;
230 | buildActionMask = 2147483647;
231 | files = (
232 | );
233 | inputFileListPaths = (
234 | );
235 | inputPaths = (
236 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
237 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
238 | );
239 | name = "[CP] Embed Pods Frameworks";
240 | outputFileListPaths = (
241 | );
242 | outputPaths = (
243 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
244 | );
245 | runOnlyForDeploymentPostprocessing = 0;
246 | shellPath = /bin/sh;
247 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
248 | showEnvVarsInLog = 0;
249 | };
250 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
251 | isa = PBXShellScriptBuildPhase;
252 | buildActionMask = 2147483647;
253 | files = (
254 | );
255 | inputPaths = (
256 | );
257 | name = "Thin Binary";
258 | outputPaths = (
259 | );
260 | runOnlyForDeploymentPostprocessing = 0;
261 | shellPath = /bin/sh;
262 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
263 | };
264 | 3D665C4DFB4CD6EE4CD4D6AC /* [CP] Check Pods Manifest.lock */ = {
265 | isa = PBXShellScriptBuildPhase;
266 | buildActionMask = 2147483647;
267 | files = (
268 | );
269 | inputFileListPaths = (
270 | );
271 | inputPaths = (
272 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
273 | "${PODS_ROOT}/Manifest.lock",
274 | );
275 | name = "[CP] Check Pods Manifest.lock";
276 | outputFileListPaths = (
277 | );
278 | outputPaths = (
279 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | shellPath = /bin/sh;
283 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
284 | showEnvVarsInLog = 0;
285 | };
286 | 9740EEB61CF901F6004384FC /* Run Script */ = {
287 | isa = PBXShellScriptBuildPhase;
288 | buildActionMask = 2147483647;
289 | files = (
290 | );
291 | inputPaths = (
292 | );
293 | name = "Run Script";
294 | outputPaths = (
295 | );
296 | runOnlyForDeploymentPostprocessing = 0;
297 | shellPath = /bin/sh;
298 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
299 | };
300 | /* End PBXShellScriptBuildPhase section */
301 |
302 | /* Begin PBXSourcesBuildPhase section */
303 | 97C146EA1CF9000F007C117D /* Sources */ = {
304 | isa = PBXSourcesBuildPhase;
305 | buildActionMask = 2147483647;
306 | files = (
307 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
308 | 97C146F31CF9000F007C117D /* main.m in Sources */,
309 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
310 | );
311 | runOnlyForDeploymentPostprocessing = 0;
312 | };
313 | /* End PBXSourcesBuildPhase section */
314 |
315 | /* Begin PBXVariantGroup section */
316 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
317 | isa = PBXVariantGroup;
318 | children = (
319 | 97C146FB1CF9000F007C117D /* Base */,
320 | );
321 | name = Main.storyboard;
322 | sourceTree = "";
323 | };
324 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
325 | isa = PBXVariantGroup;
326 | children = (
327 | 97C147001CF9000F007C117D /* Base */,
328 | );
329 | name = LaunchScreen.storyboard;
330 | sourceTree = "";
331 | };
332 | /* End PBXVariantGroup section */
333 |
334 | /* Begin XCBuildConfiguration section */
335 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
336 | isa = XCBuildConfiguration;
337 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
338 | buildSettings = {
339 | ALWAYS_SEARCH_USER_PATHS = NO;
340 | CLANG_ANALYZER_NONNULL = YES;
341 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
342 | CLANG_CXX_LIBRARY = "libc++";
343 | CLANG_ENABLE_MODULES = YES;
344 | CLANG_ENABLE_OBJC_ARC = YES;
345 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
346 | CLANG_WARN_BOOL_CONVERSION = YES;
347 | CLANG_WARN_COMMA = YES;
348 | CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES;
356 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
357 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
358 | CLANG_WARN_STRICT_PROTOTYPES = YES;
359 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
360 | CLANG_WARN_UNREACHABLE_CODE = YES;
361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
363 | COPY_PHASE_STRIP = NO;
364 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
365 | ENABLE_NS_ASSERTIONS = NO;
366 | ENABLE_STRICT_OBJC_MSGSEND = YES;
367 | GCC_C_LANGUAGE_STANDARD = gnu99;
368 | GCC_NO_COMMON_BLOCKS = YES;
369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
370 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
371 | GCC_WARN_UNDECLARED_SELECTOR = YES;
372 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
373 | GCC_WARN_UNUSED_FUNCTION = YES;
374 | GCC_WARN_UNUSED_VARIABLE = YES;
375 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
376 | MTL_ENABLE_DEBUG_INFO = NO;
377 | SDKROOT = iphoneos;
378 | TARGETED_DEVICE_FAMILY = "1,2";
379 | VALIDATE_PRODUCT = YES;
380 | };
381 | name = Profile;
382 | };
383 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
384 | isa = XCBuildConfiguration;
385 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
386 | buildSettings = {
387 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
388 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
389 | DEVELOPMENT_TEAM = S8QB4VV633;
390 | ENABLE_BITCODE = NO;
391 | FRAMEWORK_SEARCH_PATHS = (
392 | "$(inherited)",
393 | "$(PROJECT_DIR)/Flutter",
394 | );
395 | INFOPLIST_FILE = Runner/Info.plist;
396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
397 | LIBRARY_SEARCH_PATHS = (
398 | "$(inherited)",
399 | "$(PROJECT_DIR)/Flutter",
400 | );
401 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterCuriosityApp;
402 | PRODUCT_NAME = "$(TARGET_NAME)";
403 | VERSIONING_SYSTEM = "apple-generic";
404 | };
405 | name = Profile;
406 | };
407 | 97C147031CF9000F007C117D /* Debug */ = {
408 | isa = XCBuildConfiguration;
409 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
410 | buildSettings = {
411 | ALWAYS_SEARCH_USER_PATHS = NO;
412 | CLANG_ANALYZER_NONNULL = YES;
413 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
414 | CLANG_CXX_LIBRARY = "libc++";
415 | CLANG_ENABLE_MODULES = YES;
416 | CLANG_ENABLE_OBJC_ARC = YES;
417 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
418 | CLANG_WARN_BOOL_CONVERSION = YES;
419 | CLANG_WARN_COMMA = YES;
420 | CLANG_WARN_CONSTANT_CONVERSION = YES;
421 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
422 | CLANG_WARN_EMPTY_BODY = YES;
423 | CLANG_WARN_ENUM_CONVERSION = YES;
424 | CLANG_WARN_INFINITE_RECURSION = YES;
425 | CLANG_WARN_INT_CONVERSION = YES;
426 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
427 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
428 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
429 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
430 | CLANG_WARN_STRICT_PROTOTYPES = YES;
431 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
432 | CLANG_WARN_UNREACHABLE_CODE = YES;
433 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
434 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
435 | COPY_PHASE_STRIP = NO;
436 | DEBUG_INFORMATION_FORMAT = dwarf;
437 | ENABLE_STRICT_OBJC_MSGSEND = YES;
438 | ENABLE_TESTABILITY = YES;
439 | GCC_C_LANGUAGE_STANDARD = gnu99;
440 | GCC_DYNAMIC_NO_PIC = NO;
441 | GCC_NO_COMMON_BLOCKS = YES;
442 | GCC_OPTIMIZATION_LEVEL = 0;
443 | GCC_PREPROCESSOR_DEFINITIONS = (
444 | "DEBUG=1",
445 | "$(inherited)",
446 | );
447 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
448 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
449 | GCC_WARN_UNDECLARED_SELECTOR = YES;
450 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
451 | GCC_WARN_UNUSED_FUNCTION = YES;
452 | GCC_WARN_UNUSED_VARIABLE = YES;
453 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
454 | MTL_ENABLE_DEBUG_INFO = YES;
455 | ONLY_ACTIVE_ARCH = YES;
456 | SDKROOT = iphoneos;
457 | TARGETED_DEVICE_FAMILY = "1,2";
458 | };
459 | name = Debug;
460 | };
461 | 97C147041CF9000F007C117D /* Release */ = {
462 | isa = XCBuildConfiguration;
463 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
464 | buildSettings = {
465 | ALWAYS_SEARCH_USER_PATHS = NO;
466 | CLANG_ANALYZER_NONNULL = YES;
467 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
468 | CLANG_CXX_LIBRARY = "libc++";
469 | CLANG_ENABLE_MODULES = YES;
470 | CLANG_ENABLE_OBJC_ARC = YES;
471 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
472 | CLANG_WARN_BOOL_CONVERSION = YES;
473 | CLANG_WARN_COMMA = YES;
474 | CLANG_WARN_CONSTANT_CONVERSION = YES;
475 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
476 | CLANG_WARN_EMPTY_BODY = YES;
477 | CLANG_WARN_ENUM_CONVERSION = YES;
478 | CLANG_WARN_INFINITE_RECURSION = YES;
479 | CLANG_WARN_INT_CONVERSION = YES;
480 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
481 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
482 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
483 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
484 | CLANG_WARN_STRICT_PROTOTYPES = YES;
485 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
486 | CLANG_WARN_UNREACHABLE_CODE = YES;
487 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
488 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
489 | COPY_PHASE_STRIP = NO;
490 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
491 | ENABLE_NS_ASSERTIONS = NO;
492 | ENABLE_STRICT_OBJC_MSGSEND = YES;
493 | GCC_C_LANGUAGE_STANDARD = gnu99;
494 | GCC_NO_COMMON_BLOCKS = YES;
495 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
496 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
497 | GCC_WARN_UNDECLARED_SELECTOR = YES;
498 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
499 | GCC_WARN_UNUSED_FUNCTION = YES;
500 | GCC_WARN_UNUSED_VARIABLE = YES;
501 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
502 | MTL_ENABLE_DEBUG_INFO = NO;
503 | SDKROOT = iphoneos;
504 | TARGETED_DEVICE_FAMILY = "1,2";
505 | VALIDATE_PRODUCT = YES;
506 | };
507 | name = Release;
508 | };
509 | 97C147061CF9000F007C117D /* Debug */ = {
510 | isa = XCBuildConfiguration;
511 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
512 | buildSettings = {
513 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
514 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
515 | ENABLE_BITCODE = NO;
516 | FRAMEWORK_SEARCH_PATHS = (
517 | "$(inherited)",
518 | "$(PROJECT_DIR)/Flutter",
519 | );
520 | INFOPLIST_FILE = Runner/Info.plist;
521 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
522 | LIBRARY_SEARCH_PATHS = (
523 | "$(inherited)",
524 | "$(PROJECT_DIR)/Flutter",
525 | );
526 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterCuriosityApp;
527 | PRODUCT_NAME = "$(TARGET_NAME)";
528 | VERSIONING_SYSTEM = "apple-generic";
529 | };
530 | name = Debug;
531 | };
532 | 97C147071CF9000F007C117D /* Release */ = {
533 | isa = XCBuildConfiguration;
534 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
535 | buildSettings = {
536 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
538 | ENABLE_BITCODE = NO;
539 | FRAMEWORK_SEARCH_PATHS = (
540 | "$(inherited)",
541 | "$(PROJECT_DIR)/Flutter",
542 | );
543 | INFOPLIST_FILE = Runner/Info.plist;
544 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
545 | LIBRARY_SEARCH_PATHS = (
546 | "$(inherited)",
547 | "$(PROJECT_DIR)/Flutter",
548 | );
549 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterCuriosityApp;
550 | PRODUCT_NAME = "$(TARGET_NAME)";
551 | VERSIONING_SYSTEM = "apple-generic";
552 | };
553 | name = Release;
554 | };
555 | /* End XCBuildConfiguration section */
556 |
557 | /* Begin XCConfigurationList section */
558 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
559 | isa = XCConfigurationList;
560 | buildConfigurations = (
561 | 97C147031CF9000F007C117D /* Debug */,
562 | 97C147041CF9000F007C117D /* Release */,
563 | 249021D3217E4FDB00AE95B9 /* Profile */,
564 | );
565 | defaultConfigurationIsVisible = 0;
566 | defaultConfigurationName = Release;
567 | };
568 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
569 | isa = XCConfigurationList;
570 | buildConfigurations = (
571 | 97C147061CF9000F007C117D /* Debug */,
572 | 97C147071CF9000F007C117D /* Release */,
573 | 249021D4217E4FDB00AE95B9 /* Profile */,
574 | );
575 | defaultConfigurationIsVisible = 0;
576 | defaultConfigurationName = Release;
577 | };
578 | /* End XCConfigurationList section */
579 | };
580 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
581 | }
582 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildSystemType
6 | Original
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "size" : "29x29",
15 | "idiom" : "iphone",
16 | "filename" : "AppIcon29x29@2x.png",
17 | "scale" : "2x"
18 | },
19 | {
20 | "size" : "29x29",
21 | "idiom" : "iphone",
22 | "filename" : "AppIcon29x29@3x.png",
23 | "scale" : "3x"
24 | },
25 | {
26 | "size" : "40x40",
27 | "idiom" : "iphone",
28 | "filename" : "AppIcon40x40@2x.png",
29 | "scale" : "2x"
30 | },
31 | {
32 | "size" : "40x40",
33 | "idiom" : "iphone",
34 | "filename" : "AppIcon40x40@3x.png",
35 | "scale" : "3x"
36 | },
37 | {
38 | "size" : "60x60",
39 | "idiom" : "iphone",
40 | "filename" : "AppIcon60x60@2x.png",
41 | "scale" : "2x"
42 | },
43 | {
44 | "size" : "60x60",
45 | "idiom" : "iphone",
46 | "filename" : "AppIcon60x60@3x.png",
47 | "scale" : "3x"
48 | }
49 | ],
50 | "info" : {
51 | "version" : 1,
52 | "author" : "xcode"
53 | }
54 | }
--------------------------------------------------------------------------------
/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/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xumaohuai/Flutter-CuriosityApp/4e3b3f29c65731236f8d4cedc45423327ed01e25/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | 好奇心日报
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_curiosity_app
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 |
32 | UILaunchStoryboardName
33 | LaunchScreen
34 | UIMainStoryboardFile
35 | Main
36 | UISupportedInterfaceOrientations
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UISupportedInterfaceOrientations~ipad
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationPortraitUpsideDown
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UIViewControllerBasedStatusBarAppearance
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/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/ColumnsDetail.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_curiosity_app/widget/ColumnsDetailSubWidget.dart';
3 | import 'package:dio/dio.dart';
4 | import 'package:flutter_curiosity_app/model/model.dart';
5 | import 'package:flutter_curiosity_app/widget/ColumnsListWidget.dart';
6 | import 'package:flutter_curiosity_app/widget/ListImageRight.dart';
7 |
8 | class ColumnsDetail extends StatefulWidget {
9 | int id;
10 | @override
11 | _ColumnsDetailState createState() => _ColumnsDetailState();
12 | ColumnsDetail({Key key,@required this.id}) : super(key: key);
13 | }
14 |
15 | class _ColumnsDetailState extends State {
16 | int id;
17 | int lastKey = 0;
18 | List feedList = [];
19 | MyResponse infoResponse;
20 | final ScrollController _scrollController = new ScrollController();
21 | @override
22 | void initState() {
23 | // TODO: implement initState
24 | super.initState();
25 | id = widget.id;
26 | getInfoData();
27 | getData();
28 | _scrollController.addListener(() {
29 | ///判断当前滑动位置是不是到达底部,触发加载更多回调
30 | if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
31 | getData();
32 | }
33 | });
34 | }
35 | ///http://app3.qdaily.com/app3/columns/index/29/0.json
36 | void getInfoData()async{
37 | Dio dio = new Dio();
38 | Response response = await dio.get("http://app3.qdaily.com/app3/columns/info/$id.json");
39 | Reslut reslut = Reslut.fromJson(response.data);
40 |
41 | setState(() {
42 | infoResponse = reslut.response;
43 | });
44 | }
45 | void getData()async{
46 | Dio dio = new Dio();
47 | Response response = await dio.get("http://app3.qdaily.com/app3/columns/index/$id/$lastKey.json");
48 | Reslut reslut = Reslut.fromJson(response.data);
49 | lastKey = reslut.response.lastKey;
50 | setState(() {
51 | print('${reslut.response.feeds.length}');
52 | feedList.addAll(reslut.response.feeds);
53 | });
54 | }
55 |
56 | @override
57 | Widget build(BuildContext context) {
58 | return Material(
59 | color: Colors.white,
60 | child: Container(
61 | child: ListView(
62 | controller: _scrollController,
63 | padding: EdgeInsets.all(0),
64 | children: [
65 | ImageTitleWidget(context, infoResponse),
66 | ColumnsDetailTile(context,feedList,infoResponse),
67 | ],
68 | ),
69 | ),
70 | );
71 | }
72 | }
73 |
74 | Widget ColumnsDetailTile(BuildContext context,List feedList,MyResponse infoResponse){
75 | if(feedList.length == 0 || infoResponse == null){
76 | return Container();
77 | }
78 | if(infoResponse.column.showType == 1){
79 | return ColumnsDetailTypeOne(context, feedList);
80 | }
81 | return ColumnsDetailTypeTwo(context, feedList);
82 | }
83 |
84 |
85 | Widget ColumnsDetailTypeOne(BuildContext context,List feesList){
86 | return ListView.separated(
87 | physics: NeverScrollableScrollPhysics(),
88 | itemCount: feesList.length,
89 | shrinkWrap: true,
90 | itemBuilder: (context,index){
91 | return ListImageRight(context, feesList[index]);
92 | },
93 | separatorBuilder: (context,idx){
94 | return Container(
95 | height: 5,
96 | color: Color.fromARGB(50,183, 187, 197),
97 | );
98 | },
99 | );
100 | }
101 |
102 |
103 | Widget ColumnsDetailTypeTwo(BuildContext context,List feesList){
104 | return GridView.count(
105 | physics: NeverScrollableScrollPhysics(),
106 | crossAxisCount: 2,
107 | shrinkWrap: true,
108 | mainAxisSpacing: 10.0,
109 | crossAxisSpacing: 15.0,
110 | childAspectRatio: 0.612,
111 | padding: new EdgeInsets.symmetric(horizontal: 20.0),
112 | children: feesList.map((Feed feed) {
113 | return ColumnsTypeTwoTile(context, feed);
114 | }).toList()
115 | );
116 | }
117 |
118 |
119 |
--------------------------------------------------------------------------------
/lib/curiosityWebView.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
3 |
4 | class CuriosityWebView extends StatefulWidget {
5 | @override
6 | String htmlBody;
7 | CuriosityWebView({Key key, @required this.htmlBody}) : super(key: key);
8 | _CuriosityWebViewState createState() => _CuriosityWebViewState();
9 | }
10 |
11 | class _CuriosityWebViewState extends State {
12 | String htmlBody = '';
13 | @override
14 | void initState() {
15 | super.initState();
16 | htmlBody = widget.htmlBody.replaceAll( '/assets/app3','http://app3.qdaily.com/assets/app3');
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: new AppBar(
23 | title: Text('网页详情'),
24 | ),
25 | body: Container(
26 | padding: EdgeInsets.all(0),
27 | child: WebviewScaffold(url: htmlBody),
28 | ),
29 | );
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'news.dart';
3 |
4 | class TabbedAppBarMain extends StatelessWidget {
5 | var titleList = ['NEWS','LABS'];
6 | @override
7 | Widget build(BuildContext context) {
8 | return new MaterialApp(
9 | theme: ThemeData(
10 | primaryColor: Colors.white,
11 | ),
12 | home: new DefaultTabController(
13 | length: titleList.length,
14 | child: new Scaffold(
15 | appBar: new AppBar(
16 | elevation: 0.0,//导航栏下面那根线
17 | title: new TabBar(
18 | isScrollable: false,//是否可滑动
19 | unselectedLabelColor: Colors.black26,//未选中按钮颜色
20 | labelColor: Colors.black,//选中按钮颜色
21 | labelStyle: TextStyle(fontSize: 18.0),//文字样式
22 | indicatorSize: TabBarIndicatorSize.label,//滑动的宽度是根据内容来适应,还是与整块那么大(label表示根据内容来适应)
23 | indicatorWeight: 4.0,//滑块高度
24 | indicatorColor: Colors.yellow,//滑动颜色
25 | indicatorPadding: EdgeInsets.only(bottom: 1.0),//与底部距离为1
26 | tabs: titleList.map((String text) {//tabs表示具体的内容,是一个数组
27 | return new Tab(
28 | text: text,
29 | );
30 | }).toList(),
31 | ),
32 | ),
33 | //body表示具体展示的内容
34 | body:TabBarView(children: [News(url: 'http://app3.qdaily.com/app3/homes/index_v2/'),News(url: 'http://app3.qdaily.com/app3/papers/index/')]) ,
35 | ),
36 | ),
37 | );
38 | }
39 | }
40 |
41 |
42 |
43 |
44 | void main() {
45 | runApp(new TabbedAppBarMain());
46 | }
--------------------------------------------------------------------------------
/lib/model/model.dart:
--------------------------------------------------------------------------------
1 | import 'package:json_annotation/json_annotation.dart';
2 | part 'model.g.dart';
3 |
4 | ///这个标注是告诉生成器,这个类是需要生成Model类的
5 | @JsonSerializable()
6 | class Reslut{
7 | Reslut(this.meta,this.response);
8 | @JsonKey(name: 'meta')
9 | Meta meta;
10 | @JsonKey(name: 'response')
11 | MyResponse response;
12 | //不同的类使用不同的mixin即可
13 | factory Reslut.fromJson(Map json) => _$ReslutFromJson(json);
14 | Map toJson() => _$ReslutToJson(this);
15 | }
16 |
17 | ///这个标注是告诉生成器,这个类是需要生成Model类的
18 | @JsonSerializable()
19 | class Meta{
20 | Meta(this.status,this.msg);
21 |
22 | int status;
23 | String msg;
24 | factory Meta.fromJson(Map json) => _$MetaFromJson(json);
25 | Map toJson() => _$MetaToJson(this);
26 | }
27 |
28 | @JsonSerializable()
29 | class MyResponse {
30 | @JsonKey(name: 'has_more')
31 | bool hasMore;
32 | @JsonKey(name: 'last_key')
33 | var lastKey;
34 | MyColumn column;
35 | Article article;
36 | List feeds;
37 | List authors;
38 | List subscribers;
39 | List columns;
40 | List banners;
41 | MyResponse(
42 | this.column,
43 | );
44 | factory MyResponse.fromJson(Map json) => _$MyResponseFromJson(json);
45 | Map toJson() => _$MyResponseToJson(this);
46 | }
47 |
48 | @JsonSerializable()
49 | class Feed {
50 | String image;
51 | int type;
52 | @JsonKey(name: 'index_type')
53 | int indexType;
54 | Post post;
55 | @JsonKey(name: 'news_list')
56 | List newsList;
57 | Feed(this.image,this.type,this.post,this.indexType,this.newsList);
58 | factory Feed.fromJson(Map json) => _$FeedFromJson(json);
59 | Map toJson() => _$FeedToJson(this);
60 | }
61 |
62 | @JsonSerializable()
63 | class News{
64 | String description;
65 | News(this.description);
66 | factory News.fromJson(Map json) => _$NewsFromJson(json);
67 | Map toJson() => _$NewsToJson(this);
68 | }
69 |
70 | @JsonSerializable()
71 | class Post {
72 | int id;
73 | int genre;
74 | Category category;
75 | @JsonKey(name: 'column')
76 | MyColumn column;
77 | String title;
78 | String description;
79 | @JsonKey(name: 'publish_time')
80 | int publishTime;
81 | String image;
82 | @JsonKey(name: 'start_time')
83 | int startTime;
84 | @JsonKey(name: 'comment_count')
85 | int commentCount;
86 | ///评论数
87 | @JsonKey(name: 'comment_status')
88 | bool commentStatus;
89 | ///收藏数
90 | @JsonKey(name: 'praise_count')
91 | int praiseCount;
92 | @JsonKey(name: 'super_tag')
93 | String superTag;
94 | @JsonKey(name: 'page_style')
95 | int pageStyle;
96 | @JsonKey(name: 'post_id')
97 | int postId;
98 | String appview;
99 | @JsonKey(name: 'file_length')
100 | String filmLength;
101 | String datatype;
102 |
103 | Post({this.id,
104 | this.genre,
105 | this.title,
106 | this.description,
107 | this.publishTime,
108 | this.image,
109 | this.startTime,
110 | this.commentCount,
111 | this.commentStatus,
112 | this.praiseCount,
113 | this.superTag,
114 | this.pageStyle,
115 | this.postId,
116 | this.appview,
117 | this.filmLength,
118 | this.datatype,
119 | this.category,
120 | this.column
121 | });
122 | factory Post.fromJson(Map json) => _$PostFromJson(json);
123 | Map toJson() => _$PostToJson(this);
124 | }
125 |
126 | @JsonSerializable()
127 | class Category {
128 | String title;
129 | int id;
130 | @JsonKey(name: 'image_lab')
131 | String imageLab;
132 | Category({this.title,this.id,this.imageLab});
133 | factory Category.fromJson(Map json) => _$CategoryFromJson(json);
134 | Map toJson() => _$CategoryToJson(this);
135 | }
136 |
137 | @JsonSerializable()
138 | class MyColumn {
139 | String name;
140 | int id;
141 | String icon;
142 | String image;
143 | String description;
144 | @JsonKey(name: 'subscriber_num')
145 | int subscriberNum;
146 | @JsonKey(name: 'content_provider')
147 | String contentProvider;
148 | int location;
149 | @JsonKey(name: 'show_type')
150 | int showType;
151 | MyColumn({this.name,this.id,this.icon,this.location,this.showType,this.description,this.subscriberNum});
152 | factory MyColumn.fromJson(Map json) => _$MyColumnFromJson(json);
153 | Map toJson() => _$MyColumnToJson(this);
154 | }
155 |
156 | @JsonSerializable()
157 | class MyBanner {
158 | int type;
159 | String image;
160 | Post post;
161 | MyBanner({this.type,this.image,this.post});
162 | factory MyBanner.fromJson(Map json) => _$MyBannerFromJson(json);
163 | Map toJson() => _$MyBannerToJson(this);
164 | }
165 |
166 | @JsonSerializable()
167 | class Article{
168 | int id;
169 | String body;
170 | List js;
171 | List css;
172 | List image;
173 | Article({this.id,this.body,this.js,this.css,this.image});
174 | factory Article.fromJson(Map json) => _$ArticleFromJson(json);
175 | Map toJson() => _$ArticleToJson(this);
176 | }
177 |
178 | @JsonSerializable()
179 | class Author{
180 | int id;
181 | String description;
182 | String avatar;
183 | String name;
184 | Author({this.id,this.description,this.avatar,this.name});
185 | factory Author.fromJson(Map json) => _$AuthorFromJson(json);
186 | Map toJson() => _$AuthorToJson(this);
187 | }
188 |
--------------------------------------------------------------------------------
/lib/model/model.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'model.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | Reslut _$ReslutFromJson(Map json) {
10 | return Reslut(
11 | json['meta'] == null
12 | ? null
13 | : Meta.fromJson(json['meta'] as Map),
14 | json['response'] == null
15 | ? null
16 | : MyResponse.fromJson(json['response'] as Map));
17 | }
18 |
19 | Map _$ReslutToJson(Reslut instance) =>
20 | {'meta': instance.meta, 'response': instance.response};
21 |
22 | Meta _$MetaFromJson(Map json) {
23 | return Meta(json['status'] as int, json['msg'] as String);
24 | }
25 |
26 | Map _$MetaToJson(Meta instance) =>
27 | {'status': instance.status, 'msg': instance.msg};
28 |
29 | MyResponse _$MyResponseFromJson(Map json) {
30 | return MyResponse(json['column'] == null
31 | ? null
32 | : MyColumn.fromJson(json['column'] as Map))
33 | ..hasMore = json['has_more'] as bool
34 | ..lastKey = json['last_key']
35 | ..article = json['article'] == null
36 | ? null
37 | : Article.fromJson(json['article'] as Map)
38 | ..feeds = (json['feeds'] as List)
39 | ?.map(
40 | (e) => e == null ? null : Feed.fromJson(e as Map))
41 | ?.toList()
42 | ..authors = (json['authors'] as List)
43 | ?.map((e) =>
44 | e == null ? null : Author.fromJson(e as Map))
45 | ?.toList()
46 | ..subscribers = (json['subscribers'] as List)
47 | ?.map((e) =>
48 | e == null ? null : Author.fromJson(e as Map))
49 | ?.toList()
50 | ..columns = (json['columns'] as List)
51 | ?.map((e) =>
52 | e == null ? null : MyColumn.fromJson(e as Map))
53 | ?.toList()
54 | ..banners = (json['banners'] as List)
55 | ?.map((e) =>
56 | e == null ? null : MyBanner.fromJson(e as Map))
57 | ?.toList();
58 | }
59 |
60 | Map _$MyResponseToJson(MyResponse instance) =>
61 | {
62 | 'has_more': instance.hasMore,
63 | 'last_key': instance.lastKey,
64 | 'column': instance.column,
65 | 'article': instance.article,
66 | 'feeds': instance.feeds,
67 | 'authors': instance.authors,
68 | 'subscribers': instance.subscribers,
69 | 'columns': instance.columns,
70 | 'banners': instance.banners
71 | };
72 |
73 | Feed _$FeedFromJson(Map json) {
74 | return Feed(
75 | json['image'] as String,
76 | json['type'] as int,
77 | json['post'] == null
78 | ? null
79 | : Post.fromJson(json['post'] as Map),
80 | json['index_type'] as int,
81 | (json['news_list'] as List)
82 | ?.map((e) =>
83 | e == null ? null : News.fromJson(e as Map))
84 | ?.toList());
85 | }
86 |
87 | Map _$FeedToJson(Feed instance) => {
88 | 'image': instance.image,
89 | 'type': instance.type,
90 | 'index_type': instance.indexType,
91 | 'post': instance.post,
92 | 'news_list': instance.newsList
93 | };
94 |
95 | News _$NewsFromJson(Map json) {
96 | return News(json['description'] as String);
97 | }
98 |
99 | Map _$NewsToJson(News instance) =>
100 | {'description': instance.description};
101 |
102 | Post _$PostFromJson(Map json) {
103 | return Post(
104 | id: json['id'] as int,
105 | genre: json['genre'] as int,
106 | title: json['title'] as String,
107 | description: json['description'] as String,
108 | publishTime: json['publish_time'] as int,
109 | image: json['image'] as String,
110 | startTime: json['start_time'] as int,
111 | commentCount: json['comment_count'] as int,
112 | commentStatus: json['comment_status'] as bool,
113 | praiseCount: json['praise_count'] as int,
114 | superTag: json['super_tag'] as String,
115 | pageStyle: json['page_style'] as int,
116 | postId: json['post_id'] as int,
117 | appview: json['appview'] as String,
118 | filmLength: json['file_length'] as String,
119 | datatype: json['datatype'] as String,
120 | category: json['category'] == null
121 | ? null
122 | : Category.fromJson(json['category'] as Map),
123 | column: json['column'] == null
124 | ? null
125 | : MyColumn.fromJson(json['column'] as Map));
126 | }
127 |
128 | Map _$PostToJson(Post instance) => {
129 | 'id': instance.id,
130 | 'genre': instance.genre,
131 | 'category': instance.category,
132 | 'column': instance.column,
133 | 'title': instance.title,
134 | 'description': instance.description,
135 | 'publish_time': instance.publishTime,
136 | 'image': instance.image,
137 | 'start_time': instance.startTime,
138 | 'comment_count': instance.commentCount,
139 | 'comment_status': instance.commentStatus,
140 | 'praise_count': instance.praiseCount,
141 | 'super_tag': instance.superTag,
142 | 'page_style': instance.pageStyle,
143 | 'post_id': instance.postId,
144 | 'appview': instance.appview,
145 | 'file_length': instance.filmLength,
146 | 'datatype': instance.datatype
147 | };
148 |
149 | Category _$CategoryFromJson(Map json) {
150 | return Category(
151 | title: json['title'] as String,
152 | id: json['id'] as int,
153 | imageLab: json['image_lab'] as String);
154 | }
155 |
156 | Map _$CategoryToJson(Category instance) => {
157 | 'title': instance.title,
158 | 'id': instance.id,
159 | 'image_lab': instance.imageLab
160 | };
161 |
162 | MyColumn _$MyColumnFromJson(Map json) {
163 | return MyColumn(
164 | name: json['name'] as String,
165 | id: json['id'] as int,
166 | icon: json['icon'] as String,
167 | location: json['location'] as int,
168 | showType: json['show_type'] as int,
169 | description: json['description'] as String,
170 | subscriberNum: json['subscriber_num'] as int)
171 | ..image = json['image'] as String
172 | ..contentProvider = json['content_provider'] as String;
173 | }
174 |
175 | Map _$MyColumnToJson(MyColumn instance) => {
176 | 'name': instance.name,
177 | 'id': instance.id,
178 | 'icon': instance.icon,
179 | 'image': instance.image,
180 | 'description': instance.description,
181 | 'subscriber_num': instance.subscriberNum,
182 | 'content_provider': instance.contentProvider,
183 | 'location': instance.location,
184 | 'show_type': instance.showType
185 | };
186 |
187 | MyBanner _$MyBannerFromJson(Map json) {
188 | return MyBanner(
189 | type: json['type'] as int,
190 | image: json['image'] as String,
191 | post: json['post'] == null
192 | ? null
193 | : Post.fromJson(json['post'] as Map));
194 | }
195 |
196 | Map _$MyBannerToJson(MyBanner instance) => {
197 | 'type': instance.type,
198 | 'image': instance.image,
199 | 'post': instance.post
200 | };
201 |
202 | Article _$ArticleFromJson(Map json) {
203 | return Article(
204 | id: json['id'] as int,
205 | body: json['body'] as String,
206 | js: (json['js'] as List)?.map((e) => e as String)?.toList(),
207 | css: (json['css'] as List)?.map((e) => e as String)?.toList(),
208 | image: (json['image'] as List)?.map((e) => e as String)?.toList());
209 | }
210 |
211 | Map _$ArticleToJson(Article instance) => {
212 | 'id': instance.id,
213 | 'body': instance.body,
214 | 'js': instance.js,
215 | 'css': instance.css,
216 | 'image': instance.image
217 | };
218 |
219 | Author _$AuthorFromJson(Map json) {
220 | return Author(
221 | id: json['id'] as int,
222 | description: json['description'] as String,
223 | avatar: json['avatar'] as String,
224 | name: json['name'] as String);
225 | }
226 |
227 | Map _$AuthorToJson(Author instance) => {
228 | 'id': instance.id,
229 | 'description': instance.description,
230 | 'avatar': instance.avatar,
231 | 'name': instance.name
232 | };
233 |
--------------------------------------------------------------------------------
/lib/news.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'model/model.dart';
3 | import 'package:flutter_spinkit/flutter_spinkit.dart';
4 | import 'dart:async';
5 | import 'package:dio/dio.dart';
6 | import 'widget/SwiperWidget.dart';
7 | import 'package:flutter_curiosity_app/tool/WidgetUtils.dart';
8 |
9 | class News extends StatefulWidget {
10 | @override
11 | String url;
12 | News({Key key, @required this.url}) : super(key: key);
13 | _NewsState createState() => _NewsState();
14 | }
15 |
16 | class _NewsState extends State with AutomaticKeepAliveClientMixin{
17 | @override
18 | bool get wantKeepAlive => true;
19 | @override
20 | void initState() {
21 | url = widget.url;
22 | getData();
23 | _scrollController.addListener(() {
24 | ///判断当前滑动位置是不是到达底部,触发加载更多回调
25 | if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
26 | getData();
27 | }
28 | });
29 | }
30 | final ScrollController _scrollController = new ScrollController();
31 | String url;
32 | dynamic lastKey = '0';
33 | List dataList = [];
34 | List banners = [];
35 | void getData()async{
36 | if (lastKey == '0'){
37 | dataList = [];//下拉刷新的时候将DataList制空
38 | }
39 | Dio dio = new Dio();
40 | Response response = await dio.get("$url$lastKey.json");
41 | Reslut reslut = Reslut.fromJson(response.data);
42 | if(!reslut.response.hasMore){
43 | return;//如果没有数据就不继续了
44 | }
45 | lastKey = reslut.response.lastKey;//更新lastkey
46 | setState(() {
47 | if (reslut.response.banners != null){
48 | banners = reslut.response.banners;//给轮播图赋值
49 | }
50 | Listdata = [];
51 | data.addAll(reslut.response.feeds);
52 | if(reslut.response.columns != null) {
53 | reslut.response.columns.forEach((MyColumn colunm) {
54 | data.insert(colunm.location, {'id': colunm.id,
55 | 'showType': colunm.showType});
56 | });
57 | }
58 | dataList.addAll(data);//给数据源赋值
59 | });
60 | }
61 |
62 | _getListCount() {
63 | ///如果有数据,最上面是轮播图最下面是加载loading动画,需要对列表数据总数+2
64 | return (dataList.length > 0) ? dataList.length + 2 : dataList.length + 1;
65 | }
66 | Future _handleRefresh() {
67 | final Completer completer = Completer();
68 | Timer(const Duration(seconds: 1), () {
69 | completer.complete();
70 | });
71 | return completer.future.then((_) {
72 | lastKey = '0';
73 | getData();
74 | });
75 | }
76 | @override
77 | Widget build(BuildContext context) {
78 | return RefreshIndicator(
79 | onRefresh:(()=> _handleRefresh()),
80 | color: Colors.yellow,//刷新控件的颜色
81 | child: ListView.separated(
82 | physics: const AlwaysScrollableScrollPhysics(),
83 | itemCount: _getListCount(),//item个数
84 | controller: _scrollController,//用于监听是否滑到最底部
85 | itemBuilder: (context,index){
86 | if(index == 0){
87 | return SwiperWidget(context, banners);//如果是第一个,则展示banner
88 | }else if(index < dataList.length + 1){
89 | return WidgetUtils.GetListItemWidget(context, dataList[index - 1]);//展示数据
90 | }else {
91 | return _buildProgressIndicator();//展示加载loading框
92 | }
93 | },
94 | separatorBuilder: (context,idx){//分割线
95 | return Container(
96 | height: 5,
97 | color: Color.fromARGB(50,183, 187, 197),
98 | );
99 | },
100 | ),
101 | );
102 | }
103 | @override void dispose() {
104 | // TODO: implement dispose
105 | super.dispose();
106 | _scrollController.dispose();
107 | }
108 | }
109 | ///上拉加载更多
110 | Widget _buildProgressIndicator() {
111 | ///是否需要显示上拉加载更多的loading
112 | Widget bottomWidget = new Row(mainAxisAlignment: MainAxisAlignment.center, children: [
113 | ///loading框
114 | new SpinKitThreeBounce(color: Color(0xFF24292E)),
115 | new Container(
116 | width: 5.0,
117 | ),
118 | ]);
119 | return new Padding(
120 | padding: const EdgeInsets.all(20.0),
121 | child: new Center(
122 | child: bottomWidget,
123 | ),
124 | );
125 | }
--------------------------------------------------------------------------------
/lib/tool/CommonUtils.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | class CommonUtils{
4 | static final double MILLIS_LIMIT = 1000.0;
5 |
6 | static final double SECONDS_LIMIT = 60 * MILLIS_LIMIT;
7 |
8 | static final double MINUTES_LIMIT = 60 * SECONDS_LIMIT;
9 |
10 | static final double HOURS_LIMIT = 24 * MINUTES_LIMIT;
11 |
12 | static final double DAYS_LIMIT = 24 * HOURS_LIMIT;
13 |
14 | static final double MONTH_LIMIT = 30 * DAYS_LIMIT;
15 |
16 |
17 | static double sStaticBarHeight = 0.0;
18 | static String getDateStr(DateTime date) {
19 | if (date == null || date.toString() == null) {
20 | return "";
21 | } else if (date.toString().length < 10) {
22 | return date.toString();
23 | }
24 | return date.toString().substring(0, 10);
25 | }
26 | ///日期格式转换
27 | static String getNewsTimeStr(int date) {
28 | int subTime = DateTime.now().millisecondsSinceEpoch - date;
29 |
30 | if (subTime < MILLIS_LIMIT) {
31 | return "刚刚";
32 | } else if (subTime < SECONDS_LIMIT) {
33 | return (subTime / MILLIS_LIMIT).round().toString() + " 秒前";
34 | } else if (subTime < MINUTES_LIMIT) {
35 | return (subTime / SECONDS_LIMIT).round().toString() + " 分钟前";
36 | } else if (subTime < HOURS_LIMIT) {
37 | return (subTime / MINUTES_LIMIT).round().toString() + " 小时前";
38 | } else if (subTime < DAYS_LIMIT) {
39 | return (subTime / HOURS_LIMIT).round().toString() + " 天前";
40 | } else if (subTime < MONTH_LIMIT){
41 | return (subTime / DAYS_LIMIT).round().toString() + " 月前";
42 | }else{
43 | return (subTime / MONTH_LIMIT).round().toString() + " 年前";
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/lib/tool/WidgetUtils.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_curiosity_app/model/model.dart';
3 | import 'package:flutter_curiosity_app/widget/NewsListWidget.dart';
4 | import 'package:flutter_curiosity_app/widget/ListImageTop.dart';
5 | import 'package:flutter_curiosity_app/widget/ActivityWidget.dart';
6 | import 'package:flutter_curiosity_app/widget/ListImageRight.dart';
7 | import 'package:flutter_curiosity_app/curiosityWebView.dart';
8 | import 'package:dio/dio.dart';
9 | import 'package:flutter_curiosity_app/widget/ColumnsListWidget.dart';
10 |
11 | ///http://app3.qdaily.com/app3/columns/index/8/0.json 横向列表图片卡片
12 | ///http://app3.qdaily.com/app3/columns/index/59/0.json 横向书本图片列表
13 | class WidgetUtils {
14 | static pushToCuriosityWebView(BuildContext context,int id)async{
15 | Dio dio = new Dio();
16 | Response response = await dio.get(
17 | "http://app3.qdaily.com/app3/articles/detail/${id}.json");
18 | String htmlBody = Reslut.fromJson(response.data).response.article.body;
19 | Navigator.push(context, MaterialPageRoute(
20 | builder: (context) => CuriosityWebView(htmlBody: htmlBody),
21 | )
22 | );
23 | }
24 | static Widget GetListItemWidget(BuildContext context, dynamic data) {
25 | Widget widget;
26 | if(data.runtimeType == Feed) {
27 | if (data.indexType != null) {
28 | widget = NewsListWidget(context, data);
29 | } else if (data.type == 2) {
30 | widget = ListImageTop(context, data);
31 | } else if (data.type == 0) {
32 | widget = ActivityWidget(context, data);
33 | } else if (data.type == 1) {
34 | widget = ListImageRight(context, data);
35 | }
36 | }else{
37 | widget = ColumnsListWidget(id: data['id'],showType: data['showType'],);
38 | }
39 | return GestureDetector(
40 | onTap: (){
41 | WidgetUtils.pushToCuriosityWebView(context, data.post.id);
42 | },
43 | child: widget,
44 | );
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/lib/widget/ActivityWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'BaseModuleWidget.dart';
3 | import 'package:flutter_curiosity_app/model/model.dart';
4 |
5 |
6 | Widget ActivityWidget(BuildContext context,Feed feed){
7 | return Column(
8 | children: [
9 | Container(
10 | height: 50,
11 | child: ActivityTitleWidget(context, feed.post.column.icon, feed.post.column.name),
12 | ),
13 | Stack(
14 | alignment: const FractionalOffset(0.07, 0.83),
15 | children: [
16 | Container(
17 | width: MediaQuery.of(context).size.width,
18 | child: Image.network(feed.image,fit: BoxFit.cover,),
19 | height: 170,
20 | ),
21 | Container(
22 | child: Image.network(feed.post.category.imageLab,width: 30,height: 30,),
23 | )
24 | ],
25 | ),
26 | Container(
27 | width: MediaQuery.of(context).size.width,
28 | child: TitleLabel(context, feed.post.title),
29 | margin: EdgeInsets.fromLTRB(15, 10, 15, 8),
30 | ),
31 | Container(
32 | width: MediaQuery.of(context).size.width,
33 | child: DescriptionLabel(context, feed.post.description),
34 | margin: EdgeInsets.fromLTRB(15, 0, 15, 10),
35 | ),
36 | ],
37 | );
38 | }
39 |
40 | Widget ActivityTitleWidget(BuildContext context,String iconString,String title){
41 | return Row(
42 | children: [
43 | Container(
44 | margin: EdgeInsets.fromLTRB(12, 2, 10, 0 ),
45 | child: CircleAvatar(
46 | backgroundImage: NetworkImage(iconString),
47 | radius: 10,
48 | ),
49 | ),
50 | Container(
51 | margin: EdgeInsets.fromLTRB(0, 2, 10, 0 ),
52 | child: TitleLabel(context, title),
53 | ),
54 | Expanded(
55 | child: Container(
56 | padding: EdgeInsets.fromLTRB(10, 1, 10, 0),
57 | alignment: Alignment.centerRight,
58 | child: Image.asset('toolbarShare.png',width: 18,height: 18,),
59 | ),
60 | )
61 | ],
62 | );
63 | }
--------------------------------------------------------------------------------
/lib/widget/BaseModuleWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_curiosity_app/model/model.dart';
3 | import 'package:flutter_curiosity_app/tool/CommonUtils.dart';
4 |
5 |
6 |
7 |
8 | Widget ListBottomWidget(BuildContext context,Post post){
9 | return Row(
10 | children: [
11 | DescriptionLabel(context, post.category.title),
12 | IconText(context, post.commentCount, 'feedComment.png'),
13 | IconText(context, post.praiseCount, 'feedPraise.png'),
14 | Padding(padding: EdgeInsets.all(5),),
15 | DescriptionLabel(context, CommonUtils.getNewsTimeStr(post.publishTime * 1000)),
16 | ],
17 | );
18 | }
19 |
20 | Widget TitleLabel(BuildContext context,String text,{double fontSize = 15,int maxLines = 3}){
21 | return Text(text,
22 | style:TextStyle(
23 | fontSize: fontSize,
24 | color: Colors.black,
25 | fontWeight: FontWeight.w500,
26 | ) ,
27 | overflow: TextOverflow.ellipsis,
28 | maxLines: maxLines,
29 | );
30 | }
31 |
32 | Widget DescriptionLabel(BuildContext context,String text,{double fontSize = 12,int maxLines = 1}){
33 | return Text(text,
34 | style:TextStyle(
35 | fontSize: fontSize,
36 | color: Color.fromARGB(200, 100, 100, 100),
37 | ) ,
38 | maxLines: maxLines,
39 | textAlign: TextAlign.left,
40 | );
41 | }
42 |
43 | Widget IconText(BuildContext context,int text,String ImageStr){
44 | return Row(
45 | children: [
46 | Padding(padding: EdgeInsets.all(2),),
47 | Image.asset(ImageStr,fit: BoxFit.fitWidth,width: 12,height: 12,),
48 | Padding(padding: EdgeInsets.all(1),),
49 | DescriptionLabel(context, '$text')
50 | ],
51 | );
52 | }
53 |
--------------------------------------------------------------------------------
/lib/widget/ColumnsDetailSubWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_curiosity_app/model/model.dart';
3 |
4 | Widget ImageTitleWidget(BuildContext context,MyResponse myResponse){
5 | if(myResponse == null){
6 | return Container();
7 | }
8 | return Container(
9 | child: Column(
10 | children: [
11 | Stack(
12 | alignment: Alignment(1, 0.8),
13 | children: [
14 | Image.network(myResponse.column.image,
15 | fit: BoxFit.cover,
16 | width: MediaQuery.of(context).size.width,
17 | height: 380,
18 | ),
19 | Container(
20 | alignment: Alignment.bottomCenter,
21 | child: NameLabelWidget(myResponse.column),
22 | ),
23 | ],
24 | ),
25 | subscriberNumberWidget(context,myResponse.column.subscriberNum),
26 | SubscriberGridView(context, myResponse.subscribers),
27 | ],
28 | ),
29 | );
30 |
31 | }
32 |
33 | Widget NameLabelWidget(MyColumn column){
34 | return Column(
35 | mainAxisSize: MainAxisSize.min,
36 | children: [
37 | Container(
38 | child: Text(column.name,
39 | style: TextStyle(
40 | fontSize: 22,
41 | color: Colors.white,
42 | fontWeight: FontWeight.w700,
43 | )
44 | ),
45 | padding: EdgeInsets.only(bottom: 15),
46 | ),
47 | Container(
48 | width: 220,
49 | child: Text(column.description,
50 | maxLines: 3,
51 | textAlign: TextAlign.center,
52 | style: TextStyle(
53 | fontSize: 13,
54 | color: Color.fromARGB(255, 240, 240, 240),
55 | fontWeight: FontWeight.w300,
56 | )
57 | ),
58 | padding: EdgeInsets.only(bottom: 15),
59 | ),
60 | Container(
61 | child: Image.asset('detailAdd.png',width: 50,height: 50,)
62 | )
63 | ],
64 | );
65 | }
66 |
67 | Widget subscriberNumberWidget(BuildContext context,int subScriberNum){
68 | return Container(
69 | width: MediaQuery.of(context).size.width,
70 | height: 40,
71 | child: Row(
72 | children: [
73 | Expanded(
74 | child: Container(
75 | margin: EdgeInsets.fromLTRB(15, 0, 15, 7),
76 | alignment: Alignment.bottomLeft,
77 | child: Container(
78 | height: 0.5,
79 | color: Color.fromARGB(50,180, 180, 180),
80 | ),
81 | ),
82 | ),
83 | Expanded(
84 | child: Container(
85 | alignment: Alignment.bottomCenter,
86 | child: Text('${subScriberNum} 人订阅了本栏目',
87 | style: TextStyle(
88 | fontSize: 11,
89 | color: Color.fromARGB(200, 180, 180, 180),
90 | ),
91 | maxLines: 1,
92 | ),
93 | ),
94 | ),
95 | Expanded(
96 | child: Container(
97 | alignment: Alignment.bottomRight,
98 | margin: EdgeInsets.fromLTRB(15, 0, 15, 7),
99 | child: Container(
100 | height: 0.5,
101 | color: Color.fromARGB(50,180, 180, 180),
102 | ),
103 | ),
104 | ),
105 | ],
106 | ),
107 | );
108 | }
109 |
110 | Widget SubscriberGridView(BuildContext context, List subscribers){
111 | return Container(
112 | color: Colors.white,
113 | padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
114 | width: MediaQuery.of(context).size.width,
115 | height: 110,
116 | child: GridView.count(
117 | physics: NeverScrollableScrollPhysics(),
118 | crossAxisCount: 6,
119 | padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
120 | children: List.generate(12, (index){
121 | return Container(
122 | padding: EdgeInsets.all(8),
123 | child: CircleAvatar(
124 | backgroundImage: NetworkImage(subscribers[index].avatar),
125 | ),
126 | // child: Image.network(subscribers[index].avatar,fit: BoxFit.fill,),
127 | );
128 | })
129 | ),
130 | );
131 | }
--------------------------------------------------------------------------------
/lib/widget/ColumnsListWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'ActivityWidget.dart';
3 | import 'package:flutter_curiosity_app/model/model.dart';
4 | import 'BaseModuleWidget.dart';
5 | import 'package:dio/dio.dart';
6 | import 'package:flutter_curiosity_app/tool/CommonUtils.dart';
7 | import 'package:flutter_curiosity_app/tool/WidgetUtils.dart';
8 | import 'package:flutter_curiosity_app/ColumnsDetail.dart';
9 |
10 | class ColumnsListWidget extends StatefulWidget {
11 |
12 | int id;
13 | int showType;
14 | ColumnsListWidget({Key key, @required this.id,this.showType}) : super(key: key);
15 | @override
16 | _ColumnsListWidgetState createState() => _ColumnsListWidgetState();
17 | }
18 |
19 | class _ColumnsListWidgetState extends State with AutomaticKeepAliveClientMixin {
20 | @override
21 | bool get wantKeepAlive => true;
22 | List feedList = [];
23 | int lastKey = 0;
24 | int id ;
25 | int showType;
26 | final ScrollController _scrollController = new ScrollController();
27 | void getColunmData()async{
28 | Dio dio = new Dio();
29 | Response response = await dio.get('http://app3.qdaily.com/app3/columns/index/$id/$lastKey.json');
30 | Reslut reslut = Reslut.fromJson(response.data);
31 | if(!reslut.response.hasMore){
32 | return;
33 | }
34 | setState(() {
35 | lastKey = reslut.response.lastKey;
36 | feedList.addAll(reslut.response.feeds);
37 | });
38 | }
39 | @override
40 | void initState() {
41 | // TODO: implement initState
42 | super.initState();
43 | this.id = widget.id;
44 | this.showType = widget.showType;
45 | print('初始化');
46 | getColunmData();
47 | _scrollController.addListener(() {
48 | ///判断当前滑动位置是不是到达底部,触发加载更多回调
49 | if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent) {
50 | setState(() {
51 | getColunmData();
52 | });
53 | }
54 | });
55 | }
56 | @override
57 | Widget build(BuildContext context) {
58 | return ColumnsContainerWidget(context, feedList,_scrollController,showType,widget.id);
59 | }
60 | }
61 |
62 |
63 | Widget ColumnsContainerWidget(BuildContext context,List feedList,ScrollController scrollController,int showType,int id){
64 | if(feedList.length == 0){
65 | return Container();
66 | }
67 | return Container(
68 | width: MediaQuery.of(context).size.width,
69 | height: 320,
70 | padding: EdgeInsets.only(bottom: 20),
71 | child: Column(
72 | children: [
73 | GestureDetector(
74 | child: Container(
75 | height: 50,
76 | child: ActivityTitleWidget(context, feedList[0].post.column.icon, feedList[0].post.column.name),
77 | ),
78 | onTap: (){
79 | Navigator.push(context,
80 | MaterialPageRoute(
81 | builder: (context) => ColumnsDetail(id: id,),
82 | )
83 | );
84 | },
85 | ),
86 | Container(
87 | child: ColumnstWidget(feedList,scrollController,showType),
88 | )
89 | ],
90 | ),
91 | );
92 | }
93 |
94 | Widget ColumnstWidget(List feedList,ScrollController scrollController,int showType){
95 | return Flexible(
96 | child: ListView.separated(
97 | controller: scrollController,
98 | padding: new EdgeInsets.symmetric(horizontal: 12.0),
99 | scrollDirection: Axis.horizontal,
100 | itemBuilder: (context,index) {
101 | if(showType == 1){
102 | return ColumnsTypeOneTile(context, feedList[index]);
103 | }
104 | return ColumnsTypeTwoTile(context, feedList[index]);
105 | },
106 | separatorBuilder: (context,idx){
107 | return Container(
108 | width: 8,
109 | color: Colors.white,
110 | );
111 | },
112 | itemCount: feedList.length,
113 | )
114 | );
115 | }
116 |
117 | Widget ColumnsTypeOneTile(BuildContext context, Feed feed){
118 | return GestureDetector(
119 | onTap: (){
120 | WidgetUtils.pushToCuriosityWebView(context, feed.post.id);
121 | },
122 | child: Container(
123 | decoration: new BoxDecoration(
124 | border: new Border.all(width: 0.5, color: Color.fromARGB(50,183, 187, 197)),
125 | ),
126 | width: 270,
127 | height: 245,
128 | child: Column(
129 | children: [
130 | Container(
131 | child: Image.network(feed.image,width: 150,fit: BoxFit.fitWidth,),
132 | height: 140,
133 | width: 270,
134 | ),
135 | Container(
136 | child: TitleLabel(context, feed.post.title,fontSize: 12,maxLines: 2),
137 | padding: EdgeInsets.fromLTRB(10, 10, 10, 5),
138 | ),
139 | Container(
140 | child: DescriptionLabel(context, feed.post.description,fontSize: 12,maxLines: 2),
141 | padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
142 | ),
143 | Expanded(
144 | child: Container(
145 | child: Row(
146 | mainAxisSize:MainAxisSize.min,
147 | children: [
148 | IconText(context, feed.post.commentCount, 'feedComment.png'),
149 | IconText(context, feed.post.praiseCount, 'feedPraise.png'),
150 | Padding(padding: EdgeInsets.all(5),),
151 | DescriptionLabel(context, CommonUtils.getNewsTimeStr(feed.post.publishTime * 1000)),
152 | ],
153 | ),
154 | padding: EdgeInsets.fromLTRB(8, 0, 0, 5),
155 | alignment: Alignment.bottomLeft,
156 | ),
157 | )
158 | ],
159 | ),
160 | ),
161 | );
162 | }
163 |
164 | Widget ColumnsTypeTwoTile(BuildContext context, Feed feed){
165 | return GestureDetector(
166 | onTap: (){
167 | WidgetUtils.pushToCuriosityWebView(context, feed.post.id);
168 | },
169 | child: Container(
170 | decoration: new BoxDecoration(
171 | border: new Border.all(width: 0.5, color: Color.fromARGB(50,183, 187, 197)),
172 | ),
173 | width: 150,
174 | height: 245,
175 | child: Column(
176 | children: [
177 | Container(
178 | child: Image.network(feed.image,fit: BoxFit.fitWidth,),
179 | height: 140,
180 | width: 150,
181 | ),
182 | Container(
183 | child: TitleLabel(context, feed.post.title,fontSize: 12,maxLines: 2),
184 | padding: EdgeInsets.only(top: 20)
185 | ),
186 | Expanded(
187 | child: Container(
188 | alignment: Alignment.bottomCenter,
189 | child: Row(
190 | mainAxisSize:MainAxisSize.min,
191 | children: [
192 | IconText(context, feed.post.commentCount, 'feedComment.png'),
193 | IconText(context, feed.post.praiseCount, 'feedPraise.png'),
194 | ],
195 | ),
196 | padding: EdgeInsets.only(bottom: 30),
197 | ),
198 | )
199 | ],
200 | ),
201 | )
202 | );
203 | }
--------------------------------------------------------------------------------
/lib/widget/ListImageRight.dart:
--------------------------------------------------------------------------------
1 | import 'BaseModuleWidget.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_curiosity_app/model/model.dart';
4 |
5 | Widget ListImageRight(
6 | BuildContext context, Feed feed) {
7 | Widget widget;
8 | widget = new Row(
9 | children: [
10 | Container(
11 | width: 200,
12 | height: 120,
13 | margin: EdgeInsets.all(0),
14 | child: Column(
15 | children: [
16 | Container(
17 | child: TitleLabel(context, feed.post.title),
18 | height: 90,
19 | padding: const EdgeInsets.all(10),
20 | alignment: Alignment.topLeft,
21 | ),
22 | Expanded(
23 | child: Container(
24 | padding: EdgeInsets.fromLTRB(10, 0, 10, 5),
25 | alignment: Alignment.bottomLeft,
26 | child: ListBottomWidget(context, feed.post)
27 | ),
28 | )
29 | ],
30 | ),
31 | ),
32 | Expanded(
33 | child: Container(
34 | margin: EdgeInsets.only(left: 0),
35 | // width: 170,
36 | height: 120,
37 | child: Image.network(feed.image,fit: BoxFit.fitHeight,),
38 | ),
39 | ),
40 | ],
41 | );
42 | return widget;
43 | }
--------------------------------------------------------------------------------
/lib/widget/ListImageTop.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_curiosity_app/model/model.dart';
3 | import 'BaseModuleWidget.dart';
4 |
5 | Widget ListImageTop(BuildContext context,Feed feed){
6 | return Column(
7 | children: [
8 | Container(
9 | width: MediaQuery.of(context).size.width,
10 | child: Image.network(feed.image,fit: BoxFit.fitWidth,),
11 | height: 170,
12 | ),
13 | Container(
14 | width: MediaQuery.of(context).size.width,
15 | child: TitleLabel(context, feed.post.title),
16 | margin: EdgeInsets.fromLTRB(15, 15, 15, 8),
17 | ),
18 | Container(
19 | width: MediaQuery.of(context).size.width,
20 | child: DescriptionLabel(context, feed.post.description),
21 | margin: EdgeInsets.fromLTRB(15, 0, 15, 10),
22 | ),
23 | Container(
24 | child: ListBottomWidget(context, feed.post),
25 | margin: EdgeInsets.fromLTRB(15, 0, 0, 13),
26 | )
27 | ],
28 | );
29 | }
--------------------------------------------------------------------------------
/lib/widget/NewsListWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_curiosity_app/model/model.dart';
3 | import 'BaseModuleWidget.dart';
4 |
5 | Widget NewsListWidget(BuildContext context,Feed feed){
6 | return Column(
7 | children: [
8 | TitleWidget(context,feed),
9 | NewsFirstLineWidget(context, feed.newsList[0].description, feed.image),
10 | Container(height: 10,),
11 | NewsLineWidget(context, feed.newsList[1].description),
12 | Container(
13 | height: 0.8,
14 | // padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
15 | margin: EdgeInsets.fromLTRB(20, 0, 20, 10),
16 | color: Color.fromARGB(50,183, 187, 197),
17 | ),
18 | NewsLineWidget(context, feed.newsList[2].description),
19 | NewsListBottomWidget(context,feed.post),
20 | ],
21 | );
22 | }
23 |
24 | Widget TitleWidget(BuildContext context,Feed feed){
25 | return Row(
26 | children: [
27 | Container(
28 | width: 30,
29 | height: 30,
30 | child: CircleAvatar(
31 | backgroundImage: NetworkImage(feed.post.column.icon),
32 | ),
33 | // child: Image.network(feed.post.column.icon,width: 25,height: 25,),
34 | padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
35 | ),
36 | Padding(
37 | padding: EdgeInsets.fromLTRB(10, 10, 0, 0),
38 | child: TitleLabel(context, feed.post.column.name,),
39 | )
40 | ],
41 | );
42 | }
43 |
44 | Widget NewsFirstLineWidget(BuildContext context,String title,String imageStr){
45 | return Row(
46 | children: [
47 | Container(
48 | width: 40,
49 | height: 40,
50 | child: Image.asset('yellowDot.png',fit:BoxFit.fitWidth, width: 30,height: 30,),
51 | padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
52 | ),
53 | Container(
54 | width: 200,
55 | height: 40,
56 | child: DescriptionLabel(context, title, fontSize: 13),
57 | ),
58 | Expanded(
59 | child: Container(
60 | // margin: EdgeInsets.all( 10),
61 | // width: 140,
62 | height: 60,
63 | child: Image.network(imageStr,fit: BoxFit.fitHeight,),
64 | ),
65 | ),
66 | ],
67 | );
68 | }
69 | Widget NewsLineWidget(BuildContext context,String title){
70 | return Row(
71 | children: [
72 | Container(
73 | width: 40,
74 | height: 30,
75 | child: Image.asset('yellowDot.png',fit: BoxFit.fitWidth,),
76 | padding: EdgeInsets.only(bottom: 12),
77 | ),
78 | Expanded(
79 | child: Container (
80 | padding: EdgeInsets.only(right: 20),
81 | height: 30,
82 | child: DescriptionLabel(context, title,fontSize: 13),
83 | margin: EdgeInsets.only(right: 10),
84 | ),
85 | )
86 |
87 | ],
88 | );
89 | }
90 |
91 | Widget NewsListBottomWidget(BuildContext context,Post post){
92 | return Row(
93 | children: [
94 | Container(
95 | child: ListBottomWidget(context,post),
96 | padding: EdgeInsets.fromLTRB(15, 0, 0, 5),
97 | ),
98 | Expanded(
99 | child: Container(
100 | alignment: Alignment.centerRight,
101 | child: DescriptionLabel(context, '查看详情>>'),
102 | padding: EdgeInsets.fromLTRB(0, 0, 10, 5),
103 | ),
104 | )
105 | ],
106 | );
107 | }
108 |
--------------------------------------------------------------------------------
/lib/widget/SwiperWidget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_swiper/flutter_swiper.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_curiosity_app/model/model.dart';
4 | import 'package:flutter_curiosity_app/tool/WidgetUtils.dart';
5 |
6 | Widget SwiperWidget(BuildContext context,List bannerList){
7 | Widget widget;
8 | if(bannerList.length == 0){
9 | return Container();
10 | }
11 | DotSwiperPaginationBuilder builder = DotSwiperPaginationBuilder(
12 | color: Colors.white,//未选中圆点颜色
13 | activeColor: Colors.yellow,//选中圆点颜色
14 | size:7,//未选中大小
15 | activeSize: 7,//选中圆点大小
16 | space: 5//圆点间距
17 | );
18 | widget = bannerList.length > 0 ? new Swiper(
19 | itemCount: bannerList.length,
20 | loop: true,
21 | itemBuilder: (BuildContext context,int index){
22 | return new Image.network(bannerList[index].image,fit: BoxFit.cover,);
23 | },
24 | pagination: new SwiperPagination(
25 | builder: builder,
26 | ),
27 | onTap: (index){
28 | WidgetUtils.pushToCuriosityWebView(context, bannerList[index].post.id);
29 | },
30 | ) : Container(
31 | height: 200,
32 | );
33 | return Container(
34 | height: 200,
35 | child: widget,
36 | );
37 | }
38 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_curiosity_app
2 | description: A new Flutter project.
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 | # Read more about versioning at semver.org.
10 | version: 1.0.0+1
11 |
12 | environment:
13 | sdk: ">=2.0.0-dev.68.0 <3.0.0"
14 |
15 | dependencies:
16 | flutter:
17 | sdk: flutter
18 | flutter_webview_plugin: ^0.3.0+2
19 | json_annotation: ^2.0.0
20 | dio: ^1.0.13
21 | cupertino_icons: ^0.1.2
22 | flutter_spinkit: ^3.1.0
23 | flutter_swiper: ^1.1.4
24 |
25 | dev_dependencies:
26 | flutter_test:
27 | sdk: flutter
28 | json_serializable: ^2.0.1
29 | build_runner: ^1.1.2
30 |
31 | # For information on the generic Dart part of this file, see the
32 | # following page: https://www.dartlang.org/tools/pub/pubspec
33 |
34 | # The following section is specific to Flutter.
35 | flutter:
36 |
37 | # The following line ensures that the Material Icons font is
38 | # included with your application, so that you can use the icons in
39 | # the material Icons class.
40 | uses-material-design: true
41 | assets:
42 | - feedComment.png
43 | - feedPraise.png
44 | - qdaily.png
45 | - yellowDot.png
46 | - toolbarShare.png
47 | - detailAdd.png
48 |
49 | # An image asset can refer to one or more resolution-specific "variants", see
50 | # https://flutter.io/assets-and-images/#resolution-aware.
51 |
52 | # For details regarding adding assets from package dependencies, see
53 | # https://flutter.io/assets-and-images/#from-packages
54 |
55 | # To add custom fonts to your application, add a fonts section here,
56 | # in this "flutter" section. Each entry in this list should have a
57 | # "family" key with the font family name, and a "fonts" key with a
58 | # list giving the asset and other descriptors for the font. For
59 | # example:
60 | # fonts:
61 | # - family: Schyler
62 | # fonts:
63 | # - asset: fonts/Schyler-Regular.ttf
64 | # - asset: fonts/Schyler-Italic.ttf
65 | # style: italic
66 | # - family: Trajan Pro
67 | # fonts:
68 | # - asset: fonts/TrajanPro.ttf
69 | # - asset: fonts/TrajanPro_Bold.ttf
70 | # weight: 700
71 | #
72 | # For details regarding fonts from package dependencies,
73 | # see https://flutter.io/custom-fonts/#from-packages
74 |
--------------------------------------------------------------------------------