Skip to content

Commit 73a064b

Browse files
committed
1、更新Flutter环境为1.12.13+hotfix.6 • channel beta,修改更新后部分UI显示变化问题,修复runApp前进行平台通信需先初始化WidgetsFlutterBinding问题;
2、更新修改部分依赖库版本,解决更新后兼容问题; 3、Android部分适配为AndroidX,gradle版本更新为“gradle-5.4.1-all”,gradle tool版本更新为3.5.3
1 parent d59201a commit 73a064b

File tree

9 files changed

+182
-67
lines changed

9 files changed

+182
-67
lines changed

android/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ android {
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
//开源版注释掉
@@ -74,6 +74,6 @@ flutter {
7474

7575
dependencies {
7676
testImplementation 'junit:junit:4.12'
77-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
78-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
77+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
78+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
7979
}

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.2.1'
8+
classpath 'com.android.tools.build:gradle:3.5.3'
99
}
1010
}
1111

android/gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Sat Dec 21 18:36:19 CST 2019
22
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-4.10.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

lib/main.dart

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class GlobalBlocDel extends BlocDelegate {
6868
}
6969

7070
void main() async {
71+
WidgetsFlutterBinding.ensureInitialized();
7172
await SystemChrome.setPreferredOrientations(
7273
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
7374
BlocSupervisor.delegate = GlobalBlocDel();

lib/page/account/login_wanandroid_page.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ class _LoginCardState extends State<LoginCard> {
366366
await SPUtil.setLogin(true);
367367
await SPUtil.setUserName(username);
368368
print('_LoginCardState : login success');
369-
Navigator.of(context).pop();
369+
Navigator.of(context).pop(true);
370370
return;
371371
} catch (e) {
372372
DisplayUtil.showMsg(context, exception: e);
@@ -390,7 +390,7 @@ class _LoginCardState extends State<LoginCard> {
390390
await SPUtil.setLogin(true);
391391
await SPUtil.setUserName(username);
392392
print('_LoginCardState : login success');
393-
Navigator.of(context).pop();
393+
Navigator.of(context).pop(true);
394394
return;
395395
} catch (e) {
396396
DisplayUtil.showMsg(context, exception: e);

lib/page/home/home/home_page.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
289289
: res.searchTips,
290290
border: InputBorder.none,
291291
contentPadding: EdgeInsets.only(),
292+
isDense: true,
292293
hintStyle: TextStyle(
293294
fontSize: 12,
294295
color: isSearchWXArticle
@@ -341,7 +342,7 @@ class _HomePageState extends State<HomePage> with TickerProviderStateMixin {
341342
indicatorColor: Colors.white,
342343
tabs: tabs.keys.map((title) {
343344
return Padding(
344-
padding: EdgeInsets.symmetric(vertical: pt(10), horizontal: pt(6)),
345+
padding: EdgeInsets.symmetric(vertical: 0, horizontal: pt(6)),
345346
child: Text(
346347
title,
347348
style: TextStyle(fontSize: 15),

0 commit comments

Comments
 (0)