Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter 1.20.1 #97

Open
wants to merge 3 commits into
base: master-new
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 61 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![GitHub stars](https://img.shields.io/github/stars/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/network)
[![GitHub issues](https://img.shields.io/github/issues/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/issues)
[![GitHub issues](https://img.shields.io/github/issues/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/issues)

> Flutter SDK (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.13.6 17G2112, locale zh-Hans-CN, Dart SDK : 2.5.0)

Expand All @@ -16,17 +16,17 @@
**如果您觉得还可以的话,给个Star白~**

# 使用Flutter开发一个豆瓣App

* 此项目,90%还原某瓣APP,所有UI均按照某瓣来实现。
* 项目中的数据均来自豆瓣api真实有效数据
* 项目中用到了几乎所有的Flutter widget
* 还有两个比较大的自定义魔改源码实现特效
* 大年初一也在维护的项目

> APP中所有数据均为真实数据。但是默认,对于"书影音单个电影tab"的数据,使用模拟数据。因为,频繁的打开关闭APP,会频繁调用
这个接口。接口是有调用限制的,次数过于频繁,会被锁IP。如果想看真实数据,则可以进入
"我的",然后打开"书影音数据来自网络"开关后,重启APP即可。

# 下载地址
## [打开新页面扫码下载](https://upload-images.jianshu.io/upload_images/3884536-d9adbda0e5f61c84.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
#### [Release版本下载地址](https://img.xuvip.top/douya_release.apk)
Expand All @@ -35,9 +35,9 @@
![扫一扫下载体验](https://img.xuvip.top/douya.png)







#### Demo(刷不出gif图的,耐心等待一会,或者多刷几次。)
![](https://github.com/kaina404/FlutterDouBan/blob/master-release/0E95A04AE84EFE31104AC8E0A5808CB9.png)
![](https://github.com/kaina404/FlutterDouBan/blob/master-release/041919372752_04CCDD7BC1BDB6015935EE50DDF75C29F.png)
Expand All @@ -47,114 +47,114 @@
![](https://github.com/kaina404/FlutterDouBan/blob/master-release/041919381924_01CE541B98F565C72B75567A319271CA1.png)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-12-55.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-13-11.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-17-38.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-17-48.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-03.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-12.gif)
![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-23.gif)
![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-30-58.gif)
![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-31-13.gif)
![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-29.gif)
![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-41.gif)
![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-33-02.gif)



![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-23.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-30-58.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-31-13.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-29.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-41.gif)

![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-33-02.gif)



# dev-open

### 大家可以向这个分支根据豆瓣UI做设计稿,提交代码

* 这个分支供广大Flutter开发者来学习Flutter
* **此分支囊括了Flutter 90%的组件的基本与组合使用**,是初学者真正实践的不错选择
* 在此豆芽APP的首页实现与影片详情的UI特效,基于魔改Flutter源码。有兴趣可以看看
* 大家想实战自己的Flutter能力,可以将某瓣APP作为设计稿,完成需求,并提交
* 每位开发者提交的代码,我都会在文档中进行备注

#### 注意!!!建议使用模拟数据(mock_request.dart)
* 每个接口均有一定的调用限制
* *大家pull下的代码,进行测试调试时,对于特定接口,返回的特定数据。尽量不要每次求请求一次。可以请求到一次真实数据后,转成json保存
到本地。然后,自己调试开发的时候,使用这个模拟数据即可。* [可参考mock_request.dart]



# 未来版本计划(欢迎Flutter爱好者前来认领)

**欢迎Flutter爱好者共同完成**

> 涉及到UI,可参考豆瓣。

### 萌新TASK

* 完成任意一个未实现的按钮
* 完成任意一个未实现的页面
* 优化原有Widget
* 爱好者想实现但是未能实现的需求
* More ...

### 进阶TASK

* 优化代码
* 适当缓存数据
* 解决卡顿(可参考:https://flutter-io.cn/docs/testing/ui-performance)
* 优化路由(可参考咸鱼方案:https://www.yuque.com/xytech/flutter/vf1dpf)

### 老手TASK

* [接入rxdart](https://github.com/ReactiveX/rxdart)
* [使用Fish Redux 重构](https://www.yuque.com/xytech/flutter/ycc9ni)



# 对魔改源码或者喜欢翻源码的童鞋可以看看下面两个

* 魔改Flutter AppBar源码实现豆瓣头部特效

![魔改Flutter AppBar源码实现豆瓣头部特效](https://github.com/kaina404/DouBanProject/blob/dev-0.1/%E4%BB%BF%E8%B1%86%E7%93%A3%E5%A4%B4%E9%83%A8.gif)

* 魔改源码实现电影详情抽屉特效(GIF图如果加载不出来,多刷几次)

![抽屉特效1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/part1.gif)

![抽屉特效2](https://github.com/kaina404/DouBanProject/blob/dev-0.1/part2.gif)

![抽屉特效3](https://github.com/kaina404/DouBanProject/blob/dev-0.1/part3.gif)


# 页面介绍

* 首页 pages/home

* homo_app_bar.dart 首页导航头
* home_page.dart 首页
* my_home_tab_bar.dart 首页tab

* 书影音 pages/movie

* book_audio_video_page.dart 书影音页面
* detail_page.dart 影片、电视详情页面
* person_detail_page.dart 演员页面介绍
* ... 页面都有注释

* 小组 pages/group
* 市集 shop_page.dart

* 市集 shop_page.dart
* 市集的数据使用两个webview

* 我的 page/person



# 更新记录

Expand All @@ -164,7 +164,7 @@
* 优化页面逻辑
* 优化加载速度

* master
* master
* 基本网络请求框架、UI框架
* 已经填入了"最为复杂的电影TAB页面"、影视详情页面、小组页面(UI与豆瓣一致,数据使用的是热映榜)
* 页面上下滑动
Expand All @@ -173,7 +173,7 @@
* TAB页面滑动
* ....
* 作为基本版本,一些逻辑不够完善,有一些bug。

# 默认条约

此项目仅供大家交流沟通使用,不得用于任何商业以及利益活动。由此引起的责任,跟我无关。谢谢!
Expand All @@ -193,7 +193,7 @@ A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.io/docs), which offers tutorials,
For help getting started with Flutter, view our
[online documentation](https://flutter.io/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

11 changes: 11 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
11 changes: 6 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,26 @@ if (flutterVersionName == null) {
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.doubanapp"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -55,7 +58,5 @@ flutter {
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
33 changes: 23 additions & 10 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.doubanapp">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand All @@ -13,27 +12,41 @@

<application
android:name="io.flutter.app.FlutterApplication"
android:label="豆芽"
android:usesCleartextTraffic="true"
android:label="FlutterDouBan"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
13 changes: 0 additions & 13 deletions android/app/src/main/java/com/example/doubanapp/MainActivity.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.doubanapp

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
10 changes: 10 additions & 0 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.

This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@android:color/white</item>
</style>
</resources>
Loading