├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.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 │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── lib ├── network │ ├── http_config.dart │ ├── home_request.dart │ └── http_request.dart ├── main.dart ├── views │ ├── group │ │ └── group.dart │ ├── mall │ │ └── mall.dart │ ├── profile │ │ └── profile.dart │ ├── subject │ │ └── subject.dart │ └── home │ │ ├── home.dart │ │ └── childCpns │ │ └── movie_list_item.dart ├── components │ ├── dash_line.dart │ └── star_rating.dart ├── models │ └── home_model.dart └── app.dart ├── assets └── images │ ├── home │ └── wish.png │ └── tabbar │ ├── group.png │ ├── home.png │ ├── mall.png │ ├── profile.png │ ├── subject.png │ ├── group_active.png │ ├── home_active.png │ ├── mall_active.png │ ├── profile_active.png │ └── subject_active.png ├── android ├── gradle.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 │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── coderwhy │ │ │ │ │ └── douban_app │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── .metadata ├── LICENSE ├── test └── widget_test.dart ├── .gitignore ├── pubspec.yaml ├── pubspec.lock └── README.md /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/network/http_config.dart: -------------------------------------------------------------------------------- 1 | const baseURL = "http://123.207.32.32:8000"; 2 | const timeout = 5000; 3 | -------------------------------------------------------------------------------- /assets/images/home/wish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/home/wish.png -------------------------------------------------------------------------------- /assets/images/tabbar/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/group.png -------------------------------------------------------------------------------- /assets/images/tabbar/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/home.png -------------------------------------------------------------------------------- /assets/images/tabbar/mall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/mall.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /assets/images/tabbar/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/profile.png -------------------------------------------------------------------------------- /assets/images/tabbar/subject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/subject.png -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'app.dart'; 3 | 4 | void main() => runApp(MyApp()); 5 | 6 | -------------------------------------------------------------------------------- /assets/images/tabbar/group_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/group_active.png -------------------------------------------------------------------------------- /assets/images/tabbar/home_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/home_active.png -------------------------------------------------------------------------------- /assets/images/tabbar/mall_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/mall_active.png -------------------------------------------------------------------------------- /assets/images/tabbar/profile_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/profile_active.png -------------------------------------------------------------------------------- /assets/images/tabbar/subject_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/assets/images/tabbar/subject_active.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderwhy/flutter_douban_app/HEAD/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/coderwhy/flutter_douban_app/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /.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: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /lib/views/group/group.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Group extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text("小组"), 9 | ), 10 | body: Center( 11 | child: Text("小组", style: TextStyle(fontSize: 30),), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/views/mall/mall.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Mall extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text("市集"), 9 | ), 10 | body: Center( 11 | child: Text("市集", style: TextStyle(fontSize: 30),), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/views/profile/profile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Profile extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text("我的"), 9 | ), 10 | body: Center( 11 | child: Text("我的", style: TextStyle(fontSize: 30),), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/views/subject/subject.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Subject extends StatelessWidget { 4 | @override 5 | Widget build(BuildContext context) { 6 | return Scaffold( 7 | appBar: AppBar( 8 | title: Text("书影音"), 9 | ), 10 | body: Center( 11 | child: Text("书影音", style: TextStyle(fontSize: 30),), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/coderwhy/douban_app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.coderwhy.douban_app 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | GeneratedPluginRegistrant.registerWith(this) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/network/home_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:douban_app/models/home_model.dart'; 2 | import 'http_request.dart'; 3 | 4 | class HomeRequest { 5 | Future> getMovieTopList(int start, int count) async { 6 | // 1.拼接URL 7 | final url = "https://douban.uieee.com/v2/movie/top250?start=$start&count=$count"; 8 | 9 | // 2.发送请求 10 | final result = await HttpRequest.request(url); 11 | 12 | // 3.转成模型对象 13 | final subjects = result["subjects"]; 14 | List movies = []; 15 | for (var sub in subjects) { 16 | movies.add(MovieItem.fromMap(sub)); 17 | } 18 | 19 | return movies; 20 | } 21 | } -------------------------------------------------------------------------------- /lib/network/http_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'http_config.dart'; 3 | 4 | class HttpRequest { 5 | // 1.创建实例对象 6 | static BaseOptions baseOptions = BaseOptions(connectTimeout: timeout); 7 | static Dio dio = Dio(baseOptions); 8 | 9 | static Future request(String url, {String method = "get",Map params}) async { 10 | // 1.单独相关的设置 11 | Options options = Options(); 12 | options.method = method; 13 | 14 | // 2.发送网络请求 15 | try { 16 | Response response = await dio.request(url, queryParameters: params, options: options); 17 | return response.data; 18 | } on DioError catch (e) { 19 | throw e; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 coderwhy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/components/dash_line.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DashedLine extends StatelessWidget { 4 | final Axis axis; 5 | final double dashedWidth; 6 | final double dashedHeight; 7 | final int count; 8 | final Color color; 9 | 10 | DashedLine({ 11 | @required this.axis, 12 | this.dashedWidth = 1, 13 | this.dashedHeight = 1, 14 | this.count, 15 | this.color = const Color(0xffaaaaaa) 16 | }); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return LayoutBuilder( 21 | builder: (BuildContext context, BoxConstraints constraints) { 22 | // 根据宽度计算个数 23 | return Flex( 24 | direction: this.axis, 25 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 26 | children: List.generate(this.count, (int index) { 27 | return SizedBox( 28 | width: dashedWidth, 29 | height: dashedHeight, 30 | child: DecoratedBox( 31 | decoration: BoxDecoration(color: color), 32 | ), 33 | ); 34 | }), 35 | ); 36 | }, 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:douban_app/app.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/home_model.dart: -------------------------------------------------------------------------------- 1 | class Person { 2 | String name; 3 | String avatarURL; 4 | 5 | Person.fromMap(Map json) { 6 | this.name = json["name"]; 7 | this.avatarURL = json["avatars"]["medium"]; 8 | } 9 | } 10 | 11 | class Actor extends Person { 12 | Actor.fromMap(Map json): super.fromMap(json); 13 | } 14 | 15 | class Director extends Person { 16 | Director.fromMap(Map json): super.fromMap(json); 17 | } 18 | 19 | int counter = 1; 20 | 21 | class MovieItem { 22 | int rank; 23 | String imageURL; 24 | String title; 25 | String playDate; 26 | double rating; 27 | List genres; 28 | List casts; 29 | Director director; 30 | String originalTitle; 31 | 32 | MovieItem.fromMap(Map json) { 33 | this.rank = counter++; 34 | this.imageURL = json["images"]["medium"]; 35 | this.title = json["title"]; 36 | this.playDate = json["year"]; 37 | this.rating = json["rating"]["average"]; 38 | this.genres = json["genres"].cast(); 39 | this.casts = (json["casts"] as List).map((item) { 40 | return Actor.fromMap(item); 41 | }).toList(); 42 | this.director = Director.fromMap(json["directors"][0]); 43 | this.originalTitle = json["original_title"]; 44 | } 45 | } -------------------------------------------------------------------------------- /lib/views/home/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:douban_app/models/home_model.dart'; 2 | import 'package:douban_app/network/home_request.dart'; 3 | import 'package:douban_app/views/home/childCpns/movie_list_item.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | const COUNT = 20; 7 | 8 | class Home extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | appBar: AppBar( 13 | title: Text("首页"), 14 | ), 15 | body: Center( 16 | child: HomeContent(), 17 | ), 18 | ); 19 | } 20 | } 21 | 22 | class HomeContent extends StatefulWidget { 23 | @override 24 | _HomeContentState createState() => _HomeContentState(); 25 | } 26 | 27 | class _HomeContentState extends State { 28 | // 初始化首页的网络请求对象 29 | HomeRequest homeRequest = HomeRequest(); 30 | 31 | int _start = 0; 32 | List movies = []; 33 | 34 | @override 35 | void initState() { 36 | super.initState(); 37 | 38 | // 请求电影列表数据 39 | getMovieTopList(_start, COUNT); 40 | } 41 | 42 | void getMovieTopList(start, count) { 43 | homeRequest.getMovieTopList(start, count).then((result) { 44 | setState(() { 45 | movies.addAll(result); 46 | }); 47 | }); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return ListView.builder( 53 | itemCount: movies.length, 54 | itemBuilder: (BuildContext context, int index) { 55 | return MovieListItem(movies[index]); 56 | } 57 | ); 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | douban_app 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .packages 28 | .pub-cache/ 29 | .pub/ 30 | /build/ 31 | 32 | # Android related 33 | **/android/**/gradle-wrapper.jar 34 | **/android/.gradle 35 | **/android/captures/ 36 | **/android/gradlew 37 | **/android/gradlew.bat 38 | **/android/local.properties 39 | **/android/**/GeneratedPluginRegistrant.java 40 | 41 | # iOS/XCode related 42 | **/ios/**/*.mode1v3 43 | **/ios/**/*.mode2v3 44 | **/ios/**/*.moved-aside 45 | **/ios/**/*.pbxuser 46 | **/ios/**/*.perspectivev3 47 | **/ios/**/*sync/ 48 | **/ios/**/.sconsign.dblite 49 | **/ios/**/.tags* 50 | **/ios/**/.vagrant/ 51 | **/ios/**/DerivedData/ 52 | **/ios/**/Icon? 53 | **/ios/**/Pods/ 54 | **/ios/**/.symlinks/ 55 | **/ios/**/profile 56 | **/ios/**/xcuserdata 57 | **/ios/.generated/ 58 | **/ios/Flutter/App.framework 59 | **/ios/Flutter/Flutter.framework 60 | **/ios/Flutter/Generated.xcconfig 61 | **/ios/Flutter/app.flx 62 | **/ios/Flutter/app.zip 63 | **/ios/Flutter/flutter_assets/ 64 | **/ios/Flutter/flutter_export_environment.sh 65 | **/ios/ServiceDefinitions.json 66 | **/ios/Runner/GeneratedPluginRegistrant.* 67 | 68 | # Exceptions to above rules. 69 | !**/ios/**/default.mode1v3 70 | !**/ios/**/default.mode2v3 71 | !**/ios/**/default.pbxuser 72 | !**/ios/**/default.perspectivev3 73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 74 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'views/home/home.dart'; 3 | import 'views/subject/subject.dart'; 4 | import 'views/group/group.dart'; 5 | import 'views/mall/mall.dart'; 6 | import 'views/profile/profile.dart'; 7 | 8 | 9 | class MyApp extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | title: "豆瓣", 14 | theme: ThemeData( 15 | primaryColor: Colors.green, 16 | highlightColor: Colors.transparent, 17 | splashColor: Colors.transparent 18 | ), 19 | home: MyStackPage(), 20 | ); 21 | } 22 | } 23 | 24 | class MyStackPage extends StatefulWidget { 25 | @override 26 | _MyStackPageState createState() => _MyStackPageState(); 27 | } 28 | 29 | class _MyStackPageState extends State { 30 | 31 | var _currentIndex = 0; 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Scaffold( 36 | bottomNavigationBar: BottomNavigationBar( 37 | currentIndex: _currentIndex, 38 | selectedFontSize: 14, 39 | unselectedFontSize: 14, 40 | type: BottomNavigationBarType.fixed, 41 | items: [ 42 | createItem("home", "首页"), 43 | createItem("subject", "书影音"), 44 | createItem("group", "小组"), 45 | createItem("mall", "市集"), 46 | createItem("profile", "我的"), 47 | ], 48 | onTap: (index) { 49 | setState(() { 50 | _currentIndex = index; 51 | }); 52 | }, 53 | ), 54 | body: IndexedStack( 55 | index: _currentIndex, 56 | children: [ 57 | Home(), 58 | Subject(), 59 | Group(), 60 | Mall(), 61 | Profile() 62 | ], 63 | ), 64 | ); 65 | } 66 | } 67 | 68 | BottomNavigationBarItem createItem(String iconName, String title) { 69 | return BottomNavigationBarItem( 70 | icon: Image.asset("assets/images/tabbar/$iconName.png", width: 30,), 71 | activeIcon: Image.asset("assets/images/tabbar/${iconName}_active.png", width: 30,), 72 | title: Text(title) 73 | ); 74 | } 75 | 76 | 77 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.coderwhy.douban_app" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/components/star_rating.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class StarRating extends StatefulWidget { 4 | final double rating; 5 | final double maxRating; 6 | final Widget unselectedImage; 7 | final Widget selectedImage; 8 | final int count; 9 | final double size; 10 | final Color unselectedColor; 11 | final Color selectedColor; 12 | 13 | StarRating({ 14 | @required this.rating, 15 | this.maxRating = 10, 16 | this.size = 20, 17 | this.unselectedColor = const Color(0xffbbbbbb), 18 | this.selectedColor = const Color(0xffe0aa46), 19 | Widget unselectedImage, 20 | Widget selectedImage, 21 | this.count = 5, 22 | }): unselectedImage = unselectedImage ?? Icon(Icons.star, size: size, color: unselectedColor,), 23 | selectedImage = selectedImage ?? Icon(Icons.star, size: size, color: selectedColor); 24 | 25 | @override 26 | _StarRatingState createState() => _StarRatingState(); 27 | } 28 | 29 | class _StarRatingState extends State { 30 | @override 31 | Widget build(BuildContext context) { 32 | return Container( 33 | child: Stack( 34 | children: [ 35 | Row(children: getUnSelectImage(), mainAxisSize: MainAxisSize.min,), 36 | Row(children: getSelectImage(), mainAxisSize: MainAxisSize.min,), 37 | ], 38 | ), 39 | ); 40 | } 41 | 42 | // 获取评星 43 | List getUnSelectImage() { 44 | return List.generate(widget.count, (index) => widget.unselectedImage); 45 | } 46 | 47 | List getSelectImage() { 48 | // 1.计算Star个数和剩余比例等 49 | double oneValue = widget.maxRating / widget.count; 50 | int entireCount = (widget.rating / oneValue).floor(); 51 | double leftValue = widget.rating - entireCount * oneValue; 52 | double leftRatio = leftValue / oneValue; 53 | 54 | // 2.获取start 55 | List selectedImages = []; 56 | for (int i = 0; i < entireCount; i++) { 57 | selectedImages.add(widget.selectedImage); 58 | } 59 | 60 | // 3.计算 61 | Widget leftStar = ClipRect( 62 | clipper: MyRectClipper(width: leftRatio * widget.size), 63 | child: widget.selectedImage, 64 | ); 65 | selectedImages.add(leftStar); 66 | 67 | return selectedImages; 68 | } 69 | } 70 | 71 | 72 | class MyRectClipper extends CustomClipper{ 73 | final double width; 74 | 75 | MyRectClipper({ 76 | this.width 77 | }); 78 | 79 | @override 80 | Rect getClip(Size size) { 81 | return Rect.fromLTRB(0, 0, width, size.height); 82 | } 83 | 84 | @override 85 | bool shouldReclip(MyRectClipper oldClipper) { 86 | return width != oldClipper.width; 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: douban_app 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | 27 | dio: ^3.0.1 28 | 29 | dev_dependencies: 30 | flutter_test: 31 | sdk: flutter 32 | 33 | 34 | # For information on the generic Dart part of this file, see the 35 | # following page: https://dart.dev/tools/pub/pubspec 36 | 37 | # The following section is specific to Flutter. 38 | flutter: 39 | 40 | # The following line ensures that the Material Icons font is 41 | # included with your application, so that you can use the icons in 42 | # the material Icons class. 43 | uses-material-design: true 44 | 45 | # To add assets to your application, add an assets section, like this: 46 | assets: 47 | - assets/images/tabbar/home.png 48 | - assets/images/tabbar/home_active.png 49 | - assets/images/tabbar/subject.png 50 | - assets/images/tabbar/subject_active.png 51 | - assets/images/tabbar/group.png 52 | - assets/images/tabbar/group_active.png 53 | - assets/images/tabbar/mall.png 54 | - assets/images/tabbar/mall_active.png 55 | - assets/images/tabbar/profile.png 56 | - assets/images/tabbar/profile_active.png 57 | 58 | - assets/images/home/wish.png 59 | 60 | # An image asset can refer to one or more resolution-specific "variants", see 61 | # https://flutter.dev/assets-and-images/#resolution-aware. 62 | 63 | # For details regarding adding assets from package dependencies, see 64 | # https://flutter.dev/assets-and-images/#from-packages 65 | 66 | # To add custom fonts to your application, add a fonts section here, 67 | # in this "flutter" section. Each entry in this list should have a 68 | # "family" key with the font family name, and a "fonts" key with a 69 | # list giving the asset and other descriptors for the font. For 70 | # example: 71 | # fonts: 72 | # - family: Schyler 73 | # fonts: 74 | # - asset: fonts/Schyler-Regular.ttf 75 | # - asset: fonts/Schyler-Italic.ttf 76 | # style: italic 77 | # - family: Trajan Pro 78 | # fonts: 79 | # - asset: fonts/TrajanPro.ttf 80 | # - asset: fonts/TrajanPro_Bold.ttf 81 | # weight: 700 82 | # 83 | # For details regarding fonts from package dependencies, 84 | # see https://flutter.dev/custom-fonts/#from-packages 85 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.3.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.0.5" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.14.11" 32 | cupertino_icons: 33 | dependency: "direct main" 34 | description: 35 | name: cupertino_icons 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "0.1.2" 39 | dio: 40 | dependency: "direct main" 41 | description: 42 | name: dio 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "3.0.1" 46 | flutter: 47 | dependency: "direct main" 48 | description: flutter 49 | source: sdk 50 | version: "0.0.0" 51 | flutter_test: 52 | dependency: "direct dev" 53 | description: flutter 54 | source: sdk 55 | version: "0.0.0" 56 | http_parser: 57 | dependency: transitive 58 | description: 59 | name: http_parser 60 | url: "https://pub.flutter-io.cn" 61 | source: hosted 62 | version: "3.1.3" 63 | matcher: 64 | dependency: transitive 65 | description: 66 | name: matcher 67 | url: "https://pub.flutter-io.cn" 68 | source: hosted 69 | version: "0.12.5" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.flutter-io.cn" 75 | source: hosted 76 | version: "1.1.7" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "1.6.4" 84 | pedantic: 85 | dependency: transitive 86 | description: 87 | name: pedantic 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "1.8.0+1" 91 | quiver: 92 | dependency: transitive 93 | description: 94 | name: quiver 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "2.0.5" 98 | sky_engine: 99 | dependency: transitive 100 | description: flutter 101 | source: sdk 102 | version: "0.0.99" 103 | source_span: 104 | dependency: transitive 105 | description: 106 | name: source_span 107 | url: "https://pub.flutter-io.cn" 108 | source: hosted 109 | version: "1.5.5" 110 | stack_trace: 111 | dependency: transitive 112 | description: 113 | name: stack_trace 114 | url: "https://pub.flutter-io.cn" 115 | source: hosted 116 | version: "1.9.3" 117 | stream_channel: 118 | dependency: transitive 119 | description: 120 | name: stream_channel 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "2.0.0" 124 | string_scanner: 125 | dependency: transitive 126 | description: 127 | name: string_scanner 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "1.0.5" 131 | term_glyph: 132 | dependency: transitive 133 | description: 134 | name: term_glyph 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "1.1.0" 138 | test_api: 139 | dependency: transitive 140 | description: 141 | name: test_api 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "0.2.5" 145 | typed_data: 146 | dependency: transitive 147 | description: 148 | name: typed_data 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "1.1.6" 152 | vector_math: 153 | dependency: transitive 154 | description: 155 | name: vector_math 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "2.0.8" 159 | sdks: 160 | dart: ">2.4.0 <3.0.0" 161 | -------------------------------------------------------------------------------- /lib/views/home/childCpns/movie_list_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:douban_app/components/dash_line.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import 'package:douban_app/models/home_model.dart'; 5 | import 'package:douban_app/components/star_rating.dart'; 6 | 7 | class MovieListItem extends StatelessWidget { 8 | final MovieItem movie; 9 | 10 | MovieListItem(this.movie); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Container( 15 | padding: EdgeInsets.all(10), 16 | decoration: BoxDecoration( 17 | border: Border(bottom: BorderSide(width: 10, color: Color(0xffe2e2e2))) 18 | ), 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | // 1.电影排名 23 | getMovieRankWidget(), 24 | SizedBox(height: 12), 25 | // 2.具体内容 26 | getMovieContentWidget(), 27 | SizedBox(height: 12), 28 | // 3.电影简介 29 | getMovieIntroduceWidget(), 30 | SizedBox(height: 12,) 31 | ], 32 | ), 33 | ); 34 | } 35 | 36 | // 电影排名 37 | Widget getMovieRankWidget() { 38 | return Container( 39 | padding: EdgeInsets.fromLTRB(9, 4, 9, 4), 40 | decoration: BoxDecoration( 41 | borderRadius: BorderRadius.circular(3), 42 | color: Color.fromARGB(255, 238, 205, 144) 43 | ), 44 | child: Text( 45 | "No.${movie.rank}", 46 | style: TextStyle(fontSize: 18, color: Color.fromARGB(255, 131, 95, 36)), 47 | ) 48 | ); 49 | } 50 | 51 | // 具体内容 52 | Widget getMovieContentWidget() { 53 | return Container( 54 | height: 150, 55 | child: Row( 56 | crossAxisAlignment: CrossAxisAlignment.start, 57 | children: [ 58 | getContentImage(), 59 | getContentDesc(), 60 | getDashLine(), 61 | getContentWish() 62 | ], 63 | ), 64 | ); 65 | } 66 | 67 | Widget getContentImage() { 68 | return ClipRRect( 69 | borderRadius: BorderRadius.circular(5), 70 | child: Image.network(movie.imageURL) 71 | ); 72 | } 73 | 74 | Widget getContentDesc() { 75 | return Expanded( 76 | child: Container( 77 | padding: EdgeInsets.symmetric(horizontal: 15), 78 | child: Column( 79 | crossAxisAlignment: CrossAxisAlignment.start, 80 | children: [ 81 | getTitleWidget(), 82 | SizedBox(height: 3,), 83 | getRatingWidget(), 84 | SizedBox(height: 3,), 85 | getInfoWidget() 86 | ], 87 | ), 88 | ), 89 | ); 90 | } 91 | 92 | Widget getDashLine() { 93 | return Container( 94 | width: 1, 95 | height: 100, 96 | child: DashedLine( 97 | axis: Axis.vertical, 98 | dashedHeight: 6, 99 | dashedWidth: .5, 100 | count: 12, 101 | ), 102 | ); 103 | } 104 | 105 | Widget getTitleWidget() { 106 | return Stack( 107 | children: [ 108 | Icon(Icons.play_circle_outline, color: Colors.redAccent,), 109 | Text.rich( 110 | TextSpan( 111 | children: [ 112 | TextSpan( 113 | text: " " + movie.title, 114 | style: TextStyle( 115 | fontSize: 18, 116 | fontWeight: FontWeight.bold 117 | ) 118 | ), 119 | TextSpan( 120 | text: "(${movie.playDate})", 121 | style: TextStyle( 122 | fontSize: 18, 123 | color: Colors.black54 124 | ), 125 | ) 126 | ] 127 | ), 128 | maxLines: 2, 129 | ), 130 | ], 131 | ); 132 | } 133 | 134 | Widget getRatingWidget() { 135 | return Row( 136 | crossAxisAlignment: CrossAxisAlignment.end, 137 | children: [ 138 | StarRating(rating: movie.rating, size: 18,), 139 | SizedBox(width: 5), 140 | Text("${movie.rating}") 141 | ], 142 | ); 143 | } 144 | 145 | Widget getInfoWidget() { 146 | // 1.获取种类字符串 147 | final genres = movie.genres.join(" "); 148 | final director = movie.director.name; 149 | var castString = ""; 150 | for (final cast in movie.casts) { 151 | castString += cast.name + " "; 152 | } 153 | 154 | // 2.创建Widget 155 | return Text( 156 | "$genres / $director / $castString", 157 | maxLines: 2, 158 | overflow: TextOverflow.ellipsis, 159 | style: TextStyle(fontSize: 16), 160 | ); 161 | } 162 | 163 | Widget getContentWish() { 164 | return Container( 165 | width: 60, 166 | child: Column( 167 | mainAxisAlignment: MainAxisAlignment.start, 168 | children: [ 169 | SizedBox(height: 20,), 170 | Image.asset("assets/images/home/wish.png", width: 30,), 171 | SizedBox(height: 5,), 172 | Text( 173 | "想看", 174 | style: TextStyle(fontSize: 16, color: Color.fromARGB(255, 235, 170, 60)), 175 | ) 176 | ], 177 | ), 178 | ); 179 | } 180 | 181 | // 电影简介(原生名称) 182 | Widget getMovieIntroduceWidget() { 183 | return Container( 184 | width: double.infinity, 185 | padding: EdgeInsets.all(12), 186 | decoration: BoxDecoration( 187 | color: Color(0xfff2f2f2), 188 | borderRadius: BorderRadius.circular(5) 189 | ), 190 | child: Text(movie.originalTitle, style: TextStyle(fontSize: 18, color: Colors.black54),), 191 | ); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 高仿豆瓣页面 2 | 3 | > **更新地点:** 首发于公众号,第二天更新于掘金、思否、开发者头条等地方; 4 | > 5 | > **更多交流:** 可以添加我的微信 372623326,关注我的微博:coderwhy 6 | 7 | > 时间问题,没有非常详细说明每个步骤,后续希望可以更新一个视频为大家讲解。 8 | 9 | ![image-20191002160439302](https://tva1.sinaimg.cn/large/006y8mN6gy1g7jx2csputj31h80u01kx.jpg) 10 | 11 | ## 一. 数据请求和转化 12 | 13 | ### 1.1. 网络请求简单封装 14 | 15 | 目前我还没有详细讲解网络请求相关的知识,开发中我们更多选择地方的dio。 16 | 17 | 后面我会详细讲解网络请求的几种方式,我这里基于dio进行了一个简单工具的封装: 18 | 19 | 配置文件存放:http_config.dart 20 | 21 | ```dart 22 | const baseURL = "http://123.207.32.32:8000"; 23 | const timeout = 5000; 24 | ``` 25 | 26 | 网络请求工具文件:http_request.dart 27 | 28 | - 目前只是封装了一个方法,更多细节后续再补充 29 | 30 | ```dart 31 | import 'package:dio/dio.dart'; 32 | import 'http_config.dart'; 33 | 34 | class HttpRequest { 35 | // 1.创建实例对象 36 | static BaseOptions baseOptions = BaseOptions(connectTimeout: timeout); 37 | static Dio dio = Dio(baseOptions); 38 | 39 | static Future request(String url, {String method = "get",Map params}) async { 40 | // 1.单独相关的设置 41 | Options options = Options(); 42 | options.method = method; 43 | 44 | // 2.发送网络请求 45 | try { 46 | Response response = await dio.request(url, queryParameters: params, options: options); 47 | return response.data; 48 | } on DioError catch (e) { 49 | throw e; 50 | } 51 | } 52 | } 53 | ``` 54 | 55 | 56 | 57 | ### 1.2. 首页数据请求转化 58 | 59 | **豆瓣数据的获取** 60 | 61 | 这里我使用豆瓣的API接口来请求数据: 62 | 63 | - https://douban.uieee.com/v2/movie/top250?start=0&count=20 64 | 65 | ![image-20191002155619948](https://tva1.sinaimg.cn/large/006y8mN6gy1g7jwtr0lm0j31650u0dml.jpg) 66 | 67 | **模型对象的封装** 68 | 69 | 在面向对象的开发中,数据请求下来并不会像前端那样直接使用,而是封装成模型对象: 70 | 71 | - 前端开发者很容易没有面向对象的思维或者类型的思维。 72 | - 但是目前前端开发正在向TypeScript发展,也在帮助我们强化这种思维方式。 73 | 74 | 为了方便之后使用请求下来的数据,我将数据划分成了如下的模型: 75 | 76 | Person、Actor、Director模型:它们会被使用到MovieItem中 77 | 78 | ```dart 79 | class Person { 80 | String name; 81 | String avatarURL; 82 | 83 | Person.fromMap(Map json) { 84 | this.name = json["name"]; 85 | this.avatarURL = json["avatars"]["medium"]; 86 | } 87 | } 88 | 89 | class Actor extends Person { 90 | Actor.fromMap(Map json): super.fromMap(json); 91 | } 92 | 93 | class Director extends Person { 94 | Director.fromMap(Map json): super.fromMap(json); 95 | } 96 | ``` 97 | 98 | MovieItem模型: 99 | 100 | ```dart 101 | int counter = 1; 102 | 103 | class MovieItem { 104 | int rank; 105 | String imageURL; 106 | String title; 107 | String playDate; 108 | double rating; 109 | List genres; 110 | List casts; 111 | Director director; 112 | String originalTitle; 113 | 114 | MovieItem.fromMap(Map json) { 115 | this.rank = counter++; 116 | this.imageURL = json["images"]["medium"]; 117 | this.title = json["title"]; 118 | this.playDate = json["year"]; 119 | this.rating = json["rating"]["average"]; 120 | this.genres = json["genres"].cast(); 121 | this.casts = (json["casts"] as List).map((item) { 122 | return Actor.fromMap(item); 123 | }).toList(); 124 | this.director = Director.fromMap(json["directors"][0]); 125 | this.originalTitle = json["original_title"]; 126 | } 127 | } 128 | ``` 129 | 130 | **首页数据请求封装以及模型转化** 131 | 132 | 这里我封装了一个专门的类,用于请求首页的数据,这样让我们的请求代码更加规范的管理:HomeRequest 133 | 134 | - 目前类中只有一个方法getMovieTopList; 135 | - 后续有其他首页数据需要请求,就继续在这里封装请求的方法; 136 | 137 | ```dart 138 | import 'package:douban_app/models/home_model.dart'; 139 | import 'http_request.dart'; 140 | 141 | class HomeRequest { 142 | Future> getMovieTopList(int start, int count) async { 143 | // 1.拼接URL 144 | final url = "https://douban.uieee.com/v2/movie/top250?start=$start&count=$count"; 145 | 146 | // 2.发送请求 147 | final result = await HttpRequest.request(url); 148 | 149 | // 3.转成模型对象 150 | final subjects = result["subjects"]; 151 | List movies = []; 152 | for (var sub in subjects) { 153 | movies.add(MovieItem.fromMap(sub)); 154 | } 155 | 156 | return movies; 157 | } 158 | } 159 | ``` 160 | 161 | **在home.dart文件中请求数据** 162 | 163 | ![image-20191002160439302](https://tva1.sinaimg.cn/large/006y8mN6gy1g7jx2csputj31h80u01kx.jpg) 164 | 165 | 166 | 167 | ## 二. 界面效果实现 168 | 169 | ### 2.1. 首页整体代码 170 | 171 | 首页整体布局非常简单,使用一个ListView即可 172 | 173 | ```dart 174 | import 'package:douban_app/models/home_model.dart'; 175 | import 'package:douban_app/network/home_request.dart'; 176 | import 'package:douban_app/views/home/childCpns/movie_list_item.dart'; 177 | import 'package:flutter/material.dart'; 178 | 179 | const COUNT = 20; 180 | 181 | class Home extends StatelessWidget { 182 | @override 183 | Widget build(BuildContext context) { 184 | return Scaffold( 185 | appBar: AppBar( 186 | title: Text("首页"), 187 | ), 188 | body: Center( 189 | child: HomeContent(), 190 | ), 191 | ); 192 | } 193 | } 194 | 195 | class HomeContent extends StatefulWidget { 196 | @override 197 | _HomeContentState createState() => _HomeContentState(); 198 | } 199 | 200 | class _HomeContentState extends State { 201 | // 初始化首页的网络请求对象 202 | HomeRequest homeRequest = HomeRequest(); 203 | 204 | int _start = 0; 205 | List movies = []; 206 | 207 | @override 208 | void initState() { 209 | super.initState(); 210 | 211 | // 请求电影列表数据 212 | getMovieTopList(_start, COUNT); 213 | } 214 | 215 | void getMovieTopList(start, count) { 216 | homeRequest.getMovieTopList(start, count).then((result) { 217 | setState(() { 218 | movies.addAll(result); 219 | }); 220 | }); 221 | } 222 | 223 | @override 224 | Widget build(BuildContext context) { 225 | return ListView.builder( 226 | itemCount: movies.length, 227 | itemBuilder: (BuildContext context, int index) { 228 | return MovieListItem(movies[index]); 229 | } 230 | ); 231 | } 232 | } 233 | ``` 234 | 235 | 236 | 237 | ### 2.2. 单独Item局部 238 | 239 | 下面是针对界面结构的分析: 240 | 241 | ![image-20191002163853864](https://tva1.sinaimg.cn/large/006y8mN6gy1g7jy1zd5z8j31cz0u0qv6.jpg) 242 | 243 | 大家按照对应的结构,实现代码即可: 244 | 245 | ```dart 246 | import 'package:douban_app/components/dash_line.dart'; 247 | import 'package:flutter/material.dart'; 248 | 249 | import 'package:douban_app/models/home_model.dart'; 250 | import 'package:douban_app/components/star_rating.dart'; 251 | 252 | class MovieListItem extends StatelessWidget { 253 | final MovieItem movie; 254 | 255 | MovieListItem(this.movie); 256 | 257 | @override 258 | Widget build(BuildContext context) { 259 | return Container( 260 | padding: EdgeInsets.all(10), 261 | decoration: BoxDecoration( 262 | border: Border(bottom: BorderSide(width: 10, color: Color(0xffe2e2e2))) 263 | ), 264 | child: Column( 265 | crossAxisAlignment: CrossAxisAlignment.start, 266 | children: [ 267 | // 1.电影排名 268 | getMovieRankWidget(), 269 | SizedBox(height: 12), 270 | // 2.具体内容 271 | getMovieContentWidget(), 272 | SizedBox(height: 12), 273 | // 3.电影简介 274 | getMovieIntroduceWidget(), 275 | SizedBox(height: 12,) 276 | ], 277 | ), 278 | ); 279 | } 280 | 281 | // 电影排名 282 | Widget getMovieRankWidget() { 283 | return Container( 284 | padding: EdgeInsets.fromLTRB(9, 4, 9, 4), 285 | decoration: BoxDecoration( 286 | borderRadius: BorderRadius.circular(3), 287 | color: Color.fromARGB(255, 238, 205, 144) 288 | ), 289 | child: Text( 290 | "No.${movie.rank}", 291 | style: TextStyle(fontSize: 18, color: Color.fromARGB(255, 131, 95, 36)), 292 | ) 293 | ); 294 | } 295 | 296 | // 具体内容 297 | Widget getMovieContentWidget() { 298 | return Container( 299 | height: 150, 300 | child: Row( 301 | crossAxisAlignment: CrossAxisAlignment.start, 302 | children: [ 303 | getContentImage(), 304 | getContentDesc(), 305 | getDashLine(), 306 | getContentWish() 307 | ], 308 | ), 309 | ); 310 | } 311 | 312 | Widget getContentImage() { 313 | return ClipRRect( 314 | borderRadius: BorderRadius.circular(5), 315 | child: Image.network(movie.imageURL) 316 | ); 317 | } 318 | 319 | Widget getContentDesc() { 320 | return Expanded( 321 | child: Container( 322 | padding: EdgeInsets.symmetric(horizontal: 15), 323 | child: Column( 324 | crossAxisAlignment: CrossAxisAlignment.start, 325 | children: [ 326 | getTitleWidget(), 327 | SizedBox(height: 3,), 328 | getRatingWidget(), 329 | SizedBox(height: 3,), 330 | getInfoWidget() 331 | ], 332 | ), 333 | ), 334 | ); 335 | } 336 | 337 | Widget getDashLine() { 338 | return Container( 339 | width: 1, 340 | height: 100, 341 | child: DashedLine( 342 | axis: Axis.vertical, 343 | dashedHeight: 6, 344 | dashedWidth: .5, 345 | count: 12, 346 | ), 347 | ); 348 | } 349 | 350 | Widget getTitleWidget() { 351 | return Stack( 352 | children: [ 353 | Icon(Icons.play_circle_outline, color: Colors.redAccent,), 354 | Text.rich( 355 | TextSpan( 356 | children: [ 357 | TextSpan( 358 | text: " " + movie.title, 359 | style: TextStyle( 360 | fontSize: 18, 361 | fontWeight: FontWeight.bold 362 | ) 363 | ), 364 | TextSpan( 365 | text: "(${movie.playDate})", 366 | style: TextStyle( 367 | fontSize: 18, 368 | color: Colors.black54 369 | ), 370 | ) 371 | ] 372 | ), 373 | maxLines: 2, 374 | ), 375 | ], 376 | ); 377 | } 378 | 379 | Widget getRatingWidget() { 380 | return Row( 381 | crossAxisAlignment: CrossAxisAlignment.end, 382 | children: [ 383 | StarRating(rating: movie.rating, size: 18,), 384 | SizedBox(width: 5), 385 | Text("${movie.rating}") 386 | ], 387 | ); 388 | } 389 | 390 | Widget getInfoWidget() { 391 | // 1.获取种类字符串 392 | final genres = movie.genres.join(" "); 393 | final director = movie.director.name; 394 | var castString = ""; 395 | for (final cast in movie.casts) { 396 | castString += cast.name + " "; 397 | } 398 | 399 | // 2.创建Widget 400 | return Text( 401 | "$genres / $director / $castString", 402 | maxLines: 2, 403 | overflow: TextOverflow.ellipsis, 404 | style: TextStyle(fontSize: 16), 405 | ); 406 | } 407 | 408 | Widget getContentWish() { 409 | return Container( 410 | width: 60, 411 | child: Column( 412 | mainAxisAlignment: MainAxisAlignment.start, 413 | children: [ 414 | SizedBox(height: 20,), 415 | Image.asset("assets/images/home/wish.png", width: 30,), 416 | SizedBox(height: 5,), 417 | Text( 418 | "想看", 419 | style: TextStyle(fontSize: 16, color: Color.fromARGB(255, 235, 170, 60)), 420 | ) 421 | ], 422 | ), 423 | ); 424 | } 425 | 426 | // 电影简介(原生名称) 427 | Widget getMovieIntroduceWidget() { 428 | return Container( 429 | width: double.infinity, 430 | padding: EdgeInsets.all(12), 431 | decoration: BoxDecoration( 432 | color: Color(0xfff2f2f2), 433 | borderRadius: BorderRadius.circular(5) 434 | ), 435 | child: Text(movie.originalTitle, style: TextStyle(fontSize: 18, color: Colors.black54),), 436 | ); 437 | } 438 | } 439 | ``` 440 | 441 | 442 | 443 | > 备注:所有内容首发于公众号,之后除了Flutter也会更新其他技术文章,TypeScript、React、Node、uniapp、mpvue、数据结构与算法等等,也会更新一些自己的学习心得等,欢迎大家关注 444 | 445 | ![公众号](https://tva1.sinaimg.cn/large/006y8mN6gy1g6gqxq4tvbj30rx0wcgqt.jpg) -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 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 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXCopyFilesBuildPhase section */ 24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 25 | isa = PBXCopyFilesBuildPhase; 26 | buildActionMask = 2147483647; 27 | dstPath = ""; 28 | dstSubfolderSpec = 10; 29 | files = ( 30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 32 | ); 33 | name = "Embed Frameworks"; 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXCopyFilesBuildPhase section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 43 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 44 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 62 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 9740EEB11CF90186004384FC /* Flutter */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 3B80C3931E831B6300D905FE /* App.framework */, 73 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 74 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 78 | ); 79 | name = Flutter; 80 | sourceTree = ""; 81 | }; 82 | 97C146E51CF9000F007C117D = { 83 | isa = PBXGroup; 84 | children = ( 85 | 9740EEB11CF90186004384FC /* Flutter */, 86 | 97C146F01CF9000F007C117D /* Runner */, 87 | 97C146EF1CF9000F007C117D /* Products */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | 97C146EF1CF9000F007C117D /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 97C146EE1CF9000F007C117D /* Runner.app */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 97C146F01CF9000F007C117D /* Runner */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 103 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 104 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 105 | 97C147021CF9000F007C117D /* Info.plist */, 106 | 97C146F11CF9000F007C117D /* Supporting Files */, 107 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 108 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 109 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 110 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 111 | ); 112 | path = Runner; 113 | sourceTree = ""; 114 | }; 115 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 97C146ED1CF9000F007C117D /* Runner */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 128 | buildPhases = ( 129 | 9740EEB61CF901F6004384FC /* Run Script */, 130 | 97C146EA1CF9000F007C117D /* Sources */, 131 | 97C146EB1CF9000F007C117D /* Frameworks */, 132 | 97C146EC1CF9000F007C117D /* Resources */, 133 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 134 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = Runner; 141 | productName = Runner; 142 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 97C146E61CF9000F007C117D /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 1020; 152 | ORGANIZATIONNAME = "The Chromium Authors"; 153 | TargetAttributes = { 154 | 97C146ED1CF9000F007C117D = { 155 | CreatedOnToolsVersion = 7.3.1; 156 | LastSwiftMigration = 0910; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = en; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = 97C146E51CF9000F007C117D; 169 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 97C146ED1CF9000F007C117D /* Runner */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 97C146EC1CF9000F007C117D /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 184 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 185 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 186 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 187 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXResourcesBuildPhase section */ 192 | 193 | /* Begin PBXShellScriptBuildPhase section */ 194 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 195 | isa = PBXShellScriptBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | ); 199 | inputPaths = ( 200 | ); 201 | name = "Thin Binary"; 202 | outputPaths = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | shellPath = /bin/sh; 206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 207 | }; 208 | 9740EEB61CF901F6004384FC /* Run Script */ = { 209 | isa = PBXShellScriptBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | inputPaths = ( 214 | ); 215 | name = "Run Script"; 216 | outputPaths = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 221 | }; 222 | /* End PBXShellScriptBuildPhase section */ 223 | 224 | /* Begin PBXSourcesBuildPhase section */ 225 | 97C146EA1CF9000F007C117D /* Sources */ = { 226 | isa = PBXSourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 230 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXVariantGroup section */ 237 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 97C146FB1CF9000F007C117D /* Base */, 241 | ); 242 | name = Main.storyboard; 243 | sourceTree = ""; 244 | }; 245 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 97C147001CF9000F007C117D /* Base */, 249 | ); 250 | name = LaunchScreen.storyboard; 251 | sourceTree = ""; 252 | }; 253 | /* End PBXVariantGroup section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 257 | isa = XCBuildConfiguration; 258 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 259 | buildSettings = { 260 | ALWAYS_SEARCH_USER_PATHS = NO; 261 | CLANG_ANALYZER_NONNULL = YES; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 267 | CLANG_WARN_BOOL_CONVERSION = YES; 268 | CLANG_WARN_COMMA = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 272 | CLANG_WARN_EMPTY_BODY = YES; 273 | CLANG_WARN_ENUM_CONVERSION = YES; 274 | CLANG_WARN_INFINITE_RECURSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 281 | CLANG_WARN_STRICT_PROTOTYPES = YES; 282 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 288 | ENABLE_NS_ASSERTIONS = NO; 289 | ENABLE_STRICT_OBJC_MSGSEND = YES; 290 | GCC_C_LANGUAGE_STANDARD = gnu99; 291 | GCC_NO_COMMON_BLOCKS = YES; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 299 | MTL_ENABLE_DEBUG_INFO = NO; 300 | SDKROOT = iphoneos; 301 | TARGETED_DEVICE_FAMILY = "1,2"; 302 | VALIDATE_PRODUCT = YES; 303 | }; 304 | name = Profile; 305 | }; 306 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 307 | isa = XCBuildConfiguration; 308 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 309 | buildSettings = { 310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 311 | CLANG_ENABLE_MODULES = YES; 312 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 313 | ENABLE_BITCODE = NO; 314 | FRAMEWORK_SEARCH_PATHS = ( 315 | "$(inherited)", 316 | "$(PROJECT_DIR)/Flutter", 317 | ); 318 | INFOPLIST_FILE = Runner/Info.plist; 319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 320 | LIBRARY_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "$(PROJECT_DIR)/Flutter", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = com.coderwhy.doubanApp; 325 | PRODUCT_NAME = "$(TARGET_NAME)"; 326 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 327 | SWIFT_VERSION = 4.0; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 357 | CLANG_WARN_STRICT_PROTOTYPES = YES; 358 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | DEBUG_INFORMATION_FORMAT = dwarf; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | ENABLE_TESTABILITY = YES; 366 | GCC_C_LANGUAGE_STANDARD = gnu99; 367 | GCC_DYNAMIC_NO_PIC = NO; 368 | GCC_NO_COMMON_BLOCKS = YES; 369 | GCC_OPTIMIZATION_LEVEL = 0; 370 | GCC_PREPROCESSOR_DEFINITIONS = ( 371 | "DEBUG=1", 372 | "$(inherited)", 373 | ); 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 381 | MTL_ENABLE_DEBUG_INFO = YES; 382 | ONLY_ACTIVE_ARCH = YES; 383 | SDKROOT = iphoneos; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | }; 386 | name = Debug; 387 | }; 388 | 97C147041CF9000F007C117D /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 391 | buildSettings = { 392 | ALWAYS_SEARCH_USER_PATHS = NO; 393 | CLANG_ANALYZER_NONNULL = YES; 394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 395 | CLANG_CXX_LIBRARY = "libc++"; 396 | CLANG_ENABLE_MODULES = YES; 397 | CLANG_ENABLE_OBJC_ARC = YES; 398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 399 | CLANG_WARN_BOOL_CONVERSION = YES; 400 | CLANG_WARN_COMMA = YES; 401 | CLANG_WARN_CONSTANT_CONVERSION = YES; 402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 404 | CLANG_WARN_EMPTY_BODY = YES; 405 | CLANG_WARN_ENUM_CONVERSION = YES; 406 | CLANG_WARN_INFINITE_RECURSION = YES; 407 | CLANG_WARN_INT_CONVERSION = YES; 408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = com.coderwhy.doubanApp; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_VERSION = 4.0; 462 | VERSIONING_SYSTEM = "apple-generic"; 463 | }; 464 | name = Debug; 465 | }; 466 | 97C147071CF9000F007C117D /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CLANG_ENABLE_MODULES = YES; 472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 473 | ENABLE_BITCODE = NO; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | INFOPLIST_FILE = Runner/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 480 | LIBRARY_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | PRODUCT_BUNDLE_IDENTIFIER = com.coderwhy.doubanApp; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 487 | SWIFT_VERSION = 4.0; 488 | VERSIONING_SYSTEM = "apple-generic"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147031CF9000F007C117D /* Debug */, 499 | 97C147041CF9000F007C117D /* Release */, 500 | 249021D3217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 97C147061CF9000F007C117D /* Debug */, 509 | 97C147071CF9000F007C117D /* Release */, 510 | 249021D4217E4FDB00AE95B9 /* Profile */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | 517 | }; 518 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 519 | } 520 | --------------------------------------------------------------------------------