├── android ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── app │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── 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 │ │ │ └── drawable │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ └── cn │ │ │ │ └── edu │ │ │ │ └── jnxy │ │ │ │ └── zhihu │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── .gitignore ├── settings.gradle ├── build.gradle ├── gradlew.bat └── gradlew ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── AppDelegate.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── main.m │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcworkspace │ └── contents.xcworkspacedata ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── xcshareddata │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ └── project.pbxproj └── .gitignore ├── lib.zip ├── image ├── 1.png ├── 2.png ├── 3.png ├── 4.png └── 5.png ├── .gitignore ├── .metadata ├── lib ├── global_config.dart ├── main.dart ├── index │ ├── navigation_icon_view.dart │ └── index.dart ├── market │ └── market_page.dart ├── notice │ └── notice_page.dart ├── idea │ └── idea_page.dart ├── home │ ├── question.dart │ ├── article.dart │ ├── ask_page.dart │ ├── home_page.dart │ ├── recommend.dart │ ├── hot.dart │ ├── search_page.dart │ ├── follow.dart │ ├── question_page.dart │ └── reply_page.dart └── my │ └── my_page.dart ├── README.md ├── zhihu.iml ├── test └── widget_test.dart ├── zhihu_android.iml ├── pubspec.yaml └── pubspec.lock /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /lib.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/lib.zip -------------------------------------------------------------------------------- /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/image/1.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/image/5.png -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .dart_tool/ 4 | .idea 5 | .vscode/ 6 | .packages 7 | .pub/ 8 | build/ 9 | ios/.generated/ 10 | packages 11 | .flutter-plugins 12 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enilu/zhihu-flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | *.class 3 | .gradle 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | GeneratedPluginRegistrant.java 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /.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: 5a58b36e36b8d7aace89d3950e6deb307956a6a0 8 | channel: beta 9 | -------------------------------------------------------------------------------- /lib/global_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GlobalConfig { 4 | static bool dark = true; 5 | static ThemeData themeData = new ThemeData.dark(); 6 | static Color searchBackgroundColor = Colors.white10; 7 | static Color cardBackgroundColor = new Color(0xFF222222); 8 | static Color fontColor = Colors.white30; 9 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'index/index.dart'; 3 | 4 | void main() => runApp(new ZhiHu()); 5 | 6 | class ZhiHu extends StatelessWidget { 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return new MaterialApp( 11 | title: "知乎-高仿版", 12 | home: new Index(), 13 | ); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 知乎- Flutter 高仿版 UI 2 | 3 | 使用 Flutter 模仿的知乎黑色主题的 UI。 4 | 5 | 在 “我的” 页中可以修改日间和夜间模式。 6 | 7 | 这是我当初初学时做的一个 demo ,看着代码做一遍基本可以入门 Flutter,学会 APP 布局。 8 | 9 | 照着这个 demo ,两三天做下来,一周入门不是问题。 10 | 11 | 现在我使用 Flutter 已经 5,6 个月了。我的更多 Flutter 的分享在:https://zhuanlan.zhihu.com/flutter 12 | 13 | ## APP截图 14 | 15 | ![wei](./image/1.png) 16 | ![wei](./image/2.png) 17 | ![wei](./image/3.png) 18 | ![wei](./image/4.png) 19 | ![wei](./image/5.png) 20 | -------------------------------------------------------------------------------- /android/app/src/main/java/cn/edu/jnxy/zhihu/MainActivity.java: -------------------------------------------------------------------------------- 1 | package cn.edu.jnxy.zhihu; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/index/navigation_icon_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NavigationIconView { 4 | 5 | NavigationIconView({ 6 | Widget icon, 7 | Widget title, 8 | TickerProvider vsync 9 | }): 10 | item = new BottomNavigationBarItem( 11 | icon: icon, 12 | title: title, 13 | ), 14 | controller = new AnimationController( 15 | duration: kThemeAnimationDuration, 16 | vsync: vsync 17 | ); 18 | 19 | final BottomNavigationBarItem item; 20 | final AnimationController controller; 21 | } -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/flutter_assets/ 37 | /Flutter/App.framework 38 | /Flutter/Flutter.framework 39 | /Flutter/Generated.xcconfig 40 | /ServiceDefinitions.json 41 | 42 | Pods/ 43 | -------------------------------------------------------------------------------- /lib/market/market_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class MarketPage extends StatefulWidget { 5 | 6 | @override 7 | _MarketPageState createState() => new _MarketPageState(); 8 | 9 | } 10 | 11 | class _MarketPageState extends State { 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return new MaterialApp( 16 | home: new Scaffold( 17 | appBar: new AppBar( 18 | title: new Text('市场'), 19 | ), 20 | body: new Center( 21 | child: null 22 | ), 23 | ), 24 | theme: GlobalConfig.themeData 25 | ); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /lib/notice/notice_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class NoticePage extends StatefulWidget { 5 | 6 | @override 7 | _NoticePageState createState() => new _NoticePageState(); 8 | 9 | } 10 | 11 | class _NoticePageState extends State { 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return new MaterialApp( 16 | home: new Scaffold( 17 | appBar: new AppBar( 18 | title: new Text('通知'), 19 | ), 20 | body: new Center( 21 | child: null 22 | ), 23 | ), 24 | theme: GlobalConfig.themeData 25 | ); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /lib/idea/idea_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class IdeaPage extends StatefulWidget { 5 | 6 | @override 7 | _IdeaPageState createState() => new _IdeaPageState(); 8 | 9 | } 10 | 11 | class _IdeaPageState extends State { 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return new MaterialApp( 16 | home: new Scaffold( 17 | appBar: new AppBar( 18 | title: new Text('想法'), 19 | actions: [ 20 | new Container( 21 | 22 | ) 23 | ], 24 | ), 25 | body: new Center( 26 | child: null 27 | ), 28 | ), 29 | theme: GlobalConfig.themeData 30 | ); 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /zhihu.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /lib/home/question.dart: -------------------------------------------------------------------------------- 1 | 2 | class Question { 3 | String order; 4 | String rise; 5 | String title; 6 | String mark; 7 | String hotNum; 8 | String imgUrl; 9 | 10 | Question(this.order, this.title, this.hotNum, this.imgUrl, {this.mark, this.rise}); 11 | } 12 | 13 | List questionList = [ 14 | new Question("01", "了不起的新时代,世界竞争中的中国制造", "4427 万热度", "https://pic2.zhimg.com/50/v2-710b7a6fea12a7203945b666790b7181_hd.jpg"), 15 | new Question("02", "一个女生怎样才算见过世面?", "4157 万热度", "https://pic3.zhimg.com/50/v2-56dca99cd8718f9303d43b3015342ba7_hd.jpg", rise: "3", mark: "所谓世面,就是世界的每一面"), 16 | new Question("03", "如果朱标没死,削藩的话,朱棣会造反吗?", "4009 万热度", "https://pic4.zhimg.com/v2-095d2b48970889b108247e6d2dd0fa6b_b.jpg"), 17 | new Question("04", "如何编译 Linux 内核?", "3110 万热度", "https://pic3.zhimg.com/80/v2-1ea1b0cf80c85b88893b2b97a94d7e71_hd.jpg", mark: "内核?呵呵"), 18 | new Question("05", "如何看待将神话故事拍成电影这件事?", "2119 万热度", "https://pic4.zhimg.com/50/v2-267b1dda62f770bd2bd13cb545117b78_hd.jpg",rise: "3",) 19 | ]; -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter 3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to 4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties 5 | // are correct. 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_test/flutter_test.dart'; 9 | 10 | import 'package:zhihu/main.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(new ZhiHu()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /zhihu_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 27 19 | 20 | lintOptions { 21 | disable 'InvalidPackage' 22 | } 23 | 24 | defaultConfig { 25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 26 | applicationId "cn.edu.jnxy.zhihu" 27 | minSdkVersion 16 28 | targetSdkVersion 27 29 | versionCode 1 30 | versionName "1.0" 31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 32 | } 33 | 34 | buildTypes { 35 | release { 36 | // TODO: Add your own signing config for the release build. 37 | // Signing with the debug keys for now, so `flutter run --release` works. 38 | signingConfig signingConfigs.debug 39 | } 40 | } 41 | } 42 | 43 | flutter { 44 | source '../..' 45 | } 46 | 47 | dependencies { 48 | testImplementation 'junit:junit:4.12' 49 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 51 | } 52 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | zhihu 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /lib/home/article.dart: -------------------------------------------------------------------------------- 1 | 2 | class Article { 3 | String headUrl; 4 | String user; 5 | String action; 6 | String time; 7 | String title; 8 | String mark; 9 | String imgUrl; 10 | int agreeNum; 11 | int commentNum; 12 | 13 | Article(this.headUrl, this.user, this.action, this.time, this.title, this.mark, this.agreeNum, this.commentNum, {this.imgUrl}); 14 | } 15 | 16 | List
articleList = [ 17 | new Article( 18 | "https://pic3.zhimg.com/50/2b8be8010409012e7cdd764e1befc4d1_s.jpg", 19 | "learner", 20 | "赞同了回答", 21 | "2小时前", 22 | "在三体中,罗辑为什么会把控制权交给程心,难道他没有推测过后果吗?", 23 | "因为罗辑遵守了人类伦理。这个伦理大概就叫民主。 大刘其实是个典型的精英主义者,在他笔下...", 24 | 32, 10, 25 | imgUrl: "https://pic2.zhimg.com/50/v2-710b7a6fea12a7203945b666790b7181_hd.jpg" 26 | ), 27 | new Article( 28 | "https://pic4.zhimg.com/50/v2-9a3cb5d5ee4339b8cf4470ece18d404f_s.jpg", 29 | "learner", 30 | "回答了问题", 31 | "5小时前", 32 | "我的手机系统是安卓。无意间发现自己的屏幕被人监控,请问怎样才能彻底摆脱被监控的处境呢?", 33 | "检查一下你手机里是不是被人装了什么软件,把你不认识的非系统软件删掉。不会删就去找手机店里的小哥,为什么这么多人...", 34 | 38, 13, 35 | ), 36 | new Article( 37 | "https://pic3.zhimg.com/50/v2-8943c20cecab028e19644cccf0f3a38b_s.jpg", 38 | "learner", 39 | "回答了问题", 40 | "7小时前", 41 | "如何评价2018年安徽省程序设计竞赛?", 42 | "带着政治任务和压力去打了比赛,所幸最后被高中生抬了一手。榜可以见另外某回答。大概经历就是前...", 43 | 38, 13, 44 | imgUrl: "https://pic4.zhimg.com/v2-a7493d69f0d8f849c6345f8f693454f3_200x112.jpg" 45 | ), 46 | new Article( 47 | "https://pic3.zhimg.com/50/v2-8943c20cecab028e19644cccf0f3a38b_s.jpg", 48 | "learner", 49 | "回答了问题", 50 | "7小时前", 51 | "极致的文明是什么样的?会真的像黑暗森林法则一样对其他低等生物进行屠杀吗?", 52 | "最喜欢的人物是章北海和维德但最喜欢的情节却是这一段,地球上的人承诺给他们鲜花和荣誉...", 53 | 38, 13, 54 | imgUrl: "https://pic3.zhimg.com/v2-b67be50be51e2e6d6112a64528683b09_b.jpg" 55 | ) 56 | ]; -------------------------------------------------------------------------------- /lib/home/ask_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class AskPage extends StatefulWidget { 5 | 6 | @override 7 | AskPageState createState() => new AskPageState(); 8 | } 9 | 10 | class AskPageState extends State { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return new MaterialApp( 15 | theme: GlobalConfig.themeData, 16 | home: new Scaffold( 17 | appBar: new AppBar( 18 | title: new Container( 19 | child: new Row( 20 | children: [ 21 | new FlatButton.icon( 22 | onPressed: (){ 23 | Navigator.of(context).pop(); 24 | }, 25 | icon: new Icon(Icons.clear, color: Colors.white70), 26 | label: new Text(""), 27 | ), 28 | new Expanded( 29 | child: new Container( 30 | child: new Text("提问"), 31 | ) 32 | ), 33 | new FlatButton( 34 | onPressed: (){}, 35 | child: new Text("下一步", style: new TextStyle(color: Colors.white12)) 36 | ) 37 | ], 38 | ), 39 | ) 40 | ), 41 | body: new SingleChildScrollView( 42 | child: new Column( 43 | children: [ 44 | new Container( 45 | child: new TextField( 46 | decoration: new InputDecoration( 47 | hintText: "请输入标题", 48 | hintStyle: new TextStyle(color: Colors.white70) 49 | ), 50 | ), 51 | margin: const EdgeInsets.all(16.0), 52 | ) 53 | 54 | ], 55 | ), 56 | ) 57 | ) 58 | ); 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: zhihu 2 | description: A new Flutter application. 3 | 4 | dependencies: 5 | flutter: 6 | sdk: flutter 7 | 8 | # The following adds the Cupertino Icons font to your application. 9 | # Use with the CupertinoIcons class for iOS style icons. 10 | cupertino_icons: ^0.1.0 11 | 12 | dev_dependencies: 13 | flutter_test: 14 | sdk: flutter 15 | 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://www.dartlang.org/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | 23 | # The following line ensures that the Material Icons font is 24 | # included with your application, so that you can use the icons in 25 | # the material Icons class. 26 | uses-material-design: true 27 | 28 | # To add assets to your application, add an assets section, like this: 29 | # assets: 30 | # - images/a_dot_burr.jpeg 31 | # - images/a_dot_ham.jpeg 32 | 33 | # An image asset can refer to one or more resolution-specific "variants", see 34 | # https://flutter.io/assets-and-images/#resolution-aware. 35 | 36 | # For details regarding adding assets from package dependencies, see 37 | # https://flutter.io/assets-and-images/#from-packages 38 | 39 | # To add custom fonts to your application, add a fonts section here, 40 | # in this "flutter" section. Each entry in this list should have a 41 | # "family" key with the font family name, and a "fonts" key with a 42 | # list giving the asset and other descriptors for the font. For 43 | # example: 44 | # fonts: 45 | # - family: Schyler 46 | # fonts: 47 | # - asset: fonts/Schyler-Regular.ttf 48 | # - asset: fonts/Schyler-Italic.ttf 49 | # style: italic 50 | # - family: Trajan Pro 51 | # fonts: 52 | # - asset: fonts/TrajanPro.ttf 53 | # - asset: fonts/TrajanPro_Bold.ttf 54 | # weight: 700 55 | # 56 | # For details regarding fonts from package dependencies, 57 | # see https://flutter.io/custom-fonts/#from-packages 58 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/index/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'navigation_icon_view.dart'; 3 | import '../global_config.dart'; 4 | import '../home/home_page.dart'; 5 | import '../idea/idea_page.dart'; 6 | import '../market/market_page.dart'; 7 | import '../notice/notice_page.dart'; 8 | import '../my/my_page.dart'; 9 | 10 | class Index extends StatefulWidget { 11 | 12 | @override 13 | State createState() => new _IndexState(); 14 | } 15 | 16 | class _IndexState extends State with TickerProviderStateMixin{ 17 | 18 | int _currentIndex = 0; 19 | List _navigationViews; 20 | List _pageList; 21 | StatefulWidget _currentPage; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | _navigationViews = [ 27 | new NavigationIconView( 28 | icon: new Icon(Icons.assignment), 29 | title: new Text("首页"), 30 | vsync: this, 31 | ), 32 | new NavigationIconView( 33 | icon: new Icon(Icons.all_inclusive), 34 | title: new Text("想法"), 35 | vsync: this, 36 | ), 37 | new NavigationIconView( 38 | icon: new Icon(Icons.add_shopping_cart), 39 | title: new Text("市场"), 40 | vsync: this, 41 | ), 42 | new NavigationIconView( 43 | icon: new Icon(Icons.add_alert), 44 | title: new Text("通知"), 45 | vsync: this, 46 | ), 47 | new NavigationIconView( 48 | icon: new Icon(Icons.perm_identity), 49 | title: new Text("我的"), 50 | vsync: this, 51 | ), 52 | ]; 53 | for (NavigationIconView view in _navigationViews) { 54 | view.controller.addListener(_rebuild); 55 | } 56 | 57 | _pageList = [ 58 | new HomePage(), 59 | new IdeaPage(), 60 | new MarketPage(), 61 | new NoticePage(), 62 | new MyPage() 63 | ]; 64 | _currentPage = _pageList[_currentIndex]; 65 | } 66 | 67 | void _rebuild() { 68 | setState((){}); 69 | } 70 | 71 | @override 72 | void dispose() { 73 | super.dispose(); 74 | for (NavigationIconView view in _navigationViews) { 75 | view.controller.dispose(); 76 | } 77 | } 78 | 79 | @override 80 | Widget build(BuildContext context) { 81 | final BottomNavigationBar bottomNavigationBar = new BottomNavigationBar( 82 | items: _navigationViews 83 | .map((NavigationIconView navigationIconView) => navigationIconView.item) 84 | .toList(), 85 | currentIndex: _currentIndex, 86 | fixedColor: Colors.blue, 87 | type: BottomNavigationBarType.fixed, 88 | onTap: (int index) { 89 | setState((){ 90 | _navigationViews[_currentIndex].controller.reverse(); 91 | _currentIndex = index; 92 | _navigationViews[_currentIndex].controller.forward(); 93 | _currentPage = _pageList[_currentIndex]; 94 | }); 95 | } 96 | ); 97 | 98 | return new MaterialApp( 99 | home: new Scaffold( 100 | body: new Center( 101 | child: _currentPage 102 | ), 103 | bottomNavigationBar: bottomNavigationBar, 104 | ), 105 | theme: GlobalConfig.themeData 106 | ); 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /lib/home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | import 'follow.dart'; 4 | import 'recommend.dart'; 5 | import 'hot.dart'; 6 | import 'search_page.dart'; 7 | import 'ask_page.dart'; 8 | import '../global_config.dart'; 9 | 10 | class HomePage extends StatefulWidget { 11 | 12 | @override 13 | _HomePageState createState() => new _HomePageState(); 14 | 15 | } 16 | 17 | class _HomePageState extends State { 18 | 19 | Widget barSearch() { 20 | return new Container( 21 | child: new Row( 22 | children: [ 23 | new Expanded( 24 | child: new FlatButton.icon( 25 | onPressed: (){ 26 | Navigator.of(context).push(new MaterialPageRoute( 27 | builder: (context) { 28 | return new SearchPage(); 29 | } 30 | )); 31 | }, 32 | icon: new Icon( 33 | Icons.search, 34 | color: GlobalConfig.fontColor, 35 | size: 16.0 36 | ), 37 | label: new Text( 38 | "坚果R1摄像头损坏", 39 | style: new TextStyle(color: GlobalConfig.fontColor), 40 | ), 41 | ) 42 | ), 43 | new Container( 44 | decoration: new BoxDecoration( 45 | border: new BorderDirectional( 46 | start: new BorderSide(color: GlobalConfig.fontColor, width: 1.0) 47 | ) 48 | ), 49 | height: 14.0, 50 | width: 1.0, 51 | ), 52 | new Container( 53 | child: new FlatButton.icon( 54 | onPressed: (){ 55 | Navigator.of(context).push(new MaterialPageRoute( 56 | builder: (context) { 57 | return new AskPage(); 58 | } 59 | )); 60 | }, 61 | icon: new Icon( 62 | Icons.border_color, 63 | color: GlobalConfig.fontColor, 64 | size: 14.0 65 | ), 66 | label: new Text( 67 | "提问", 68 | style: new TextStyle(color: GlobalConfig.fontColor), 69 | ), 70 | ) 71 | ) 72 | ], 73 | ), 74 | decoration: new BoxDecoration( 75 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 76 | color: GlobalConfig.searchBackgroundColor, 77 | ) 78 | ); 79 | } 80 | 81 | @override 82 | Widget build(BuildContext context) { 83 | return new DefaultTabController( 84 | length: 3, 85 | child: new Scaffold( 86 | appBar: new AppBar( 87 | title: barSearch(), 88 | bottom: new TabBar( 89 | labelColor: GlobalConfig.dark == true ? new Color(0xFF63FDD9) : Colors.blue, 90 | unselectedLabelColor: GlobalConfig.dark == true ? Colors.white : Colors.black, 91 | tabs: [ 92 | new Tab(text: "关注"), 93 | new Tab(text: "推荐"), 94 | new Tab(text: "热榜"), 95 | ], 96 | ), 97 | ), 98 | body: new TabBarView( 99 | children: [ 100 | new Follow(), 101 | new Recommend(), 102 | new Hot() 103 | ] 104 | ), 105 | ), 106 | ); 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/home/recommend.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'article.dart'; 3 | import 'reply_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class Recommend extends StatefulWidget { 7 | 8 | @override 9 | RecommendState createState() => new RecommendState(); 10 | 11 | } 12 | 13 | class RecommendState extends State { 14 | 15 | Widget commonCard(Article article) { 16 | Widget markWidget; 17 | if (article.imgUrl == null) { 18 | markWidget = new Text( 19 | article.user + " : " + article.mark, 20 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 21 | ); 22 | } else { 23 | markWidget = new Row( 24 | children: [ 25 | new Expanded( 26 | flex: 2, 27 | child: new Container( 28 | child: new Text( 29 | article.user + " : " + article.mark, 30 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 31 | ), 32 | ), 33 | ), 34 | new Expanded( 35 | flex: 1, 36 | child: new AspectRatio( 37 | aspectRatio: 3.0 / 2.0, 38 | child:new Container( 39 | foregroundDecoration:new BoxDecoration( 40 | image: new DecorationImage( 41 | image: new NetworkImage(article.imgUrl), 42 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 43 | ), 44 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 45 | ), 46 | ) 47 | ) 48 | ), 49 | ], 50 | ); 51 | } 52 | return new Container( 53 | color: GlobalConfig.cardBackgroundColor, 54 | margin: const EdgeInsets.only(top: 5.0, bottom: 5.0), 55 | child: new FlatButton( 56 | onPressed: (){ 57 | Navigator.of(context).push(new MaterialPageRoute( 58 | builder: (context) { 59 | return new ReplyPage(); 60 | } 61 | )); 62 | }, 63 | child: new Column( 64 | children: [ 65 | new Container( 66 | child: new Text( 67 | article.title, 68 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.3, color: GlobalConfig.dark == true? Colors.white70 : Colors.black) 69 | ), 70 | margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), 71 | alignment: Alignment.topLeft 72 | ), 73 | new Container( 74 | child: markWidget, 75 | margin: new EdgeInsets.only(top: 6.0, bottom: 14.0), 76 | alignment: Alignment.topLeft 77 | ), 78 | new Container( 79 | child: new Row( 80 | children: [ 81 | new Expanded( 82 | child: new Text(article.agreeNum.toString() + " 赞同 · " + article.commentNum.toString() + "评论", style: new TextStyle(color: GlobalConfig.fontColor)) 83 | ), 84 | new Icon(Icons.linear_scale, color: GlobalConfig.fontColor) 85 | ], 86 | ), 87 | padding: const EdgeInsets.only(bottom: 10.0), 88 | ) 89 | ], 90 | ), 91 | ) 92 | ); 93 | } 94 | 95 | @override 96 | Widget build(BuildContext context) { 97 | return new SingleChildScrollView( 98 | child: new Container( 99 | margin: const EdgeInsets.only(top: 5.0), 100 | child: new Column( 101 | children: [ 102 | commonCard(articleList[0]), 103 | commonCard(articleList[1]), 104 | ], 105 | ), 106 | ) 107 | ); 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /lib/home/hot.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'question.dart'; 3 | import 'question_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class Hot extends StatefulWidget{ 7 | 8 | @override 9 | HotState createState() => new HotState(); 10 | } 11 | 12 | class HotState extends State{ 13 | 14 | Widget hotCard(Question question) { 15 | return new Container( 16 | decoration: new BoxDecoration( 17 | color: GlobalConfig.cardBackgroundColor, 18 | border: new BorderDirectional( 19 | bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 20 | ) 21 | ), 22 | child: new FlatButton( 23 | onPressed: (){ 24 | Navigator.of(context).push(new MaterialPageRoute( 25 | builder: (context) { 26 | return new QuestionPage(); 27 | } 28 | )); 29 | }, 30 | child: new Container( 31 | padding: const EdgeInsets.only(top: 8.0, bottom: 8.0), 32 | child: new Row( 33 | children: [ 34 | new Expanded( 35 | flex: 1, 36 | child: new Column( 37 | children: [ 38 | new Container( 39 | child: new Text( 40 | question.order, 41 | style: new TextStyle( 42 | color: question.order.compareTo("03") <= 0 ? Colors.red : Colors.yellow, 43 | fontSize: 18.0 44 | ) 45 | ), 46 | alignment: Alignment.topLeft, 47 | ), 48 | question.rise != null ? 49 | new Row( 50 | children: [ 51 | new Icon(Icons.arrow_upward, color: Colors.red, size: 10.0,), 52 | new Text(question.rise, style: new TextStyle(color: Colors.red, fontSize: 10.0),) 53 | ], 54 | ) : new Container() 55 | ], 56 | ) 57 | ), 58 | new Expanded( 59 | flex: 6, 60 | child: new Column( 61 | children: [ 62 | new Container( 63 | child: new Text( 64 | question.title, 65 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.1, color: GlobalConfig.dark == true ? Colors.white70 : Colors.black), 66 | ), 67 | padding: const EdgeInsets.only(bottom: 10.0,right: 4.0), 68 | alignment: Alignment.topLeft, 69 | ), 70 | question.mark != null ? 71 | new Container( 72 | child: new Text(question.mark, style: new TextStyle(color: GlobalConfig.fontColor)), 73 | alignment: Alignment.topLeft, 74 | padding: const EdgeInsets.only(bottom: 8.0,right: 4.0) 75 | ) : new Container(), 76 | new Container( 77 | child: new Text(question.hotNum, style: new TextStyle(color: GlobalConfig.fontColor)), 78 | alignment: Alignment.topLeft, 79 | ) 80 | ], 81 | ) 82 | ), 83 | new Expanded( 84 | flex: 3, 85 | child: new AspectRatio( 86 | aspectRatio: 3.0 / 2.0, 87 | child: new Container( 88 | foregroundDecoration:new BoxDecoration( 89 | image: new DecorationImage( 90 | image: new NetworkImage(question.imgUrl), 91 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 92 | ), 93 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 94 | ), 95 | ) 96 | ) 97 | ) 98 | ], 99 | ), 100 | ) 101 | ), 102 | ); 103 | } 104 | 105 | @override 106 | Widget build(BuildContext context) { 107 | return new SingleChildScrollView( 108 | child: new Container( 109 | margin: const EdgeInsets.only(top: 5.0), 110 | child: new Column( 111 | children: [ 112 | new Container( 113 | margin: const EdgeInsets.only(top: 5.0), 114 | ), 115 | hotCard(questionList[0]), 116 | hotCard(questionList[1]), 117 | hotCard(questionList[2]), 118 | hotCard(questionList[3]), 119 | hotCard(questionList[4]), 120 | ], 121 | ), 122 | ) 123 | ); 124 | } 125 | } -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /lib/home/search_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class SearchPage extends StatefulWidget{ 5 | @override 6 | SearchPageState createState() => new SearchPageState(); 7 | } 8 | 9 | class SearchPageState extends State { 10 | 11 | Widget searchInput() { 12 | return new Container( 13 | child: new Row( 14 | children: [ 15 | new Container( 16 | child: new FlatButton.icon( 17 | onPressed: (){ 18 | Navigator.of(context).pop(); 19 | }, 20 | icon: new Icon(Icons.arrow_back, color: GlobalConfig.fontColor), 21 | label: new Text(""), 22 | ), 23 | width: 60.0, 24 | ), 25 | new Expanded( 26 | child: new TextField( 27 | autofocus: true, 28 | decoration: new InputDecoration.collapsed( 29 | hintText: "搜索比乎内容", 30 | hintStyle: new TextStyle(color: GlobalConfig.fontColor) 31 | ), 32 | ), 33 | ) 34 | ], 35 | ), 36 | decoration: new BoxDecoration( 37 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 38 | color: GlobalConfig.searchBackgroundColor 39 | ), 40 | ); 41 | } 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | return new MaterialApp( 46 | theme: GlobalConfig.themeData, 47 | home: new Scaffold( 48 | appBar: new AppBar( 49 | title: searchInput(), 50 | ), 51 | body: new SingleChildScrollView( 52 | child: new Column( 53 | children: [ 54 | new Container( 55 | child: new Text("比乎热搜", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0)), 56 | margin: const EdgeInsets.only(top: 16.0, left: 16.0, bottom: 16.0), 57 | alignment: Alignment.topLeft, 58 | ), 59 | new Row( 60 | children: [ 61 | new Container( 62 | child: new Chip( 63 | label: new FlatButton(onPressed: (){}, child: new Text("汽车关税下调",style: new TextStyle(color: GlobalConfig.fontColor),)), 64 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 65 | ), 66 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 67 | alignment: Alignment.topLeft, 68 | ), 69 | new Container( 70 | child: new Chip( 71 | label: new FlatButton(onPressed: (){}, child: new Text("李彦宏传闻辟谣",style: new TextStyle(color: GlobalConfig.fontColor))), 72 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 73 | ), 74 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 75 | alignment: Alignment.topLeft, 76 | ), 77 | ], 78 | ), 79 | new Row( 80 | children: [ 81 | new Container( 82 | child: new Chip( 83 | label: new FlatButton(onPressed: (){}, child: new Text("小米8",style: new TextStyle(color: GlobalConfig.fontColor))), 84 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 85 | ), 86 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 87 | alignment: Alignment.topLeft, 88 | ), 89 | new Container( 90 | child: new Chip( 91 | label: new FlatButton(onPressed: (){}, child: new Text("超时空同居",style: new TextStyle(color: GlobalConfig.fontColor))), 92 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 93 | ), 94 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 95 | alignment: Alignment.topLeft, 96 | ), 97 | ], 98 | ), 99 | new Container( 100 | child: new Text("搜索历史", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0)), 101 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 102 | alignment: Alignment.topLeft, 103 | ), 104 | new Container( 105 | child: new Row( 106 | children: [ 107 | new Container( 108 | child: new Icon(Icons.access_time, color: GlobalConfig.fontColor, size: 16.0), 109 | margin: const EdgeInsets.only(right: 12.0), 110 | ), 111 | new Expanded( 112 | child: new Container( 113 | child: new Text("业余兴趣", style: new TextStyle( color: GlobalConfig.fontColor, fontSize: 14.0),), 114 | ), 115 | ), 116 | new Container( 117 | child: new Icon(Icons.clear, color: GlobalConfig.fontColor, size: 16.0), 118 | ) 119 | ], 120 | ), 121 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0), 122 | padding: const EdgeInsets.only(bottom: 10.0), 123 | decoration: new BoxDecoration( 124 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 125 | ), 126 | ), 127 | new Container( 128 | child: new Row( 129 | children: [ 130 | new Container( 131 | child: new Icon(Icons.access_time, color: GlobalConfig.fontColor, size: 16.0), 132 | margin: const EdgeInsets.only(right: 12.0), 133 | ), 134 | new Expanded( 135 | child: new Container( 136 | child: new Text("三体", style: new TextStyle( color: GlobalConfig.fontColor, fontSize: 14.0),), 137 | ), 138 | ), 139 | new Container( 140 | child: new Icon(Icons.clear, color: GlobalConfig.fontColor, size: 16.0), 141 | ) 142 | ], 143 | ), 144 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0), 145 | padding: const EdgeInsets.only(bottom: 10.0), 146 | decoration: new BoxDecoration( 147 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 148 | ), 149 | ), 150 | new Container( 151 | child: new Row( 152 | children: [ 153 | new Container( 154 | child: new Icon(Icons.access_time, color: GlobalConfig.fontColor, size: 16.0), 155 | margin: const EdgeInsets.only(right: 12.0), 156 | ), 157 | new Expanded( 158 | child: new Container( 159 | child: new Text("人类未来", style: new TextStyle( color: GlobalConfig.fontColor, fontSize: 14.0),), 160 | ), 161 | ), 162 | new Container( 163 | child: new Icon(Icons.clear, color: GlobalConfig.fontColor, size: 16.0), 164 | ) 165 | ], 166 | ), 167 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0), 168 | padding: const EdgeInsets.only(bottom: 10.0), 169 | decoration: new BoxDecoration( 170 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 171 | ), 172 | ), 173 | ], 174 | ), 175 | ) 176 | ) 177 | ); 178 | } 179 | } -------------------------------------------------------------------------------- /lib/home/follow.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'article.dart'; 3 | import 'reply_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class Follow extends StatefulWidget { 7 | 8 | @override 9 | _FollowState createState() => new _FollowState(); 10 | 11 | } 12 | 13 | class _FollowState extends State { 14 | 15 | Widget wordsCard(Article article) { 16 | Widget markWidget; 17 | if (article.imgUrl == null) { 18 | markWidget = new Text( 19 | article.mark, 20 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 21 | ); 22 | } else { 23 | markWidget = new Row( 24 | children: [ 25 | new Expanded( 26 | flex: 2, 27 | child: new Container( 28 | child: new Text( 29 | article.mark, 30 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 31 | ), 32 | ), 33 | ), 34 | new Expanded( 35 | flex: 1, 36 | child: new AspectRatio( 37 | aspectRatio: 3.0 / 2.0, 38 | child: new Container( 39 | foregroundDecoration:new BoxDecoration( 40 | image: new DecorationImage( 41 | image: new NetworkImage(article.imgUrl), 42 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 43 | ), 44 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 45 | ), 46 | ) 47 | ) 48 | ), 49 | ], 50 | ); 51 | } 52 | return new Container( 53 | color: GlobalConfig.cardBackgroundColor, 54 | margin: const EdgeInsets.only(top: 5.0, bottom: 5.0), 55 | child: new FlatButton( 56 | onPressed: (){ 57 | Navigator.of(context).push(new MaterialPageRoute( 58 | builder: (context) { 59 | return new ReplyPage(); 60 | } 61 | )); 62 | }, 63 | child: new Column( 64 | children: [ 65 | new Container( 66 | child: new Row( 67 | children: [ 68 | new Container( 69 | child: new CircleAvatar( 70 | backgroundImage: new NetworkImage(article.headUrl), 71 | radius: 11.0 72 | ), 73 | ), 74 | new Text(" " + article.user + " " + article.action + " · " + article.time, style: new TextStyle(color: GlobalConfig.fontColor)) 75 | ], 76 | ), 77 | padding: const EdgeInsets.only(top: 10.0), 78 | ), 79 | new Container( 80 | child: new Text( 81 | article.title, 82 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.3, color: GlobalConfig.dark == true? Colors.white70 : Colors.black) 83 | ), 84 | margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), 85 | alignment: Alignment.topLeft 86 | ), 87 | new Container( 88 | child: markWidget, 89 | margin: new EdgeInsets.only(top: 6.0), 90 | alignment: Alignment.topLeft 91 | ), 92 | new Container( 93 | child: new Row( 94 | children: [ 95 | new Expanded( 96 | child: new Text(article.agreeNum.toString() + " 赞同 · " + article.commentNum.toString() + "评论", style: new TextStyle(color: GlobalConfig.fontColor)) 97 | ), 98 | new PopupMenuButton( 99 | icon: new Icon(Icons.linear_scale, color: GlobalConfig.fontColor,), 100 | itemBuilder: (BuildContext context) => >[ 101 | new PopupMenuItem( 102 | value: '选项一的值', 103 | child: new Text('屏蔽这个问题') 104 | ), 105 | new PopupMenuItem( 106 | value: '选项二的值', 107 | child: new Text('取消关注 learner') 108 | ), 109 | new PopupMenuItem( 110 | value: '选项二的值', 111 | child: new Text("举报") 112 | ) 113 | ] 114 | ) 115 | ], 116 | ), 117 | padding: const EdgeInsets.only(), 118 | ) 119 | ], 120 | ), 121 | ) 122 | ); 123 | } 124 | 125 | Widget billboard() { 126 | return new Container( 127 | margin: const EdgeInsets.only(top: 5.0, bottom: 5.0), 128 | color: GlobalConfig.cardBackgroundColor, 129 | child: new FlatButton( 130 | onPressed: (){}, 131 | child: new Column( 132 | children: [ 133 | new Container( 134 | child: new Row( 135 | children: [ 136 | new Container( 137 | child: new CircleAvatar( 138 | backgroundImage: new NetworkImage("https://pic1.zhimg.com/50/v2-0c9de2012cc4c5e8b01657d96da35534_s.jpg"), 139 | radius: 11.0 140 | ), 141 | ), 142 | new Text(" 对啊网", style: new TextStyle(color: GlobalConfig.fontColor)) 143 | ], 144 | ), 145 | padding: const EdgeInsets.only(top: 10.0), 146 | ), 147 | new Container( 148 | child: new Text( 149 | "考过CPA,非名牌大学也能进名企", 150 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.3, color: GlobalConfig.dark == true? Colors.white70 : Colors.black) 151 | ), 152 | margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), 153 | alignment: Alignment.topLeft 154 | ), 155 | new Container( 156 | child: new AspectRatio( 157 | aspectRatio: 3.0 / 1.0, 158 | child:new Container( 159 | foregroundDecoration:new BoxDecoration( 160 | image: new DecorationImage( 161 | image: new NetworkImage("https://pic2.zhimg.com/50/v2-6416ef6d3181117a0177275286fac8f3_hd.jpg"), 162 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 163 | ), 164 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 165 | ), 166 | ) 167 | ), 168 | margin: new EdgeInsets.only(top: 6.0, bottom: 14.0), 169 | alignment: Alignment.topLeft 170 | ), 171 | new Container( 172 | child: new Text( 173 | "还在羡慕别人的好工作?免费领取价值1980元的注册会计师课程,为自己充电!", 174 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 175 | ), 176 | padding: const EdgeInsets.only(bottom: 8.0) 177 | ), 178 | 179 | new Container( 180 | child: new Row( 181 | children: [ 182 | new Container( 183 | child: new Text("广告", style: new TextStyle(fontSize: 10.0, color: GlobalConfig.fontColor)), 184 | decoration: new BoxDecoration( 185 | border: new Border.all(color: GlobalConfig.fontColor), 186 | borderRadius: new BorderRadius.all(const Radius.circular(2.0)), 187 | ), 188 | padding: const EdgeInsets.only(top: 2.0, bottom: 2.0, left: 3.0, right: 3.0) 189 | ), 190 | new Expanded( 191 | child: new Text(" 查看详情", style: new TextStyle(color: GlobalConfig.fontColor)) 192 | ), 193 | new Icon(Icons.clear, color: GlobalConfig.fontColor) 194 | ], 195 | ), 196 | padding: const EdgeInsets.only(bottom: 10.0), 197 | ) 198 | ], 199 | ), 200 | ) 201 | ); 202 | } 203 | 204 | @override 205 | Widget build(BuildContext context) { 206 | return new SingleChildScrollView( 207 | child: new Container( 208 | margin: const EdgeInsets.only(top: 5.0), 209 | child: new Column( 210 | children: [ 211 | wordsCard(articleList[0]), 212 | wordsCard(articleList[1]), 213 | wordsCard(articleList[2]), 214 | billboard(), 215 | wordsCard(articleList[3]) 216 | ], 217 | ), 218 | ) 219 | ); 220 | } 221 | } -------------------------------------------------------------------------------- /lib/home/question_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | import 'reply_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class QuestionPage extends StatefulWidget { 7 | @override 8 | QuestionPageState createState() => new QuestionPageState(); 9 | 10 | } 11 | 12 | class QuestionPageState extends State { 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return new MaterialApp( 17 | theme: GlobalConfig.themeData, 18 | home: new Scaffold( 19 | appBar: new AppBar( 20 | title: Common.searchInput(context) 21 | ), 22 | body: new SingleChildScrollView( 23 | child: new Column( 24 | children: [ 25 | new Container( 26 | child: new Row( 27 | children: [ 28 | new Container( 29 | child: new FlatButton(onPressed: (){}, child: new Text("物理学"), color: GlobalConfig.searchBackgroundColor), 30 | height: 30.0, 31 | margin: const EdgeInsets.only(right: 8.0) 32 | ), 33 | new Container( 34 | child: new FlatButton(onPressed: (){}, child: new Text("三体(书籍)"), color: GlobalConfig.searchBackgroundColor), 35 | height: 30.0, 36 | margin: const EdgeInsets.only(right: 8.0) 37 | ), 38 | new Container( 39 | child: new FlatButton(onPressed: (){}, child: new Text("脑洞(网络用语)"), color: GlobalConfig.searchBackgroundColor), 40 | height: 30.0, 41 | ) 42 | ], 43 | ), 44 | padding: new EdgeInsets.only(left: 16.0, top: 8.0, bottom: 8.0, right: 16.0), 45 | color: GlobalConfig.cardBackgroundColor, 46 | ), 47 | new Container( 48 | child: new Text("《三体》里的水滴有可能被制造出来吗?", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, height: 1.3, color: GlobalConfig.dark == true ? Colors.white70 : Colors.black)), 49 | padding: new EdgeInsets.only(left: 16.0, bottom: 8.0, right: 16.0), 50 | alignment: Alignment.topLeft, 51 | color: GlobalConfig.cardBackgroundColor 52 | ), 53 | new Container( 54 | child: new Text( 55 | "如果,仅考虑其延长强相互作用力的特性,而不考虑其直角转弯的特性,那么水滴能被制造出来吗?换句话说,强相互作用力能够以影响微观物理量的方式延长吗?", 56 | style: new TextStyle(height: 1.4, fontSize: 16.0, color: GlobalConfig.fontColor), textAlign: TextAlign.start 57 | ), 58 | padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 8.0), 59 | decoration: new BoxDecoration( 60 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)), 61 | color: GlobalConfig.cardBackgroundColor 62 | ), 63 | ), 64 | new Container( 65 | child: new Row( 66 | children: [ 67 | new Expanded( 68 | flex: 1, 69 | child: new Container( 70 | child: new FlatButton.icon( 71 | onPressed: (){}, 72 | icon: new Icon(Icons.group_add), 73 | label: new Text("邀请回答"), 74 | textTheme: ButtonTextTheme.accent, 75 | ), 76 | decoration: new BoxDecoration( 77 | border: new BorderDirectional(end: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 78 | ), 79 | ), 80 | ), 81 | new Expanded( 82 | flex: 1, 83 | child: new Container( 84 | child: new FlatButton.icon( 85 | onPressed: (){}, 86 | icon: new Icon(Icons.brush), 87 | label: new Text("写回答"), 88 | textTheme: ButtonTextTheme.accent, 89 | ), 90 | decoration: new BoxDecoration( 91 | border: new BorderDirectional(end: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 92 | ), 93 | ), 94 | ), 95 | ], 96 | ), 97 | decoration: new BoxDecoration( 98 | color: GlobalConfig.cardBackgroundColor 99 | ), 100 | ), 101 | new Container( 102 | margin: const EdgeInsets.only(top: 4.0, bottom: 4.0), 103 | child: new Row( 104 | children: [ 105 | new Expanded( 106 | child: new Container( 107 | child: new Text("173个回答", style: new TextStyle(color: GlobalConfig.fontColor)), 108 | margin: const EdgeInsets.only(left: 16.0), 109 | ), 110 | ), 111 | new Expanded( 112 | child: new Container( 113 | child: new PopupMenuButton( 114 | itemBuilder: (BuildContext context) => >[ 115 | new PopupMenuItem( 116 | value: '质量', 117 | child: new Container( 118 | child: new Row( 119 | children: [ 120 | new Text('按质量排序'), 121 | new Icon(Icons.check, color: Colors.blue,) 122 | ], 123 | ), 124 | ) 125 | ), 126 | new PopupMenuItem( 127 | value: '时间', 128 | child: new Text('按时间排序') 129 | ) 130 | ], 131 | child: new Container( 132 | child: new Row( 133 | mainAxisAlignment: MainAxisAlignment.end, 134 | children: [ 135 | new Text("按质量排序", style: new TextStyle(color: GlobalConfig.fontColor)), 136 | new Icon(Icons.keyboard_arrow_down, color: GlobalConfig.fontColor) 137 | ], 138 | ), 139 | ), 140 | ), 141 | alignment: Alignment.centerRight, 142 | ), 143 | ), 144 | ], 145 | ), 146 | ), 147 | new Container( 148 | color: GlobalConfig.cardBackgroundColor, 149 | margin: const EdgeInsets.only(bottom: 5.0), 150 | child: new FlatButton( 151 | onPressed: (){ 152 | Navigator.of(context).push(new MaterialPageRoute( 153 | builder: (context) { 154 | return new ReplyPage(); 155 | } 156 | )); 157 | }, 158 | child: new Column( 159 | children: [ 160 | new Container( 161 | child: new Row( 162 | children: [ 163 | new Container( 164 | child: new CircleAvatar( 165 | backgroundImage: new NetworkImage("https://pic3.zhimg.com/fc4c1cb34c2901a1a8c05488bbd76fa2_xs.jpg"), 166 | radius: 11.0 167 | ), 168 | ), 169 | new Text(" 游牧由", style: new TextStyle(color: GlobalConfig.fontColor)) 170 | ], 171 | ), 172 | padding: const EdgeInsets.only(top: 10.0), 173 | ), 174 | new Container( 175 | child: new Text( 176 | "第一,几年前我跟一个985211级别大学的物理类学科教授聊过这个问题。他很严肃的表示,使用强互作用力为工具在原子角度加工出这种水平的材料,对人类目前的物理...", 177 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 178 | ), 179 | margin: new EdgeInsets.only(top: 6.0, bottom: 14.0), 180 | alignment: Alignment.topLeft 181 | ), 182 | new Container( 183 | child: new Row( 184 | children: [ 185 | new Expanded( 186 | child: new Text("1K 赞同 · 262 评论 · 10 天前", style: new TextStyle(color: GlobalConfig.fontColor)) 187 | ) 188 | ], 189 | ), 190 | padding: const EdgeInsets.only(bottom: 10.0), 191 | ) 192 | ], 193 | ), 194 | ) 195 | ) 196 | ], 197 | ), 198 | ) 199 | ) 200 | ); 201 | } 202 | 203 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.31.2-alpha.2" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.4.3" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.0.7" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.1" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.6" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.0.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.0.3" 60 | csslib: 61 | dependency: transitive 62 | description: 63 | name: csslib 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.14.4" 67 | cupertino_icons: 68 | dependency: "direct main" 69 | description: 70 | name: cupertino_icons 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.1.2" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_test: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | front_end: 85 | dependency: transitive 86 | description: 87 | name: front_end 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.1.0-alpha.12" 91 | glob: 92 | dependency: transitive 93 | description: 94 | name: glob 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.1.5" 98 | html: 99 | dependency: transitive 100 | description: 101 | name: html 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.13.3" 105 | http: 106 | dependency: transitive 107 | description: 108 | name: http 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.11.3+16" 112 | http_multi_server: 113 | dependency: transitive 114 | description: 115 | name: http_multi_server 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "2.0.4" 119 | http_parser: 120 | dependency: transitive 121 | description: 122 | name: http_parser 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "3.1.2" 126 | io: 127 | dependency: transitive 128 | description: 129 | name: io 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.3.2+1" 133 | js: 134 | dependency: transitive 135 | description: 136 | name: js 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "0.6.1" 140 | kernel: 141 | dependency: transitive 142 | description: 143 | name: kernel 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.3.0-alpha.12" 147 | logging: 148 | dependency: transitive 149 | description: 150 | name: logging 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.11.3+1" 154 | matcher: 155 | dependency: transitive 156 | description: 157 | name: matcher 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.12.2+1" 161 | meta: 162 | dependency: transitive 163 | description: 164 | name: meta 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "1.1.5" 168 | mime: 169 | dependency: transitive 170 | description: 171 | name: mime 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "0.9.6" 175 | multi_server_socket: 176 | dependency: transitive 177 | description: 178 | name: multi_server_socket 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "1.0.1" 182 | node_preamble: 183 | dependency: transitive 184 | description: 185 | name: node_preamble 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.4.1" 189 | package_config: 190 | dependency: transitive 191 | description: 192 | name: package_config 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.0.3" 196 | package_resolver: 197 | dependency: transitive 198 | description: 199 | name: package_resolver 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.0.2" 203 | path: 204 | dependency: transitive 205 | description: 206 | name: path 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.5.1" 210 | plugin: 211 | dependency: transitive 212 | description: 213 | name: plugin 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "0.2.0+2" 217 | pool: 218 | dependency: transitive 219 | description: 220 | name: pool 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "1.3.4" 224 | pub_semver: 225 | dependency: transitive 226 | description: 227 | name: pub_semver 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.4.1" 231 | quiver: 232 | dependency: transitive 233 | description: 234 | name: quiver 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "0.29.0+1" 238 | shelf: 239 | dependency: transitive 240 | description: 241 | name: shelf 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "0.7.3" 245 | shelf_packages_handler: 246 | dependency: transitive 247 | description: 248 | name: shelf_packages_handler 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "1.0.3" 252 | shelf_static: 253 | dependency: transitive 254 | description: 255 | name: shelf_static 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "0.2.7" 259 | shelf_web_socket: 260 | dependency: transitive 261 | description: 262 | name: shelf_web_socket 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "0.2.2" 266 | sky_engine: 267 | dependency: transitive 268 | description: flutter 269 | source: sdk 270 | version: "0.0.99" 271 | source_map_stack_trace: 272 | dependency: transitive 273 | description: 274 | name: source_map_stack_trace 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "1.1.4" 278 | source_maps: 279 | dependency: transitive 280 | description: 281 | name: source_maps 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "0.10.5" 285 | source_span: 286 | dependency: transitive 287 | description: 288 | name: source_span 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "1.4.0" 292 | stack_trace: 293 | dependency: transitive 294 | description: 295 | name: stack_trace 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.9.2" 299 | stream_channel: 300 | dependency: transitive 301 | description: 302 | name: stream_channel 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.6.6" 306 | string_scanner: 307 | dependency: transitive 308 | description: 309 | name: string_scanner 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.0.2" 313 | term_glyph: 314 | dependency: transitive 315 | description: 316 | name: term_glyph 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.0.0" 320 | test: 321 | dependency: transitive 322 | description: 323 | name: test 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "0.12.37" 327 | typed_data: 328 | dependency: transitive 329 | description: 330 | name: typed_data 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.1.5" 334 | utf: 335 | dependency: transitive 336 | description: 337 | name: utf 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "0.9.0+4" 341 | vector_math: 342 | dependency: transitive 343 | description: 344 | name: vector_math 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "2.0.6" 348 | watcher: 349 | dependency: transitive 350 | description: 351 | name: watcher 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "0.9.7+7" 355 | web_socket_channel: 356 | dependency: transitive 357 | description: 358 | name: web_socket_channel 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "1.0.7" 362 | yaml: 363 | dependency: transitive 364 | description: 365 | name: yaml 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "2.1.13" 369 | sdks: 370 | dart: ">=2.0.0-dev.52.0 <=2.0.0-dev.54.0.flutter-46ab040e58" 371 | -------------------------------------------------------------------------------- /lib/home/reply_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | import 'question_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class Common { 7 | static Widget searchInput(BuildContext context) { 8 | return new Container( 9 | child: new Row( 10 | children: [ 11 | new Container( 12 | child: new FlatButton.icon( 13 | onPressed: (){ 14 | Navigator.of(context).pop(); 15 | }, 16 | icon: new Icon(Icons.arrow_back, color: GlobalConfig.fontColor), 17 | label: new Text(""), 18 | ), 19 | width: 60.0, 20 | ), 21 | new Expanded( 22 | child: new TextField( 23 | decoration: new InputDecoration.collapsed( 24 | hintText: "搜索比乎内容", 25 | hintStyle: new TextStyle(color: GlobalConfig.fontColor) 26 | ), 27 | ), 28 | ), 29 | new Container( 30 | child: new IconButton(icon: new Icon(Icons.share, color: GlobalConfig.fontColor), onPressed: (){}, padding: const EdgeInsets.all(0.0), iconSize: 18.0), 31 | ), 32 | new Container( 33 | child: new IconButton(icon: new Icon(Icons.list, color: GlobalConfig.fontColor), onPressed: (){}, padding: const EdgeInsets.all(0.0), iconSize: 18.0), 34 | ), 35 | ], 36 | ), 37 | decoration: new BoxDecoration( 38 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 39 | color: GlobalConfig.searchBackgroundColor, 40 | ), 41 | height: 36.0, 42 | //padding: new EdgeInsets.only(top:8.0, bottom: 8.0, left: 8.0, right: 8.0), 43 | ); 44 | } 45 | } 46 | 47 | class ReplyPage extends StatefulWidget { 48 | 49 | @override 50 | ReplyPageState createState() => new ReplyPageState(); 51 | } 52 | 53 | class ReplyPageState extends State { 54 | 55 | @override 56 | Widget build(BuildContext context) { 57 | return new MaterialApp( 58 | theme: GlobalConfig.themeData, 59 | home: new Scaffold( 60 | appBar: new AppBar( 61 | title: Common.searchInput(context) 62 | ), 63 | body: new SingleChildScrollView( 64 | child: new Column( 65 | children: [ 66 | new Container( 67 | child: new FlatButton( 68 | onPressed: (){ 69 | Navigator.of(context).push(new MaterialPageRoute( 70 | builder: (context) { 71 | return new QuestionPage(); 72 | } 73 | )); 74 | }, 75 | child: new Container( 76 | child: new Text("你认为《三体》中最牛的文明是?", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, height: 1.3, color: GlobalConfig.dark == true? Colors.white70 : Colors.black)), 77 | padding: const EdgeInsets.all(16.0), 78 | alignment: Alignment.topLeft, 79 | ), 80 | color: GlobalConfig.cardBackgroundColor, 81 | ), 82 | decoration: new BoxDecoration( 83 | border: new BorderDirectional(bottom: new BorderSide(color: Colors.white10)) 84 | ), 85 | ), 86 | new Container( 87 | child: new Row( 88 | children: [ 89 | new Expanded( 90 | flex: 1, 91 | child: new Container( 92 | child: new FlatButton.icon( 93 | onPressed: (){}, 94 | icon: new Icon(Icons.brush), 95 | label: new Text("写回答"), 96 | textTheme: ButtonTextTheme.accent, 97 | ), 98 | decoration: new BoxDecoration( 99 | border: new BorderDirectional(end: new BorderSide(color: Colors.white10)) 100 | ), 101 | ), 102 | ), 103 | new Expanded( 104 | flex: 1, 105 | child: new Container( 106 | child: new FlatButton( 107 | onPressed: (){ 108 | Navigator.of(context).push(new MaterialPageRoute( 109 | builder: (context) { 110 | return new QuestionPage(); 111 | } 112 | )); 113 | }, 114 | child: new Text("查看全部10000个回答 > "), 115 | ), 116 | ), 117 | ) 118 | ], 119 | ), 120 | decoration: new BoxDecoration( 121 | color: GlobalConfig.cardBackgroundColor, 122 | ), 123 | margin: new EdgeInsets.only(bottom: 10.0) 124 | ), 125 | new Container( 126 | child: new ListTile( 127 | leading: new CircleAvatar( 128 | backgroundImage: new NetworkImage("https://pic3.zhimg.com/v2-cd467bb9bb31d0384f065cf0bd677930_xl.jpg"), 129 | radius: 20.0 130 | ), 131 | title: new Text("Flutter"), 132 | subtitle: new Text("人生如逆旅,我亦是行人"), 133 | trailing: new RaisedButton.icon(onPressed: (){}, icon: new Icon(Icons.add, color: Colors.white), label: new Text("关注", style: new TextStyle(color: Colors.white),), color: Colors.blue,) 134 | ), 135 | decoration: new BoxDecoration( 136 | color: GlobalConfig.cardBackgroundColor, 137 | border: new BorderDirectional(bottom: new BorderSide(color: Colors.white10)) 138 | ), 139 | ), 140 | new Container( 141 | child: new Text( 142 | "回归运动\n\n三体定义的黑暗森林的宇宙格局,就是文明相互攻击和毁灭,越高级的,越明白藏好自己做好清理,绝不做探测对方文明的愚蠢行为。\n\n然而归还运动跳出了这个黑暗森林法则,不玩黑暗森林打击,不但探测别的宇宙文明,而且还深入了解对方文明,而且是全宇宙的所有文明。\n\n这是一种多么自信的科技实力呀,才能跳出黑暗森林的生存法则呀", 143 | style: new TextStyle(height: 1.4, fontSize: 16.0, color: GlobalConfig.fontColor), textAlign: TextAlign.start 144 | ), 145 | margin: const EdgeInsets.all(16.0), 146 | ) 147 | ], 148 | ), 149 | ), 150 | bottomNavigationBar: new BottomAppBar( 151 | child: new Container( 152 | height: 50.0, 153 | child: new Row( 154 | children: [ 155 | new Container( 156 | child: new FlatButton.icon(onPressed: (){}, label: new Text("赞同 10 K"), color: GlobalConfig.searchBackgroundColor, icon: new Icon(Icons.arrow_drop_up),), 157 | margin: new EdgeInsets.only(left: 16.0), 158 | height: 30.0, 159 | ), 160 | new Container( 161 | child: new IconButton(onPressed: (){}, icon: new Icon(Icons.arrow_drop_down),padding: const EdgeInsets.all(0.0)), 162 | margin: new EdgeInsets.only(left: 8.0), 163 | height: 30.0, 164 | decoration: new BoxDecoration( 165 | borderRadius: const BorderRadius.all(const Radius.circular(2.0)), 166 | color: GlobalConfig.searchBackgroundColor, 167 | ), 168 | ), 169 | new Expanded( 170 | child: new Row( 171 | mainAxisAlignment: MainAxisAlignment.center, 172 | children: [ 173 | new IconButton( 174 | onPressed: (){ print("icon");}, 175 | icon: new Container( 176 | child: new Column( 177 | children: [ 178 | new Icon(Icons.favorite, size: 18.0, color: GlobalConfig.fontColor,), 179 | new Text("感谢", style: new TextStyle(fontSize: 10.0, color: GlobalConfig.fontColor),) 180 | ], 181 | ), 182 | margin: const EdgeInsets.only(), 183 | height: 30.0, 184 | ) 185 | ), 186 | new IconButton( 187 | onPressed: (){ print("icon");}, 188 | icon: new Container( 189 | child: new Column( 190 | children: [ 191 | new Icon(Icons.star, size: 18.0, color: GlobalConfig.fontColor,), 192 | new Text("收藏", style: new TextStyle(fontSize: 10.0, color: GlobalConfig.fontColor),) 193 | ], 194 | ), 195 | margin: const EdgeInsets.only(), 196 | height: 30.0, 197 | ) 198 | ), 199 | new IconButton( 200 | onPressed: (){ print("icon");}, 201 | icon: new Container( 202 | child: new Column( 203 | children: [ 204 | new Icon(Icons.mode_comment, size: 18.0, color: GlobalConfig.fontColor,), 205 | new Text("345", style: new TextStyle(fontSize: 10.0, color: GlobalConfig.fontColor),) 206 | ], 207 | ), 208 | margin: const EdgeInsets.only(), 209 | height: 30.0, 210 | ) 211 | ), 212 | ], 213 | ) 214 | ) 215 | ], 216 | ), 217 | color: GlobalConfig.cardBackgroundColor, 218 | ) 219 | ), 220 | ) 221 | ); 222 | } 223 | 224 | } -------------------------------------------------------------------------------- /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 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 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 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | /* End PBXFrameworksBuildPhase section */ 72 | 73 | /* Begin PBXGroup section */ 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 78 | 3B80C3931E831B6300D905FE /* App.framework */, 79 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 80 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 81 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 82 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 83 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 84 | ); 85 | name = Flutter; 86 | sourceTree = ""; 87 | }; 88 | 97C146E51CF9000F007C117D = { 89 | isa = PBXGroup; 90 | children = ( 91 | 9740EEB11CF90186004384FC /* Flutter */, 92 | 97C146F01CF9000F007C117D /* Runner */, 93 | 97C146EF1CF9000F007C117D /* Products */, 94 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 97C146EF1CF9000F007C117D /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146EE1CF9000F007C117D /* Runner.app */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 97C146F01CF9000F007C117D /* Runner */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 110 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 111 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 112 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 113 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 114 | 97C147021CF9000F007C117D /* Info.plist */, 115 | 97C146F11CF9000F007C117D /* Supporting Files */, 116 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 117 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 118 | ); 119 | path = Runner; 120 | sourceTree = ""; 121 | }; 122 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 97C146F21CF9000F007C117D /* main.m */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 97C146ED1CF9000F007C117D /* Runner */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 136 | buildPhases = ( 137 | 9740EEB61CF901F6004384FC /* Run Script */, 138 | 97C146EA1CF9000F007C117D /* Sources */, 139 | 97C146EB1CF9000F007C117D /* Frameworks */, 140 | 97C146EC1CF9000F007C117D /* Resources */, 141 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 142 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = Runner; 149 | productName = Runner; 150 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | /* End PBXNativeTarget section */ 154 | 155 | /* Begin PBXProject section */ 156 | 97C146E61CF9000F007C117D /* Project object */ = { 157 | isa = PBXProject; 158 | attributes = { 159 | LastUpgradeCheck = 0910; 160 | ORGANIZATIONNAME = "The Chromium Authors"; 161 | TargetAttributes = { 162 | 97C146ED1CF9000F007C117D = { 163 | CreatedOnToolsVersion = 7.3.1; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 3.2"; 169 | developmentRegion = English; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 194 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 195 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 196 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | /* End PBXResourcesBuildPhase section */ 201 | 202 | /* Begin PBXShellScriptBuildPhase section */ 203 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 204 | isa = PBXShellScriptBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | inputPaths = ( 209 | ); 210 | name = "Thin Binary"; 211 | outputPaths = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | shellPath = /bin/sh; 215 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 216 | }; 217 | 9740EEB61CF901F6004384FC /* Run Script */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputPaths = ( 223 | ); 224 | name = "Run Script"; 225 | outputPaths = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | shellPath = /bin/sh; 229 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 230 | }; 231 | /* End PBXShellScriptBuildPhase section */ 232 | 233 | /* Begin PBXSourcesBuildPhase section */ 234 | 97C146EA1CF9000F007C117D /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 239 | 97C146F31CF9000F007C117D /* main.m in Sources */, 240 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | /* End PBXSourcesBuildPhase section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 97C146FB1CF9000F007C117D /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 97C147001CF9000F007C117D /* Base */, 259 | ); 260 | name = LaunchScreen.storyboard; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 97C147031CF9000F007C117D /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 269 | buildSettings = { 270 | ALWAYS_SEARCH_USER_PATHS = NO; 271 | CLANG_ANALYZER_NONNULL = YES; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_COMMA = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 281 | CLANG_WARN_EMPTY_BODY = YES; 282 | CLANG_WARN_ENUM_CONVERSION = YES; 283 | CLANG_WARN_INFINITE_RECURSION = YES; 284 | CLANG_WARN_INT_CONVERSION = YES; 285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 286 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 289 | CLANG_WARN_STRICT_PROTOTYPES = YES; 290 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 291 | CLANG_WARN_UNREACHABLE_CODE = YES; 292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 294 | COPY_PHASE_STRIP = NO; 295 | DEBUG_INFORMATION_FORMAT = dwarf; 296 | ENABLE_STRICT_OBJC_MSGSEND = YES; 297 | ENABLE_TESTABILITY = YES; 298 | GCC_C_LANGUAGE_STANDARD = gnu99; 299 | GCC_DYNAMIC_NO_PIC = NO; 300 | GCC_NO_COMMON_BLOCKS = YES; 301 | GCC_OPTIMIZATION_LEVEL = 0; 302 | GCC_PREPROCESSOR_DEFINITIONS = ( 303 | "DEBUG=1", 304 | "$(inherited)", 305 | ); 306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 308 | GCC_WARN_UNDECLARED_SELECTOR = YES; 309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 310 | GCC_WARN_UNUSED_FUNCTION = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 313 | MTL_ENABLE_DEBUG_INFO = YES; 314 | ONLY_ACTIVE_ARCH = YES; 315 | SDKROOT = iphoneos; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | 97C147041CF9000F007C117D /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 97C147061CF9000F007C117D /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 371 | buildSettings = { 372 | ARCHS = arm64; 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | ENABLE_BITCODE = NO; 375 | FRAMEWORK_SEARCH_PATHS = ( 376 | "$(inherited)", 377 | "$(PROJECT_DIR)/Flutter", 378 | ); 379 | INFOPLIST_FILE = Runner/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 381 | LIBRARY_SEARCH_PATHS = ( 382 | "$(inherited)", 383 | "$(PROJECT_DIR)/Flutter", 384 | ); 385 | PRODUCT_BUNDLE_IDENTIFIER = cn.edu.jnxy.zhihu; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | }; 388 | name = Debug; 389 | }; 390 | 97C147071CF9000F007C117D /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 393 | buildSettings = { 394 | ARCHS = arm64; 395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 396 | ENABLE_BITCODE = NO; 397 | FRAMEWORK_SEARCH_PATHS = ( 398 | "$(inherited)", 399 | "$(PROJECT_DIR)/Flutter", 400 | ); 401 | INFOPLIST_FILE = Runner/Info.plist; 402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 403 | LIBRARY_SEARCH_PATHS = ( 404 | "$(inherited)", 405 | "$(PROJECT_DIR)/Flutter", 406 | ); 407 | PRODUCT_BUNDLE_IDENTIFIER = cn.edu.jnxy.zhihu; 408 | PRODUCT_NAME = "$(TARGET_NAME)"; 409 | }; 410 | name = Release; 411 | }; 412 | /* End XCBuildConfiguration section */ 413 | 414 | /* Begin XCConfigurationList section */ 415 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | 97C147031CF9000F007C117D /* Debug */, 419 | 97C147041CF9000F007C117D /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | 97C147061CF9000F007C117D /* Debug */, 428 | 97C147071CF9000F007C117D /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | /* End XCConfigurationList section */ 434 | }; 435 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 436 | } 437 | -------------------------------------------------------------------------------- /lib/my/my_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | import '../home/search_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class MyPage extends StatefulWidget { 7 | 8 | @override 9 | _MyPageState createState() => new _MyPageState(); 10 | 11 | } 12 | 13 | class _MyPageState extends State { 14 | 15 | Widget barSearch() { 16 | return new Container( 17 | child: new FlatButton( 18 | onPressed: (){ 19 | Navigator.of(context).push(new MaterialPageRoute( 20 | builder: (context) { 21 | return new SearchPage(); 22 | } 23 | )); 24 | }, 25 | child: new Row( 26 | children: [ 27 | new Container( 28 | child: new Icon(Icons.search, size: 18.0,), 29 | margin: const EdgeInsets.only(right: 26.0), 30 | ), 31 | new Expanded( 32 | child: new Container( 33 | child: new Text("搜索知乎内容"), 34 | ) 35 | ), 36 | new Container( 37 | child: new FlatButton( 38 | onPressed: (){}, 39 | child: new Icon(Icons.settings_overscan, size: 18.0), 40 | ), 41 | width: 40.0, 42 | ), 43 | ], 44 | ) 45 | ), 46 | decoration: new BoxDecoration( 47 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 48 | color: GlobalConfig.searchBackgroundColor 49 | ) 50 | ); 51 | } 52 | 53 | Widget myInfoCard() { 54 | return new Container( 55 | color: GlobalConfig.cardBackgroundColor, 56 | margin: const EdgeInsets.only(top: 10.0, bottom: 6.0), 57 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 58 | child: new Column( 59 | children: [ 60 | new Container( 61 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0), 62 | decoration: new BoxDecoration( 63 | color: GlobalConfig.dark == true ? Colors.white10 : new Color(0xFFF5F5F5), 64 | borderRadius: new BorderRadius.all(new Radius.circular(6.0)) 65 | ), 66 | child: new FlatButton( 67 | onPressed: (){}, 68 | child: new Container( 69 | child: new ListTile( 70 | leading: new Container( 71 | child: new CircleAvatar( 72 | backgroundImage: new NetworkImage("https://pic1.zhimg.com/v2-ec7ed574da66e1b495fcad2cc3d71cb9_xl.jpg"), 73 | radius: 20.0 74 | ), 75 | ), 76 | title: new Container( 77 | margin: const EdgeInsets.only(bottom: 2.0), 78 | child: new Text("learner"), 79 | ), 80 | subtitle: new Container( 81 | margin: const EdgeInsets.only(top: 2.0), 82 | child: new Text("查看或编辑个人主页"), 83 | ), 84 | ), 85 | ) 86 | ), 87 | ), 88 | new Container( 89 | child: new Row( 90 | mainAxisAlignment: MainAxisAlignment.center, 91 | children: [ 92 | new Container( 93 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 94 | child: new FlatButton ( 95 | onPressed: (){}, 96 | child: new Container( 97 | height: 50.0, 98 | child: new Column( 99 | children: [ 100 | new Container( 101 | child: new Text("57", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 102 | ), 103 | new Container( 104 | child: new Text("我的创作", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 105 | ), 106 | ], 107 | ), 108 | ) 109 | ), 110 | ), 111 | new Container( 112 | height: 14.0, 113 | width: 1.0, 114 | decoration: new BoxDecoration( 115 | border: new BorderDirectional( 116 | start: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 117 | ) 118 | ), 119 | ), 120 | new Container( 121 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 122 | child: new FlatButton( 123 | onPressed: (){}, 124 | child: new Container( 125 | height: 50.0, 126 | child: new Column( 127 | children: [ 128 | new Container( 129 | child: new Text("210", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 130 | ), 131 | new Container( 132 | child: new Text("关注", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 133 | ) 134 | ], 135 | ), 136 | ) 137 | ), 138 | ), 139 | new Container( 140 | height: 14.0, 141 | width: 1.0, 142 | decoration: new BoxDecoration( 143 | border: new BorderDirectional( 144 | start: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 145 | ) 146 | ), 147 | ), 148 | new Container( 149 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 150 | child: new FlatButton( 151 | onPressed: (){}, 152 | child: new Container( 153 | height: 50.0, 154 | child: new Column( 155 | children: [ 156 | new Container( 157 | child: new Text("18", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 158 | ), 159 | new Container( 160 | child: new Text("我的收藏", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 161 | ) 162 | ], 163 | ), 164 | ) 165 | ), 166 | ), 167 | new Container( 168 | height: 14.0, 169 | width: 1.0, 170 | decoration: new BoxDecoration( 171 | border: new BorderDirectional( 172 | start: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 173 | ) 174 | ), 175 | ), 176 | new Container( 177 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 178 | child: new FlatButton( 179 | onPressed: (){}, 180 | child: new Container( 181 | height: 50.0, 182 | child: new Column( 183 | children: [ 184 | new Container( 185 | child: new Text("33", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 186 | ), 187 | new Container( 188 | child: new Text("最近浏览", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 189 | ) 190 | ], 191 | ), 192 | ) 193 | ) 194 | ) 195 | ], 196 | ), 197 | ) 198 | ], 199 | ), 200 | ); 201 | } 202 | 203 | Widget myServiceCard() { 204 | return new Container( 205 | color: GlobalConfig.cardBackgroundColor, 206 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0), 207 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 208 | child: new Column( 209 | children: [ 210 | new Container( 211 | child: new Row( 212 | mainAxisAlignment: MainAxisAlignment.center, 213 | children: [ 214 | new Container( 215 | width: MediaQuery.of(context).size.width / 4, 216 | child: new FlatButton( 217 | onPressed: (){}, 218 | child: new Container( 219 | child: new Column( 220 | children: [ 221 | new Container( 222 | margin: const EdgeInsets.only(bottom: 6.0), 223 | child: new CircleAvatar( 224 | radius: 20.0, 225 | child: new Icon(Icons.book, color: Colors.white), 226 | backgroundColor: Colors.green, 227 | ), 228 | ), 229 | new Container( 230 | child: new Text("我的书架", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0),), 231 | ) 232 | ], 233 | ), 234 | ) 235 | ), 236 | ), 237 | new Container( 238 | width: MediaQuery.of(context).size.width / 4, 239 | child: new FlatButton( 240 | onPressed: (){}, 241 | child: new Container( 242 | child: new Column( 243 | children: [ 244 | new Container( 245 | margin: const EdgeInsets.only(bottom: 6.0), 246 | child: new CircleAvatar( 247 | radius: 20.0, 248 | child: new Icon(Icons.flash_on, color: Colors.white), 249 | backgroundColor: Colors.blue, 250 | ), 251 | ), 252 | new Container( 253 | child: new Text("我的 Live", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 254 | ) 255 | ], 256 | ), 257 | ) 258 | ), 259 | ), 260 | new Container( 261 | width: MediaQuery.of(context).size.width / 4, 262 | child: new FlatButton( 263 | onPressed: (){}, 264 | child: new Container( 265 | child: new Column( 266 | children: [ 267 | new Container( 268 | margin: const EdgeInsets.only(bottom: 6.0), 269 | child: new CircleAvatar( 270 | radius: 20.0, 271 | child: new Icon(Icons.free_breakfast, color: Colors.white), 272 | backgroundColor: new Color(0xFFA68F52), 273 | ), 274 | ), 275 | new Container( 276 | child: new Text("私家课", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 277 | ) 278 | ], 279 | ), 280 | ) 281 | ), 282 | ), 283 | new Container( 284 | width: MediaQuery.of(context).size.width / 4, 285 | child: new FlatButton( 286 | onPressed: (){}, 287 | child: new Container( 288 | child: new Column( 289 | children: [ 290 | new Container( 291 | margin: const EdgeInsets.only(bottom: 6.0), 292 | child: new CircleAvatar( 293 | radius: 20.0, 294 | child: new Icon(Icons.attach_money, color: Colors.white), 295 | backgroundColor: new Color(0xFF355A9B), 296 | ), 297 | ), 298 | new Container( 299 | child: new Text("付费咨询", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 300 | ) 301 | ], 302 | ), 303 | ) 304 | ), 305 | ), 306 | ], 307 | ), 308 | ), 309 | new Container( 310 | margin: const EdgeInsets.only(top: 16.0), 311 | child: new Row( 312 | mainAxisAlignment: MainAxisAlignment.start, 313 | children: [ 314 | new Container( 315 | width: MediaQuery.of(context).size.width / 4, 316 | child: new FlatButton( 317 | onPressed: (){}, 318 | child: new Container( 319 | child: new Column( 320 | children: [ 321 | new Container( 322 | margin: const EdgeInsets.only(bottom: 6.0), 323 | child: new CircleAvatar( 324 | radius: 20.0, 325 | child: new Icon(Icons.shop, color: Colors.white), 326 | backgroundColor: new Color(0xFF088DB4), 327 | ), 328 | ), 329 | new Container( 330 | child: new Text("已购", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0),), 331 | ) 332 | ], 333 | ), 334 | ) 335 | ), 336 | ), 337 | new Container( 338 | width: MediaQuery.of(context).size.width / 4, 339 | child: new FlatButton( 340 | onPressed: (){}, 341 | child: new Container( 342 | child: new Column( 343 | children: [ 344 | new Container( 345 | margin: const EdgeInsets.only(bottom: 6.0), 346 | child: new CircleAvatar( 347 | radius: 20.0, 348 | child: new Icon(Icons.radio, color: Colors.white), 349 | backgroundColor: Colors.blue, 350 | ), 351 | ), 352 | new Container( 353 | child: new Text("余额礼卷", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 354 | ) 355 | ], 356 | ), 357 | ) 358 | ), 359 | ), 360 | new Container( 361 | width: MediaQuery.of(context).size.width / 4, 362 | child: new FlatButton( 363 | onPressed: (){}, 364 | child: new Container( 365 | child: new Column( 366 | children: [ 367 | new Container( 368 | margin: const EdgeInsets.only(bottom: 6.0), 369 | child: new CircleAvatar( 370 | radius: 20.0, 371 | child: new Icon(Icons.wifi_tethering, color: Colors.white), 372 | backgroundColor: new Color(0xFF029A3F), 373 | ), 374 | ), 375 | new Container( 376 | child: new Text("服务", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 377 | ) 378 | ], 379 | ), 380 | ) 381 | ), 382 | ), 383 | ], 384 | ), 385 | ) 386 | ], 387 | ), 388 | ); 389 | } 390 | 391 | Widget settingCard() { 392 | return new Container( 393 | color: GlobalConfig.cardBackgroundColor, 394 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0), 395 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 396 | child: new Row( 397 | mainAxisAlignment: MainAxisAlignment.start, 398 | children: [ 399 | new Container( 400 | width: MediaQuery.of(context).size.width / 4, 401 | child: new FlatButton( 402 | onPressed: (){}, 403 | child: new Container( 404 | child: new Column( 405 | children: [ 406 | new Container( 407 | margin: const EdgeInsets.only(bottom: 6.0), 408 | child: new CircleAvatar( 409 | radius: 20.0, 410 | child: new Icon(Icons.invert_colors, color: Colors.white), 411 | backgroundColor: new Color(0xFFB88800), 412 | ), 413 | ), 414 | new Container( 415 | child: new Text("社区建设", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 416 | ) 417 | ], 418 | ), 419 | ) 420 | ), 421 | ), 422 | new Container( 423 | width: MediaQuery.of(context).size.width / 4, 424 | child: new FlatButton( 425 | onPressed: (){}, 426 | child: new Container( 427 | child: new Column( 428 | children: [ 429 | new Container( 430 | margin: const EdgeInsets.only(bottom: 6.0), 431 | child: new CircleAvatar( 432 | radius: 20.0, 433 | child: new Icon(Icons.golf_course, color: Colors.white), 434 | backgroundColor: new Color(0xFF63616D), 435 | ), 436 | ), 437 | new Container( 438 | child: new Text("反馈", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 439 | ) 440 | ], 441 | ), 442 | ) 443 | ), 444 | ), 445 | new Container( 446 | width: MediaQuery.of(context).size.width / 4, 447 | child: new FlatButton( 448 | onPressed: (){ 449 | setState((){ 450 | if (GlobalConfig.dark == true) { 451 | GlobalConfig.themeData = new ThemeData( 452 | primaryColor: Colors.white, 453 | scaffoldBackgroundColor: new Color(0xFFEBEBEB), 454 | ); 455 | GlobalConfig.searchBackgroundColor = new Color(0xFFEBEBEB); 456 | GlobalConfig.cardBackgroundColor = Colors.white; 457 | GlobalConfig.fontColor = Colors.black54; 458 | GlobalConfig.dark = false; 459 | } else { 460 | GlobalConfig.themeData = new ThemeData.dark(); 461 | GlobalConfig.searchBackgroundColor = Colors.white10; 462 | GlobalConfig.cardBackgroundColor = new Color(0xFF222222); 463 | GlobalConfig.fontColor = Colors.white30; 464 | GlobalConfig.dark = true; 465 | } 466 | }); 467 | }, 468 | child: new Container( 469 | child: new Column( 470 | children: [ 471 | new Container( 472 | margin: const EdgeInsets.only(bottom: 6.0), 473 | child: new CircleAvatar( 474 | radius: 20.0, 475 | child: new Icon(GlobalConfig.dark == true ? Icons.wb_sunny : Icons.brightness_2, color: Colors.white), 476 | backgroundColor: new Color(0xFFB86A0D), 477 | ), 478 | ), 479 | new Container( 480 | child: new Text(GlobalConfig.dark == true ? "日间模式" : "夜间模式", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 481 | ) 482 | ], 483 | ), 484 | ) 485 | ), 486 | ), 487 | new Container( 488 | width: MediaQuery.of(context).size.width / 4, 489 | child: new FlatButton( 490 | onPressed: (){}, 491 | child: new Container( 492 | child: new Column( 493 | children: [ 494 | new Container( 495 | margin: const EdgeInsets.only(bottom: 6.0), 496 | child: new CircleAvatar( 497 | radius: 20.0, 498 | child: new Icon(Icons.perm_data_setting, color: Colors.white), 499 | backgroundColor: new Color(0xFF636269), 500 | ), 501 | ), 502 | new Container( 503 | child: new Text("设置", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 504 | ) 505 | ], 506 | ), 507 | ) 508 | ), 509 | ), 510 | ], 511 | ), 512 | ); 513 | } 514 | 515 | Widget videoCard() { 516 | return new Container( 517 | color: GlobalConfig.cardBackgroundColor, 518 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0), 519 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 520 | child: new Column( 521 | children: [ 522 | new Container( 523 | margin: const EdgeInsets.only(left: 16.0, bottom: 20.0), 524 | child: new Row( 525 | children: [ 526 | new Container( 527 | child: new CircleAvatar( 528 | radius: 20.0, 529 | child: new Icon(Icons.videocam, color: Colors.white), 530 | backgroundColor: new Color(0xFFB36905), 531 | ), 532 | ), 533 | new Expanded( 534 | child: new Container( 535 | margin: const EdgeInsets.only(left: 8.0), 536 | child: new Text("视频创作", style: new TextStyle(fontSize: 18.0),), 537 | ), 538 | ), 539 | new Container( 540 | child: new FlatButton( 541 | onPressed: (){}, 542 | child: new Text("拍一个", style: new TextStyle(color: Colors.blue),) 543 | ), 544 | ) 545 | ], 546 | ) 547 | ), 548 | new Container( 549 | margin: const EdgeInsets.only(left: 16.0), 550 | child: new SingleChildScrollView( 551 | scrollDirection: Axis.horizontal, 552 | child: new Row( 553 | children: [ 554 | new Container( 555 | width: MediaQuery.of(context).size.width / 2.5, 556 | margin: const EdgeInsets.only(right: 6.0), 557 | child: new AspectRatio( 558 | aspectRatio: 4.0 / 2.0, 559 | child: new Container( 560 | foregroundDecoration:new BoxDecoration( 561 | image: new DecorationImage( 562 | image: new NetworkImage("https://pic2.zhimg.com/50/v2-5942a51e6b834f10074f8d50be5bbd4d_400x224.jpg"), 563 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 564 | ), 565 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 566 | ), 567 | ) 568 | ) 569 | ), 570 | new Container( 571 | margin: const EdgeInsets.only(right: 6.0), 572 | width: MediaQuery.of(context).size.width / 2.5, 573 | child: new AspectRatio( 574 | aspectRatio: 4.0 / 2.0, 575 | child: new Container( 576 | foregroundDecoration:new BoxDecoration( 577 | image: new DecorationImage( 578 | image: new NetworkImage("https://pic3.zhimg.com/50/v2-7fc9a1572c6fc72a3dea0b73a9be36e7_400x224.jpg"), 579 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 580 | ), 581 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 582 | ), 583 | ) 584 | ) 585 | ), 586 | new Container( 587 | margin: const EdgeInsets.only(right: 6.0), 588 | width: MediaQuery.of(context).size.width / 2.5, 589 | child: new AspectRatio( 590 | aspectRatio: 4.0 / 2.0, 591 | child: new Container( 592 | foregroundDecoration:new BoxDecoration( 593 | image: new DecorationImage( 594 | image: new NetworkImage("https://pic4.zhimg.com/50/v2-898f43a488b606061c877ac2a471e221_400x224.jpg"), 595 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 596 | ), 597 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 598 | ), 599 | ) 600 | ) 601 | ), 602 | new Container( 603 | width: MediaQuery.of(context).size.width / 2.5, 604 | child: new AspectRatio( 605 | aspectRatio: 4.0 / 2.0, 606 | child: new Container( 607 | foregroundDecoration:new BoxDecoration( 608 | image: new DecorationImage( 609 | image: new NetworkImage("https://pic1.zhimg.com/50/v2-0008057d1ad2bd813aea4fc247959e63_400x224.jpg"), 610 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 611 | ), 612 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 613 | ), 614 | ) 615 | ) 616 | ) 617 | ], 618 | ), 619 | ), 620 | ) 621 | ], 622 | ) 623 | ); 624 | } 625 | 626 | Widget ideaCard() { 627 | return new Container( 628 | color: GlobalConfig.cardBackgroundColor, 629 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0), 630 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 631 | child: new Column( 632 | children: [ 633 | new Container( 634 | margin: const EdgeInsets.only(left: 16.0, bottom: 20.0), 635 | child: new Row( 636 | children: [ 637 | new Container( 638 | child: new CircleAvatar( 639 | radius: 20.0, 640 | child: new Icon(Icons.all_inclusive, color: Colors.white), 641 | backgroundColor: Colors.blue, 642 | ), 643 | ), 644 | new Expanded( 645 | child: new Container( 646 | margin: const EdgeInsets.only(left: 8.0), 647 | child: new Text("想法", style: new TextStyle(fontSize: 18.0),), 648 | ), 649 | ), 650 | new Container( 651 | child: new FlatButton( 652 | onPressed: (){}, 653 | child: new Text("去往想法首页", style: new TextStyle(color: Colors.blue),) 654 | ), 655 | ) 656 | ], 657 | ) 658 | ), 659 | new Container( 660 | margin: const EdgeInsets.only(left: 16.0), 661 | child: new SingleChildScrollView( 662 | scrollDirection: Axis.horizontal, 663 | child: new Row( 664 | children: [ 665 | new Container( 666 | margin: const EdgeInsets.only(right: 6.0), 667 | decoration: new BoxDecoration( 668 | color: GlobalConfig.searchBackgroundColor, 669 | borderRadius: new BorderRadius.all(new Radius.circular(6.0)) 670 | ), 671 | child: new Row( 672 | children: [ 673 | new Container( 674 | padding: const EdgeInsets.only(left: 10.0), 675 | child: new Column( 676 | children: [ 677 | new Align( 678 | alignment: Alignment.centerLeft, 679 | child: new Container( 680 | child: new Text("苹果 WWDC 2018 正在举行", style: new TextStyle(color: GlobalConfig.dark == true? Colors.white70 : Colors.black, fontSize: 16.0),), 681 | ), 682 | ), 683 | new Align( 684 | alignment: Alignment.centerLeft, 685 | child: new Container( 686 | margin: const EdgeInsets.only(top: 6.0), 687 | child: new Text("软件更新意料之中,硬件之谜...", style: new TextStyle(color: GlobalConfig.fontColor),), 688 | ) 689 | ) 690 | 691 | ], 692 | ), 693 | ), 694 | new Container( 695 | margin: const EdgeInsets.all(10.0), 696 | width: MediaQuery.of(context).size.width / 5, 697 | child: new AspectRatio( 698 | aspectRatio: 1.0 / 1.0, 699 | child: new Container( 700 | foregroundDecoration:new BoxDecoration( 701 | image: new DecorationImage( 702 | image: new NetworkImage("https://pic2.zhimg.com/50/v2-55039fa535f3fe06365c0fcdaa9e3847_400x224.jpg"), 703 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 704 | ), 705 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 706 | ), 707 | ) 708 | ) 709 | ) 710 | ], 711 | ) 712 | ), 713 | new Container( 714 | margin: const EdgeInsets.only(right: 6.0), 715 | decoration: new BoxDecoration( 716 | color: GlobalConfig.searchBackgroundColor, 717 | borderRadius: new BorderRadius.all(new Radius.circular(6.0)) 718 | ), 719 | child: new Row( 720 | children: [ 721 | new Container( 722 | padding: const EdgeInsets.only(left: 10.0), 723 | child: new Column( 724 | children: [ 725 | new Align( 726 | alignment: Alignment.centerLeft, 727 | child: new Container( 728 | child: new Text("此刻你的桌子是什么样子?", style: new TextStyle(color: GlobalConfig.dark == true? Colors.white70 : Colors.black, fontSize: 16.0),), 729 | ), 730 | ), 731 | new Align( 732 | alignment: Alignment.centerLeft, 733 | child: new Container( 734 | margin: const EdgeInsets.only(top: 6.0), 735 | child: new Text("晒一晒你的书桌/办公桌", style: new TextStyle(color: GlobalConfig.fontColor),), 736 | ) 737 | ) 738 | 739 | ], 740 | ), 741 | ), 742 | new Container( 743 | margin: const EdgeInsets.all(10.0), 744 | width: MediaQuery.of(context).size.width / 5, 745 | child: new AspectRatio( 746 | aspectRatio: 1.0 / 1.0, 747 | child: new Container( 748 | foregroundDecoration:new BoxDecoration( 749 | image: new DecorationImage( 750 | image: new NetworkImage("https://pic3.zhimg.com/v2-b4551f702970ff37709cdd7fd884de5e_294x245|adx4.png"), 751 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 752 | ), 753 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 754 | ), 755 | ) 756 | ) 757 | ) 758 | ], 759 | ) 760 | ), 761 | new Container( 762 | margin: const EdgeInsets.only(right: 6.0), 763 | decoration: new BoxDecoration( 764 | color: GlobalConfig.searchBackgroundColor, 765 | borderRadius: new BorderRadius.all(new Radius.circular(6.0)) 766 | ), 767 | child: new Row( 768 | children: [ 769 | new Container( 770 | padding: const EdgeInsets.only(left: 10.0), 771 | child: new Column( 772 | children: [ 773 | new Align( 774 | alignment: Alignment.centerLeft, 775 | child: new Container( 776 | child: new Text("关于高考你印象最深的是...", style: new TextStyle(color: GlobalConfig.dark == true? Colors.white70 : Colors.black, fontSize: 16.0),), 777 | ), 778 | ), 779 | new Align( 780 | alignment: Alignment.centerLeft, 781 | child: new Container( 782 | margin: const EdgeInsets.only(top: 6.0), 783 | child: new Text("聊聊你的高三生活", style: new TextStyle(color: GlobalConfig.fontColor),), 784 | ) 785 | ) 786 | 787 | ], 788 | ), 789 | ), 790 | new Container( 791 | margin: const EdgeInsets.all(10.0), 792 | width: MediaQuery.of(context).size.width / 5, 793 | child: new AspectRatio( 794 | aspectRatio: 1.0 / 1.0, 795 | child: new Container( 796 | foregroundDecoration:new BoxDecoration( 797 | image: new DecorationImage( 798 | image: new NetworkImage("https://pic2.zhimg.com/50/v2-ce2e01a047e4aba9bfabf8469cfd3e75_400x224.jpg"), 799 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 800 | ), 801 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 802 | ), 803 | ) 804 | ) 805 | ) 806 | ], 807 | ) 808 | ), 809 | new Container( 810 | margin: const EdgeInsets.only(right: 6.0), 811 | decoration: new BoxDecoration( 812 | color: GlobalConfig.searchBackgroundColor, 813 | borderRadius: new BorderRadius.all(new Radius.circular(6.0)) 814 | ), 815 | child: new Row( 816 | children: [ 817 | new Container( 818 | padding: const EdgeInsets.only(left: 10.0), 819 | child: new Column( 820 | children: [ 821 | new Align( 822 | alignment: Alignment.centerLeft, 823 | child: new Container( 824 | child: new Text("夏天一定要吃的食物有哪些", style: new TextStyle(color: GlobalConfig.dark == true? Colors.white70 : Colors.black, fontSize: 16.0),), 825 | ), 826 | ), 827 | new Align( 828 | alignment: Alignment.centerLeft, 829 | child: new Container( 830 | margin: const EdgeInsets.only(top: 6.0), 831 | child: new Text("最适合夏天吃的那种", style: new TextStyle(color: GlobalConfig.fontColor),), 832 | ) 833 | ) 834 | 835 | ], 836 | ), 837 | ), 838 | new Container( 839 | margin: const EdgeInsets.all(10.0), 840 | width: MediaQuery.of(context).size.width / 5, 841 | child: new AspectRatio( 842 | aspectRatio: 1.0 / 1.0, 843 | child: new Container( 844 | foregroundDecoration:new BoxDecoration( 845 | image: new DecorationImage( 846 | image: new NetworkImage("https://pic1.zhimg.com/50/v2-bb3806c2ced60e5b7f38a0aa06b89511_400x224.jpg"), 847 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 848 | ), 849 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 850 | ), 851 | ) 852 | ) 853 | ) 854 | ], 855 | ) 856 | ), 857 | ], 858 | ), 859 | ), 860 | ) 861 | ], 862 | ) 863 | ); 864 | } 865 | 866 | @override 867 | Widget build(BuildContext context) { 868 | return new MaterialApp( 869 | theme: GlobalConfig.themeData, 870 | home: new Scaffold( 871 | appBar: new AppBar( 872 | title: barSearch(), 873 | ), 874 | body: new SingleChildScrollView( 875 | child: new Container( 876 | child: new Column( 877 | children: [ 878 | myInfoCard(), 879 | myServiceCard(), 880 | settingCard(), 881 | videoCard(), 882 | ideaCard() 883 | ], 884 | ), 885 | ), 886 | ) 887 | ), 888 | ); 889 | } 890 | 891 | } --------------------------------------------------------------------------------