Skip to content

Commit

Permalink
Merge pull request #1 from yukilzw/master
Browse files Browse the repository at this point in the history
update code
  • Loading branch information
larryluo1212 authored Feb 2, 2021
2 parents 37bfdaa + 71f6cf2 commit ba0f006
Show file tree
Hide file tree
Showing 150 changed files with 2,416 additions and 1,447 deletions.
48 changes: 8 additions & 40 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

# IntelliJ related
*.iml
!dy_flutter.iml
*.ipr
*.iws
.idea/
Expand All @@ -23,51 +22,20 @@

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# Web related
lib/generated_plugin_registrant.dart

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Symbolication related
app.*.symbols

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# Obfuscation related
app.*.map.json
2 changes: 1 addition & 1 deletion .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: b712a172f9694745f50505c93340883493b505e5
revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818
channel: stable

project_type: app
110 changes: 76 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,67 @@
## 斗鱼APP
![Flutter](https://img.shields.io/badge/Flutter-1.9.1-52c6f9.svg)
<p align="center"><img width="95" src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEE6*Uxu7pEUvrF6buDAC1qQBtOPo9FXPTzYdO3pyFiogvuA4HNDBer8u1KJY71acYTXx1pnl2uCYv*E1JIoixbA!/b&bo=AAEAAQABAAEDGTw!&rf=viewer_4&t=5" alt="斗鱼APP"></p>

<p align="center">
<img src="https://img.shields.io/badge/flutter-1.22-52c6f9.svg?sanitize=true" alt="flutter-1.22">
<img src="https://img.shields.io/badge/android✔-brightgreen.svg?sanitize=true" alt="android✔">
<img src="https://img.shields.io/badge/ios✔-green.svg?sanitize=true" alt="ios✔">
</p>

<h2 align="center">斗鱼Flutter</h2>

flutter重构的斗鱼直播APP<br/>
首页、娱乐为Material组件开发;直播间、鱼吧为纯自定义编写。<br/>
首页、娱乐为Material组件;直播间、鱼吧为纯自定义编写。<br/>
另外整合各类优质的第三方开源库,打造出原生APP丝滑的用户体验<br/>
尽可能接入更多功能,方法附带注释,帮助你在使用flutter进行开发新的应用提供实用的借鉴案例<br/>

#### 包含功能:
#### APP截图:
<table>
<tr>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/bqQfVz5yrrGYSXMvKr.cqaBgyoLMU7RqFQMjF1E5rBSN69..NZhiO89.yrgXkS6mTUwd*cb3ZSTIIiw5.iYRqBJZNdmErVng83zgFyZw3fA!/b&bo=gAIkBaAFkAsBCbM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/bqQfVz5yrrGYSXMvKr.cqXLF*aVasp07p*Gto1g39y8aZOuyCwiCZ7OE4qg0HlHdSGC23z.kMOk6TRSl.Vz42C*KqGEkKzgahqZfA2ioU*I!/b&bo=gAIkBaAFkAsBCbM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/bqQfVz5yrrGYSXMvKr.cqQlzJYlZpjmaYqbMmmVlIfygeiYM7LMzpr7UEBdem9TURt*pkPlyK3fFvGk2eY.I1BtAX74KahT368qwSMIKP1U!/b&bo=gAIkBaAFkAsBCbM!&rf=viewer_4&t=5" width="100%">
</td>
</tr>
<tr>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/bqQfVz5yrrGYSXMvKr.cqThM.g*uqbv34APs2xUD795zzub.0Dc8*QFXGyRSc7aopK1TUkZnVFCO5cqvOO1r6O2UtjD0Pki0Gzza5R4dz*M!/b&bo=gAIkBaAFkAsBCbM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEH6IpnXld6FGQQHdyvv0dLAOgZN7.9jzMpMWHejoGTEWbMkYbRrkaNVCXPTTnsi*4.lOPqKEZadxwy1njSC.bKk!/b&bo=gAIkBaAFkAsBKZM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrED*reHLmlDRzT43e6kiwzMNhOMGjGzslRl.TYS3MkfnDKtzoxbNkkju8Iw9N2ow5hMWNsTJCTxQaeREAlNtHwFI!/b&bo=gAIkBaAFkAsBGaM!&rf=viewer_4&t=5" width="100%">
</td>
</tr>
<tr>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEB*oC0jYr45N4XNhdrM1yAK99Mcrs92abHL8zMWGarZ3xk7c*crdD2eEW1ssMDQZEsH16hosf0rnp7PDRpI5ZnM!/b&bo=gAIkBaAFkAsBKZM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEEpYPJsokdhxS8ZJPdpyd4h7j0uwUEiyDXHhRSKB1aE9k0hf6Xmlq59g.MpMZfuojsn1UTeWD.8PwerbFzTpbPc!/b&bo=gAIkBaAFkAsBKZM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEOh8XZsi9bmSt55Q14bJBlbYyAzKf5RbGbeUGWmFAxFhVdq67Knce623EQWtUn42Oa9qXI3YMTEZcWtuvQsK4f4!/b&bo=gAIkBaAFkAsBGaM!&rf=viewer_4&t=5" width="100%">
</td>
</tr>
<tr>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEDZiySLBOghulMLa1J1SlA4yTA36ua0sJUKydayYdoQZuD11ksRfY5qQmZ6btw4U*rnYx2PjZh96GWn.8kmAkJk!/b&bo=gAIkBaAFkAsBGaM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrECX7UhQoMNbn.zaa1QTctnsdRMEaz9AHVMnQkhVJAIXK1OsjW9SCcVyZM5jo5MF*rrrS4wwdM3w*U7wO8wtfc3U!/b&bo=gAIkBaAFkAsBKZM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/bqQfVz5yrrGYSXMvKr.cqRGurtWW.dwJkBUlUai8n4M4RsCOUjgHRB61DR8473rvOz45Cgd2lDota9bBNfr1E*ViYKY6mDz7ssJG6bBiOqU!/b&bo=gAIkBaAFkAsBCbM!&rf=viewer_4&t=5" width="100%">
</td>
</tr>
</table>

#### 包含功能:
- 启动页广告位
- 开播列表上拉加载、下拉刷新、返回顶部
- 列表图片缓存加载优化
Expand All @@ -19,6 +73,7 @@ flutter重构的斗鱼直播APP<br/>
- RxDart全局消息通信封装
- Bloc流式状态管理(启动页预加载首页数据)
- 礼物横幅动画队列
- 礼物特效全屏lottie
- 弹幕消息滚动
- 静态视频流
- 九宫格抽奖游戏
Expand All @@ -29,42 +84,29 @@ flutter重构的斗鱼直播APP<br/>
- 登录注册弹窗
- 国家区号列表(仿微信通讯录滑动首字母定位)
- 二维码扫码
- 本地通知推送
- ...
- 持续增加中

#### APP截图:
<div>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/OFSw8qFQ6ZTt4Qry.FD5zxLEOyTxOJDRc0zUeDKvTgU!/r/dMMAAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/685pfsLni*gxLbtOu3m8rTJQrAtVlvduwge2.8GhtvA!/r/dFQBAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/SOcvvERqiEdx92of45wZ5QROd09kd717ct9R*v*zK3U!/r/dLYAAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/c4ql4M5xWstDQx.QsoTQOTZCw7UuPf9zUgCjqG23tOo!/r/dLYAAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/q08JBttKNyQCzGtnK2d6X3J.9ZT6SO7cx4ypcpg75p0!/r/dFQBAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/L23jnwqMYB9PdLQ2KUvoK3ejQY1dwrbxA7fUWybKyxs!/r/dL8AAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/7iQScOrnyUP*YwqZOCmDrspGoHWj3Dn3LZjh4T8xjA8!/r/dMMAAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/N7jxyxYZx8JWGXHdk6FNCFuwTJRTjvC3Z.wsN48cRRo!/r/dL8AAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/flPcnoB6*50r8Ea7Cd.zBJCO3BDa9nDHTlKIQ4pO0P4!/r/dLgAAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/xaywxG66Hc9Vgx07lrK4riFSWSo4*eM2VjBhpu44PBc!/r/dLgAAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/c*G7Ez9KpndmkA2O6rTJx108ZFise249wTfNaCG6UVg!/r/dFIBAAAAAAAA" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/FDYCtFUGAS.FMi0oCu0wzIGhFK3BDzubAXdlZbStLyg!/r/dFIBAAAAAAAA" width="33%"/>
</div>

#### 本地调试:
`flutter run --release`打包发布版本预览<br/>
APP所有数据均来源Mock网络请求,服务端接口没有上云,可修改`lib/base.dart``DYBase.baseHost`为你的电脑IP,并确保手机与电脑在同一局域网且能访问内网`1236`端口<br/>
然后clone[服务端仓库](https://github.com/yukilzw/factory),Mock服务为`python tornado`,两种简单启动方式可选:<br/>
1. 在py 3.6~3.8下启动服务
- 安装`python3.6`环境;
- cmd切换运行环境`cd ./tornado`;
- 加载依赖包 `pip install -r requirements.txt`;
- 启动服务`python main.py`
2. 使用Docker镜像,具体方式参考该项目说明。

#### 调试:
服务端接口没有上云,如需本地启动该项目调试,可修改`lib/base.dart``DYBase.baseHost`为内网本机IP,并确保手机与电脑在同一局域网<br/>
然后clone[服务端仓库](https://github.com/yukilzw/factory),安装python3.6<br/>
进入`./py/tornado`文件夹路径执行`pip install tornado requests`安装依赖,`python main.py`启动接口服务端<br/>

#### 建议:
使用Material自带的widget进行搭配使用,已经能满足绝大部分场景的开发需求<br/>
但是在企业级APP高度UI交互定制化的场景下,仍需要根据业务场景重新实现诸如AppBar、TabView等widget,并编写手势交互<br/>
安卓打包可能因为国内无法加载gradle的问题,就算配了镜像也很慢,建议手动下载`grdle-6.4.1-all.zip`版本再构建,下载安装可见[此文章](https://www.cnblogs.com/yehuabin/p/10344713.html)

#### 入门推荐:
[Dart语法](https://www.dartcn.com/guides/get-started)<br/>
[Dart SDK](https://api.dartlang.org/stable/2.4.0/index.html)<br/>
[Dart语法](https://www.dartcn.com/guides/get-started) - 语法中文教程<br/>
[Flutter中文网](https://flutterchina.club/get-started/install/) - 简单易懂的入门教程<br/>
[Flutter实战](https://book.flutterchina.club/) - 较为全面的进阶教程<br/>
[Flutter官网(英](https://flutter.dev/docs) - 可查阅全部的API与SDK相关<br/>
[Bloc(英](https://felangel.github.io/bloc/#/gettingstarted) - 全局状态管理(除此之外也可选用`redux`或原生`InheritedWidget`)

[Dart SDK(EN](https://api.dartlang.org/stable/2.4.0/index.html) - flutter中可用的SDK<br/>
[Flutter官网(EN](https://flutter.dev/docs) - 可查阅全部的API与SDK相关<br/>
[Bloc(EN)](https://felangel.github.io/bloc/#/gettingstarted) - 全局状态管理

#### dy_flutter为个人项目,仅用作学习交流
#### dy_flutter为个人开源项目,仅用作学习实践
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
17 changes: 0 additions & 17 deletions android/.project

This file was deleted.

2 changes: 0 additions & 2 deletions android/.settings/org.eclipse.buildship.core.prefs

This file was deleted.

6 changes: 0 additions & 6 deletions android/app/.classpath

This file was deleted.

23 changes: 0 additions & 23 deletions android/app/.project

This file was deleted.

2 changes: 0 additions & 2 deletions android/app/.settings/org.eclipse.buildship.core.prefs

This file was deleted.

16 changes: 9 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion 29

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

lintOptions {
disable 'InvalidPackage'
Expand All @@ -35,11 +39,11 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.dy_flutter"
minSdkVersion 19
targetSdkVersion 28
minSdkVersion 18
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

buildTypes {
Expand All @@ -56,8 +60,6 @@ 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"
implementation 'com.android.support:multidex:1.0.3'
}
41 changes: 28 additions & 13 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,52 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- 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
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="dy_flutter"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">

<activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>
android:label="斗鱼Flutter"
android:icon="@mipmap/dy"
android:usesCleartextTraffic="true"
>
<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"/>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</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>
Loading

0 comments on commit ba0f006

Please sign in to comment.