Skip to content

Commit ef070f2

Browse files
committed
flutter sdk升级最新版本
video_player报错,无奈,删除了封装的库 还有其它部分的错误更改
1 parent 168d37e commit ef070f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+331
-2593
lines changed

.gitignore

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
.buildlog/
99
.history
1010
.svn/
11-
.gradle
12-
1311

1412
# IntelliJ related
1513
*.iml
@@ -26,50 +24,14 @@
2624
**/doc/api/
2725
.dart_tool/
2826
.flutter-plugins
27+
.flutter-plugins-dependencies
2928
.packages
3029
.pub-cache/
3130
.pub/
3231
/build/
3332

34-
# Android related
35-
**/android/**/gradle-wrapper.jar
36-
**/android/.gradle
37-
**/android/captures/
38-
**/android/gradlew
39-
**/android/gradlew.bat
40-
**/android/local.properties
41-
**/android/**/GeneratedPluginRegistrant.java
42-
43-
# iOS/XCode related
44-
**/ios/**/*.mode1v3
45-
**/ios/**/*.mode2v3
46-
**/ios/**/*.moved-aside
47-
**/ios/**/*.pbxuser
48-
**/ios/**/*.perspectivev3
49-
**/ios/**/*sync/
50-
**/ios/**/.sconsign.dblite
51-
**/ios/**/.tags*
52-
**/ios/**/.vagrant/
53-
**/ios/**/DerivedData/
54-
**/ios/**/Icon?
55-
**/ios/**/Pods/
56-
**/ios/**/.symlinks/
57-
**/ios/**/profile
58-
**/ios/**/xcuserdata
59-
**/ios/.generated/
60-
**/ios/Flutter/App.framework
61-
**/ios/Flutter/Flutter.framework
62-
**/ios/Flutter/Generated.xcconfig
63-
**/ios/Flutter/app.flx
64-
**/ios/Flutter/app.zip
65-
**/ios/Flutter/flutter_assets/
66-
**/ios/Flutter/flutter_export_environment.sh
67-
**/ios/ServiceDefinitions.json
68-
**/ios/Runner/GeneratedPluginRegistrant.*
33+
# Web related
34+
lib/generated_plugin_registrant.dart
6935

7036
# Exceptions to above rules.
71-
!**/ios/**/default.mode1v3
72-
!**/ios/**/default.mode2v3
73-
!**/ios/**/default.pbxuser
74-
!**/ios/**/default.perspectivev3
7537
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

.metadata

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: cc949a8e8b9cf394b9290a8e80f87af3e207dce5
7+
revision: 27321ebbad34b0a3fafe99fac037102196d655ff
88
channel: stable
99

1010
project_type: app

README.md

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,16 @@
1-
# FlutterWant
1+
# flutter_want
22

3-
>项目是基于 luoGuoXiong 的 easyMarketFlutter 而写的,其中前三个模块的接口也是其项目用的api,其次,再次非常感谢luoGuoXiong,作为一个初学者,给我提供了非常大的帮,希望对大家有用.
4-
>
5-
>需要注意,项目中使用了kotlin,编译不通过的,注意更改build文件
6-
>
7-
### [Peroluo(给他点赞)](https://github.com/Peroluo)
8-
>
9-
### [easyMarketFlutter地址](https://github.com/Peroluo/easyMarketFlutter)
10-
>
11-
>
12-
## [关于我](https://github.com/softfatgay)
3+
A new Flutter application.
134

14-
## [demo.apk下载地址](https://www.pgyer.com/QjBP)
5+
## Getting Started
156

7+
This project is a starting point for a Flutter application.
168

17-
## 在此基础上增加的一些功能
9+
A few resources to get you started if this is your first Flutter project:
1810

19-
>1.为了演示与luoGuoXiong使用的Dio网络库对比,把几个接口返回数据进行了封装,直接解析成大家比较直观的java Model类型
20-
>
21-
>2.添加了flutter与安卓原生的交互,调用安卓activity,并为其传递参数
22-
>
23-
>3.为了方便大家理解,项目目录重新划分,以文件的形式,把各个模块区分
24-
>
25-
>4.其中实现比较复杂的模块,使用了比较简单的形式实现
26-
>
27-
>5.其中部分模块实现安卓原生吸附的效果
28-
>
29-
>6.拍照/相册(我的界面,点击图像),弹出框等其他一些内容
30-
>
31-
>7.视频播放(chewie,更改了源码,添加全屏标题返回键,双击手势等一些UI改动)
32-
>
33-
>8.增加搜索功能,封装有StafulWidget的组件,带回调参数的,供大家参考(搜索框)
34-
>
35-
>9.富文本,以及富文本点击事件,跳转安卓原生Webview等其他一些功能
36-
>
37-
>10.后续我会持续更新此项目,也会持续跟进luoGuoXiong的项目,由于本人没有api接口,只能用他的😀😁😂😃😄
11+
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
3813

39-
## 使用的第三方库
40-
1. [Flutter中文网](https://flutterchina.club/)
41-
2. [Dio](https://pub.flutter-io.cn/packages/dio)
42-
3. [webview_flutter](https://pub.flutter-io.cn/packages/webview_flutter)
43-
4. [cached_network_image](https://pub.flutter-io.cn/packages/cached_network_image)
44-
5. [flutter_swiper](https://pub.flutter-io.cn/packages/flutter_swiper)
45-
6. [Toast](https://pub.flutter-io.cn/packages/toast)
46-
7. [flutter_html](https://pub.flutter-io.cn/packages/flutter_html)
47-
8. [image_picker](https://pub.flutter-io.cn/packages/image_picker)
48-
9. [common_utils](https://pub.flutter-io.cn/packages/common_utils)
49-
10. [package_info](https://pub.flutter-io.cn/packages/package_info)
50-
>
51-
>
52-
53-
54-
55-
## 最后
56-
*谢谢大家
57-
>
58-
*站在巨人的肩上才能看的更远,一起学习
59-
>
60-
*我的邮箱 [email protected]
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.dev/docs), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.

android/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java

android/app/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {
88

99
def flutterRoot = localProperties.getProperty('flutter.sdk')
1010
if (flutterRoot == null) {
11-
// throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
1212
}
1313

1414
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
@@ -38,12 +38,12 @@ android {
3838

3939
defaultConfig {
4040
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "com.example.want"
41+
applicationId "com.example.flutter_want"
4242
minSdkVersion 16
4343
targetSdkVersion 28
4444
versionCode flutterVersionCode.toInteger()
4545
versionName flutterVersionName
46-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
46+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4747
}
4848

4949
buildTypes {
@@ -62,9 +62,8 @@ flutter {
6262
dependencies {
6363
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6464
testImplementation 'junit:junit:4.12'
65-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
66-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
65+
androidTestImplementation 'androidx.test:runner:1.1.1'
66+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
6767
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
6868
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
69-
7069
}

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.want">
2+
package="com.example.flutter_want">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->

android/app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.want">
3-
2+
package="com.example.flutter_want">
43
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
54
calls FlutterMain.startInitialization(this); in its onCreate method.
65
In most cases you can leave this as-is, but you if you want to provide
76
additional functionality it is fine to subclass or reimplement
87
FlutterApplication and put your custom class here. -->
8+
99
<uses-permission android:name="android.permission.INTERNET"/>
1010
<uses-permission android:name="android.permission.WAKE_LOCK" />
1111
<application
1212
android:name="io.flutter.app.FlutterApplication"
13-
android:label="FlutterWant"
14-
android:theme="@style/AppTheme"
13+
android:label="flutter_want"
1514
android:icon="@mipmap/ic_launcher">
1615
<activity
1716
android:name=".MainActivity"
1817
android:launchMode="singleTop"
1918
android:theme="@style/LaunchTheme"
20-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
19+
android:usesCleartextTraffic="true"
20+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2121
android:hardwareAccelerated="true"
2222
android:windowSoftInputMode="adjustResize">
23-
<!-- This keeps the window background of the activity showing
24-
until Flutter renders its first frame. It can be removed if
25-
there is no splash screen (such as the default splash screen
26-
defined in @style/LaunchTheme). -->
27-
<meta-data
28-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
29-
android:value="true" />
3023
<intent-filter>
3124
<action android:name="android.intent.action.MAIN"/>
3225
<category android:name="android.intent.category.LAUNCHER"/>
3326
</intent-filter>
3427
</activity>
28+
<!-- Don't delete the meta-data below.
29+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30+
<meta-data
31+
android:name="flutterEmbedding"
32+
android:value="2" />
3533

3634
<activity android:name=".WebViewActivity" />
3735
</application>

android/app/src/main/kotlin/com/example/want/Const.java renamed to android/app/src/main/kotlin/com/example/flutter_want/Const.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.want;
1+
package com.example.flutter_want;
22

33
public class Const {
44
static final String flutterJumpActivity = "com.example.want/flutter2activity";

android/app/src/main/kotlin/com/example/want/FlutterPluginCounter.java renamed to android/app/src/main/kotlin/com/example/flutter_want/FlutterPluginCounter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.want;
1+
package com.example.flutter_want;
22

33
import android.app.Activity;
44
import android.util.Log;

android/app/src/main/kotlin/com/example/want/FlutterPluginJumpToActivity.java renamed to android/app/src/main/kotlin/com/example/flutter_want/FlutterPluginJumpToActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.want;
1+
package com.example.flutter_want;
22

33
import android.app.Activity;
44
import android.content.Intent;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.example.flutter_want
2+
3+
import androidx.annotation.NonNull
4+
import io.flutter.embedding.android.FlutterActivity
5+
import io.flutter.embedding.engine.FlutterEngine
6+
import io.flutter.plugins.GeneratedPluginRegistrant
7+
8+
class MainActivity: FlutterActivity() {
9+
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10+
GeneratedPluginRegistrant.registerWith(flutterEngine)
11+
}
12+
}

android/app/src/main/kotlin/com/example/want/WebViewActivity.java renamed to android/app/src/main/kotlin/com/example/flutter_want/WebViewActivity.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
package com.example.want;
1+
package com.example.flutter_want;
22

33
import android.app.Activity;
44
import android.os.Bundle;
5-
import android.view.View;
65
import android.webkit.WebView;
76
import android.webkit.WebViewClient;
8-
9-
import java.io.Serializable;
107
import java.util.HashMap;
118

129
public class WebViewActivity extends Activity {

android/app/src/main/kotlin/com/example/want/MainActivity.kt

Lines changed: 0 additions & 23 deletions
This file was deleted.

android/app/src/main/res/values/styles.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Flutter draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
</style>
9+
910
<style name="AppTheme" parent="@android:style/Theme.Light.NoTitleBar">
10-
<!-- <item name="android:windowBackground">@null</item>-->
11+
<!-- <item name="android:windowBackground">@null</item>-->
1112
</style>
1213
</resources>

android/app/src/profile/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.flutter_app">
2+
package="com.example.flutter_want">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.1'
9+
classpath 'com.android.tools.build:gradle:3.5.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

android/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2-
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

android/res/values/strings_en.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

ios/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3

ios/Flutter/Debug.xcconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
21
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
21
#include "Generated.xcconfig"

0 commit comments

Comments
 (0)