Skip to content

Commit cd750b3

Browse files
committed
[perf]:[Fix the display issue of the tabbar in Flutter 3.22.] LianjiaTech#537
1 parent 80261f3 commit cd750b3

File tree

5 files changed

+41
-15
lines changed

5 files changed

+41
-15
lines changed

example/android/app/build.gradle

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
plugins {
3+
id "com.android.application"
4+
id "kotlin-android"
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
18
def localProperties = new Properties()
29
def localPropertiesFile = rootProject.file('local.properties')
310
if (localPropertiesFile.exists()) {
@@ -21,10 +28,6 @@ if (flutterVersionName == null) {
2128
flutterVersionName = '1.0'
2229
}
2330

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2831
android {
2932
compileSdkVersion flutter.compileSdkVersion
3033

example/android/gradle/wrapper/gradle-wrapper.properties

+1-1
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-6.7-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip

example/android/settings.gradle

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}
9+
settings.ext.flutterSdkPath = flutterSdkPath()
210

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
11+
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
512

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
13+
repositories {
14+
google()
15+
mavenCentral()
16+
gradlePluginPortal()
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
21+
}
22+
}
23+
24+
plugins {
25+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26+
id "com.android.application" version "7.3.0" apply false
27+
}
28+
29+
30+
include ':app'

example/pubspec.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ dependencies:
2828
flutter_easyrefresh: ^2.2.1
2929
lpinyin: ^2.0.3
3030
badges: ^2.0.2
31-
intl: ^0.18.0
31+
intl: 0.19.0
3232

3333
dev_dependencies:
3434
flutter_test:
3535
sdk: flutter
3636
dependency_overrides:
3737
bruno:
3838
path: ../
39+
intl: 0.19.0
3940

4041

4142
# For information on the generic Dart part of this file, see the

lib/src/components/tabbar/normal/brn_tab_bar.dart

+4-1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ class BrnTabBarState extends State<BrnTabBar> {
261261
widget.tabWidth != null ||
262262
widget.isScroll;
263263
return TabBar(
264+
tabAlignment: _isScrollable ? TabAlignment.start : TabAlignment.fill,
264265
tabs: fillWidgetByDataList(_isScrollable),
265266
controller: widget.controller,
266267
isScrollable: _isScrollable,
@@ -273,6 +274,8 @@ class BrnTabBarState extends State<BrnTabBar> {
273274
unselectedLabelStyle: widget.unselectedLabelStyle ??
274275
widget.themeData!.unselectedLabelStyle.generateTextStyle(),
275276
dragStartBehavior: widget.dragStartBehavior,
277+
dividerColor: Colors.transparent,
278+
dividerHeight: 0,
276279
onTap: (index) {
277280
if (widget.onTap != null) {
278281
widget.onTap!(this, index);
@@ -408,7 +411,7 @@ class BrnTabBarState extends State<BrnTabBar> {
408411
color: Color(0xFFFFFFFF), fontSize: 10, height: 1),
409412
),
410413
backgroundColor: Colors.red,
411-
alignment: AlignmentDirectional(_paddingRight, _paddingTop),
414+
alignment: AlignmentDirectional(1.4, -1.8),
412415
padding: _badgePadding,
413416
largeSize: _largeSize,
414417
child: Text(

0 commit comments

Comments
 (0)