Skip to content

Commit

Permalink
merge branch develop/1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yukilzw authored Dec 2, 2020
1 parent ef13a4b commit 9089cc5
Show file tree
Hide file tree
Showing 115 changed files with 1,022 additions and 596 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
98 changes: 64 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
## 斗鱼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/>

#### 包含功能:

- 启动页广告位
- 开播列表上拉加载、下拉刷新、返回顶部
- 列表图片缓存加载优化
Expand Down Expand Up @@ -35,41 +41,65 @@ 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/psc?/V14dALyK4PrHuj/WntOtr8rW56pbv0uxxE6dYv8R*r1q3IS5y8YHO4owO29NBvZWJR3CXVLjmVHX1cv5JPgnaoF4HCJgbTfMqL3EDvwkNwgV..G9y*l40ZUS9c!/r" 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/psc?/V14dALyK4PrHuj/WntOtr8rW56pbv0uxxE6dcV8EXu0frrdM05fMPRCcBoFag7phHK4DO9KLQeRxCipRW8JmEPOOVhwtdEsfi9Hhgp2JrpT5U.i2XiubVY4gTc!/r" 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/psc?/V14dALyK4PrHuj/WntOtr8rW56pbv0uxxE6debrlJgn8CIxgrhdCmEy.dGHkbublqnL.o6xVlsi*.u2aEDNvsx65A1LDd7yLGWHwSZOOrEFt5C1zFv.qOWum9c!/r" width="33%"/>
<img src="http://r.photo.store.qq.com/psb?/V14dALyK4PrHuj/FDYCtFUGAS.FMi0oCu0wzIGhFK3BDzubAXdlZbStLyg!/r/dFIBAAAAAAAA" width="33%"/>
</div>

<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/TmEUgtj9EK6.7V8ajmQrEA.v3CLebmZ5b8LRHhO8nnsOLYWeLAklWaEkbnuPEVGcsOxWftstTBI8mNyFGlIfx*lgZoNk*kTBsoVZH0x4CUk!/b&bo=gAIkBaAFkAsBGaM!&rf=viewer_4&t=5" width="100%">
</td>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrECVARsy0fCbYAj1*vUjq*oSZjP3EWudyjII4fJLiHs*5ltAJWtSabnRtCHJHQX6Ykvp.zqcBl5XHaO9wagfW38U!/b&bo=gAIkBaAFkAsBGaM!&rf=viewer_4&t=5" width="100%">
</td>
</tr>
<tr>
<td >
<img src="http://m.qpic.cn/psc?/V14dALyK4PrHuj/TmEUgtj9EK6.7V8ajmQrEKiIdL3F4nPeWEXz1pzd0CDRSOb8dcz79IkIWSJnIoMDQEy1pAxJ8e5dkfpQ6VAodlWHtS3eT4bpeMw9cn6g980!/b&bo=gAIkBaAFkAsBGaM!&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>

#### 调试:
服务端接口没有上云,如需本地启动该项目调试,可修改`lib/base.dart``DYBase.baseHost`为内网本机IP,并确保手机与电脑在同一局域网且能访问内网1236端口<br/>
#### 本地调试:
`flutter run --release`打包发布版本预览<br/>
APP所有数据均来源Mock网络请求,服务端接口没有上云,可修改`lib/base.dart``DYBase.baseHost`为你的电脑IP,并确保手机与电脑在同一局域网且能访问内网`1236`端口<br/>
然后clone[服务端仓库](https://github.com/yukilzw/factory),本地启动服务器<br/>
Mock服务为python tornado,两种简单启动方式可选(1.安装py3.6与pip依赖,2.使用Docker镜像),具体参考其README

PS:**因第三方插件版本兼容性不可控,请严格按照`pubspec.lock`的版本安装依赖启动**
PS:**请在安卓设备下运行,IOS下XCOODE编译目前需要Flutter版本为1.12+,但三方插件并未支持**

#### 建议:
使用Material自带的widget进行搭配使用,已经能满足绝大部分场景的开发需求<br/>
但是在企业级APP高度UI交互定制化的场景下,仍需要根据业务场景重新实现诸如AppBar、TabView等widget,并编写手势交互<br/>
Mock服务为`python tornado`,两种简单启动方式可选(1.在py3.6+环境下pip依赖,2.使用Docker镜像),具体参考其README

#### 入门推荐:
[Dart语法](https://www.dartcn.com/guides/get-started) - 语法中文教程<br/>
[Dart SDK(英)](https://api.dartlang.org/stable/2.4.0/index.html) - flutter只集成了部分SDK<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.

14 changes: 7 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,10 @@ 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 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -56,8 +59,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"
}
39 changes: 26 additions & 13 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,51 @@
<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="斗鱼直播"
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>
14 changes: 0 additions & 14 deletions android/app/src/main/java/com/example/dy_flutter/MainActivity.java

This file was deleted.

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

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
Binary file removed android/app/src/main/res/drawable/ic_launcher.png
Binary file not shown.
Binary file added android/app/src/main/res/mipmap-hdpi/dy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Binary file not shown.
Binary file added android/app/src/main/res/mipmap-mdpi/dy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Binary file not shown.
Binary file added android/app/src/main/res/mipmap-xhdpi/dy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Binary file not shown.
Binary file added android/app/src/main/res/mipmap-xxhdpi/dy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added android/app/src/main/res/mipmap-xxxhdpi/dy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading

0 comments on commit 9089cc5

Please sign in to comment.