Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BrnTabBar 字体设置大小无效 #421

Open
IvanYue opened this issue Feb 7, 2023 · 7 comments
Open

BrnTabBar 字体设置大小无效 #421

IvanYue opened this issue Feb 7, 2023 · 7 comments

Comments

@IvanYue
Copy link

IvanYue commented Feb 7, 2023

问题提交

标题格式:[BUG]: BrnTabBar 字体设置大小无效

内容需包含:

1、BUG 描述

BrnTabBar 字体设置大小无效,themeData设置后也不会改变大小。

2、复现步骤

BrnTabBar(
              mode: BrnTabBarBadgeMode.origin,
              labelPadding: const EdgeInsets.only(right: 45),
              indicatorPadding: const EdgeInsets.only(bottom: 8, right: 45),
              unselectedLabelStyle: AppTextThem.regularStyle.copyWith(
                  fontSize: 18,
                  color: const Color(0xFF1B1A21).withOpacity(0.4)),
              labelStyle: AppTextThem.mediumStyle
                  .copyWith(fontSize: 22, color: const Color(0xFF1B1A21)),
              backgroundcolor: Colors.transparent,
              indicatorColor: Colors.transparent,
              isScroll: false,
              tabWidth: 80,
              indicatorWeight: 3,
              indicatorWidth: 18.5.w,
              onTap: (state, int index) {},
              // themeData: BrnTabBarConfig(
              //     unselectedLabelStyle: BrnTextStyle(fontSize: 18),
              //     tagSelectedTextStyle: BrnTextStyle(fontSize: 22)),
              // tabHeight: 10,
              controller: controller.tabController,
              tabs: [
                BadgeTab(text: "推荐"),
                BadgeTab(text: "新闻"),
                BadgeTab(text: "案例")
              ]),

3、期望行为
字体大小改变
4、运行环境
mac 13.1 VSCode版本: 1.75.0 (Universal)

  • 运行设备: iPhone6s
  • 系统 :ios15.7
  • Bruno 版本 : 3.3.0
  • Flutter Doctor 信息
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.1 22C65 darwin-arm64 (Rosetta), locale zh-Hans-CN)
    • Flutter version 3.7.1 on channel stable at /Users/jdny/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7048ed95a5 (6 days ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/jdny/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/jdny/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.75.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (1 available)
    • iPhone (mobile) • 723dxx332e0602f7 • ios • iOS 15.7 19H12

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

5、附加信息

包括视频、图片等补充信息

@JayceV552
Copy link
Contributor

Hi @IvanYue 应该是你的AppTextThem.mediumStyle.copyWith有问题,直接对labelStyle设置TextStyle 可以生效

unselectedLabelStyle: TextStyle(
   fontSize: 28,
   color: const Color(0xFF1B1A21).withOpacity(0.4),
),
labelStyle: TextStyle(fontSize: 28, color: const Color(0xFF1B1A21)),

image

@IvanYue
Copy link
Author

IvanYue commented Feb 8, 2023

清理了缓存,测试后发现。
1.Bruno 3.2.0版本的BrnTabbar可以修改字体大小,Bruno 3.3.0 版本的BrnTabbar不能修改字体大小。
2.全局设置 MaterialApp(theme:ThemeData(useMaterial3:true))后,BrnTabbar 下面会出现一条白线,Flutter自带 TabBar 也会出现。

@zhoujuanjuan
Copy link
Collaborator

你好,请描述具体是哪个字段的 fontsize 设置不生效

@qiaodongliang
Copy link

qiaodongliang commented May 18, 2023

使用 Bruno 3.3.0,确实无法修改字体样式

labelStyle: TextStyle( fontSize: 20.sp, fontWeight: FontWeight.bold )
使用这个方法无效

Hi @IvanYue 应该是你的AppTextThem.mediumStyle.copyWith有问题,直接对labelStyle设置TextStyle 可以生效

unselectedLabelStyle: TextStyle(
   fontSize: 28,
   color: const Color(0xFF1B1A21).withOpacity(0.4),
),
labelStyle: TextStyle(fontSize: 28, color: const Color(0xFF1B1A21)),
image

@zhangBoy
Copy link

zhangBoy commented Aug 8, 2023

问题提交

标题格式:[BUG]: BrnTabBar 字体设置大小无效

内容需包含:

1、BUG 描述

BrnTabBar 字体设置大小无效,themeData设置后也不会改变大小。

2、复现步骤

BrnTabBar(
              mode: BrnTabBarBadgeMode.origin,
              labelPadding: const EdgeInsets.only(right: 45),
              indicatorPadding: const EdgeInsets.only(bottom: 8, right: 45),
              unselectedLabelStyle: AppTextThem.regularStyle.copyWith(
                  fontSize: 18,
                  color: const Color(0xFF1B1A21).withOpacity(0.4)),
              labelStyle: AppTextThem.mediumStyle
                  .copyWith(fontSize: 22, color: const Color(0xFF1B1A21)),
              backgroundcolor: Colors.transparent,
              indicatorColor: Colors.transparent,
              isScroll: false,
              tabWidth: 80,
              indicatorWeight: 3,
              indicatorWidth: 18.5.w,
              onTap: (state, int index) {},
              // themeData: BrnTabBarConfig(
              //     unselectedLabelStyle: BrnTextStyle(fontSize: 18),
              //     tagSelectedTextStyle: BrnTextStyle(fontSize: 22)),
              // tabHeight: 10,
              controller: controller.tabController,
              tabs: [
                BadgeTab(text: "推荐"),
                BadgeTab(text: "新闻"),
                BadgeTab(text: "案例")
              ]),

3、期望行为 字体大小改变 4、运行环境 mac 13.1 VSCode版本: 1.75.0 (Universal)

  • 运行设备: iPhone6s
  • 系统 :ios15.7
  • Bruno 版本 : 3.3.0
  • Flutter Doctor 信息
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.1 22C65 darwin-arm64 (Rosetta), locale zh-Hans-CN)
    • Flutter version 3.7.1 on channel stable at /Users/jdny/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7048ed95a5 (6 days ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/jdny/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/jdny/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.75.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (1 available)
    • iPhone (mobile) • 723dxx332e0602f7 • ios • iOS 15.7 19H12

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

5、附加信息

包括视频、图片等补充信息

解决方案:
删除掉BrnTabBar中_wrapAverageWidget方法和_wrapOriginWidget方法中的style: TextStyle(fontSize: 16)就可以解决了。
原因是TabBar的labelStyle和unselectedLabelStyle被TabBar的tabs中子组件的textStyle给覆盖了

@IvanYue
Copy link
Author

IvanYue commented Sep 4, 2023

问题提交

标题格式:[BUG]: BrnTabBar 字体设置大小无效
内容需包含:
1、BUG 描述
BrnTabBar 字体设置大小无效,themeData设置后也不会改变大小。
2、复现步骤

BrnTabBar(
              mode: BrnTabBarBadgeMode.origin,
              labelPadding: const EdgeInsets.only(right: 45),
              indicatorPadding: const EdgeInsets.only(bottom: 8, right: 45),
              unselectedLabelStyle: AppTextThem.regularStyle.copyWith(
                  fontSize: 18,
                  color: const Color(0xFF1B1A21).withOpacity(0.4)),
              labelStyle: AppTextThem.mediumStyle
                  .copyWith(fontSize: 22, color: const Color(0xFF1B1A21)),
              backgroundcolor: Colors.transparent,
              indicatorColor: Colors.transparent,
              isScroll: false,
              tabWidth: 80,
              indicatorWeight: 3,
              indicatorWidth: 18.5.w,
              onTap: (state, int index) {},
              // themeData: BrnTabBarConfig(
              //     unselectedLabelStyle: BrnTextStyle(fontSize: 18),
              //     tagSelectedTextStyle: BrnTextStyle(fontSize: 22)),
              // tabHeight: 10,
              controller: controller.tabController,
              tabs: [
                BadgeTab(text: "推荐"),
                BadgeTab(text: "新闻"),
                BadgeTab(text: "案例")
              ]),

3、期望行为 字体大小改变 4、运行环境 mac 13.1 VSCode版本: 1.75.0 (Universal)

  • 运行设备: iPhone6s
  • 系统 :ios15.7
  • Bruno 版本 : 3.3.0
  • Flutter Doctor 信息
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.1 22C65 darwin-arm64 (Rosetta), locale zh-Hans-CN)
    • Flutter version 3.7.1 on channel stable at /Users/jdny/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7048ed95a5 (6 days ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/jdny/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/jdny/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.75.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (1 available)
    • iPhone (mobile) • 723dxx332e0602f7 • ios • iOS 15.7 19H12

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

5、附加信息
包括视频、图片等补充信息

解决方案: 删除掉BrnTabBar中_wrapAverageWidget方法和_wrapOriginWidget方法中的style: TextStyle(fontSize: 16)就可以解决了。 原因是TabBar的labelStyle和unselectedLabelStyle被TabBar的tabs中子组件的textStyle给覆盖了

@zhoujuanjuan @JunCaiLi 确实是这个老哥说的问题。麻烦修复一下。谢谢啦。

@qiaodongliang 可以这样解决先。

@lgGuo
Copy link

lgGuo commented Mar 21, 2024

3.4.3还是没有修复这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants