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

Text decoration underline is not aligning some characters or space #42833

Open
TomassMaximum opened this issue Oct 16, 2019 · 31 comments
Open

Text decoration underline is not aligning some characters or space #42833

TomassMaximum opened this issue Oct 16, 2019 · 31 comments
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: quality A truly polished experience a: typography Text rendering, possibly libtxt engine flutter/engine repository. See also e: labels. found in release: 3.7 Found to occur in 3.7 found in release: 3.9 Found to occur in 3.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@TomassMaximum
Copy link

Steps to Reproduce

Setting text decoration to underline or overline, the decoration is not aligned in some languages' characters or space. I thought there should be an issue here but didn't find any. Is this considered to be a feature which is intended or it's a bug?
Screenshot_2019-10-16 17 41 52_Vj9vK6
Screenshot_2019-10-16 17 42 03_7bFvkz
Screenshot_2019-10-16 17 42 08_8r9PF4

**Target Platform:**Android/iOS
**Target OS version/browser:**any
**Devices:**iPhone, OnePlus phones

[✓] Flutter (Channel beta, v1.10.7, on Mac OS X 10.15 19A583, locale zh-Hans-CN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
[✓] Android Studio (version 3.5)
[✓] Connected device (2 available)

• No issues found!

@theshivamlko
Copy link

Share your Text code

@BondarenkoStas BondarenkoStas added a: internationalization Supporting other languages or locales. (aka i18n) framework flutter/packages/flutter repository. See also f: labels. labels Oct 16, 2019
@HansMuller HansMuller added the a: typography Text rendering, possibly libtxt label Oct 16, 2019
@HansMuller
Copy link
Contributor

It would help if you could provide a small self-contained app that demonstrates the problem. Note also: https://gist.github.com/ is a useful way to share the code.

@HansMuller HansMuller added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 16, 2019
@goderbauer goderbauer added the engine flutter/engine repository. See also e: labels. label Oct 16, 2019
@TomassMaximum
Copy link
Author

code sample below
sample text: 다음에 동의합니다

class MLinkText extends StatelessWidget {
  final double fontSize;
  final FontWeight fontWeight;
  final String text;
  final VoidCallback onTap;
  final Color color;
  final TextAlign textAlign;

  MLinkText(this.text,
      {this.fontSize = 100,
      this.fontWeight = FontWeight.bold,
      this.onTap,
      this.color = const Color.fromARGB(255, 74, 166, 255),
      this.textAlign});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: onTap == null ? () {} : onTap,
        child: Text(
          text,
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
              color: color,
              fontSize: fontSize,
              fontWeight: fontWeight,
              decoration: TextDecoration.underline,
          ),
          textAlign: textAlign,
        ));
  }
}

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 17, 2019
@lutics

This comment was marked as duplicate.

@red282

This comment was marked as duplicate.

@Kiboom

This comment was marked as duplicate.

1 similar comment
@didi11641

This comment was marked as duplicate.

@red282
Copy link

red282 commented Dec 24, 2019

Won't be helpful to use StrutStyle here? 🤔

@espresso3389
Copy link

On Japanese Android, the following code renders badly styled text...

Text(
 '会社コード、利用者IDを忘れた方',
  style: Theme.of(context).textTheme.body1.copyWith(fontSize: 20, color: Colors.orange, decoration: TextDecoration.underline)
)

image

@limengyun2008

This comment was marked as duplicate.

@MartinhoMCM
Copy link

MartinhoMCM commented Sep 16, 2020

In some language de decoration doesn't work as expected.
The better way to use Text decoration is typing: Theme.of(context).textTheme.bodyText1.copyWith(...)

Example:
Text('Cadastrar-se', style: Theme.of(context).textTheme.bodyText1.copyWith( fontSize: 14.0, color: Colors.grey, fontWeight: FontWeight.w400, decoration: TextDecoration.underline ))

@TahaTesser
Copy link
Member

Android

flutter_01

iOS

Simulator Screen Shot - iPhone 11 - 2020-09-24 at 16 28 37

code sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: Center(
        child: Container(
          child: MLinkText('good 早上 have 很好的一天 see you 后来'),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

class MLinkText extends StatelessWidget {
  final double fontSize;
  final FontWeight fontWeight;
  final String text;
  final VoidCallback onTap;
  final Color color;
  final TextAlign textAlign;

  MLinkText(this.text,
      {this.fontSize = 16,
      this.fontWeight = FontWeight.bold,
      this.onTap,
      this.color = const Color.fromARGB(255, 74, 166, 255),
      this.textAlign});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: onTap == null ? () {} : onTap,
        child: Text(
          text,
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            color: color,
            fontSize: fontSize,
            fontWeight: fontWeight,
            decoration: TextDecoration.underline,
          ),
          textAlign: textAlign,
        ));
  }
}
flutter doctor -v
✓] Flutter (Channel master, 1.22.0-10.0.pre.340, on Mac OS X 10.15.6 19G2021 x86_64, locale en-GB)
    • Flutter version 1.22.0-10.0.pre.340 at /Users/tahatesser/Code/flutter_master
    • Framework revision 1fef5912cf (6 hours ago), 2020-09-23 21:37:08 -0700
    • Engine revision dd35b5b659
    • Dart version 2.10.0 (build 2.10.0-156.0.dev)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0, Build version 12A7209
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (5 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios            • iOS 14.0
    • iPhone 11 (mobile)     • 9A8EFBFE-A806-4FF9-ACA5-F3F98D94979D • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64     • Mac OS X 10.15.6 19G2021 x86_64
    • Web Server (web)       • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 85.0.4183.102

• No issues found!

@TahaTesser TahaTesser added a: quality A truly polished experience found in release: 1.22 Found to occur in 1.22 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically labels Sep 24, 2020
@kf6gpe
Copy link
Contributor

kf6gpe commented Dec 10, 2020

@jason-simmons Does our migration to SkParagraph justify retesting and possibly closing this?

@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label Dec 10, 2020
@jason-simmons
Copy link
Member

SkParagraph will render the text in #42833 (comment) similarly to Libtxt. The Flutter text API has not changed, and SkParagraph is using the same fonts and many of the same HarfBuzz shaping and Skia text drawing APIs used by Libtxt.

@jeiea
Copy link

jeiea commented Dec 14, 2020

My two cents for short text.

  Stack(children: [
    Text('면책 조항'),
    Positioned.fill(
        bottom: 3,
        child: Container(
            decoration: BoxDecoration(border: Border(bottom: BorderSide()))))
  ]),

@hyouuu
Copy link

hyouuu commented Jun 3, 2021

@kf6gpe IMO it shouldn't be a P4 as it's directly user facing that makes any app using underlines not really prod ready

@Tomas-Shao

This comment was marked as duplicate.

@talzemingo
Copy link

I did:
@OverRide
Widget build(BuildContext context) {
return Column(
children: [
Container(
decoration:
const BoxDecoration(border: Border(bottom: BorderSide(width: 2))),
child: Text(
text,
style: textStyle,
),
),
],
);
}

@larsien

This comment was marked as duplicate.

@uniqmuz
Copy link

uniqmuz commented May 13, 2022

Is ther any update? It also happened in flutter web 😇

@red282
Copy link

red282 commented May 16, 2022

It seems to be the same issue. #99730

@Jay-flow
Copy link

Jay-flow commented Sep 7, 2022

Any update? same issue 🥲

My code

import 'package:flutter/material.dart';

class TempScreen extends StatefulWidget {
  static const String name = "/TempScreen";
  const TempScreen({Key? key}) : super(key: key);

  @override
  State<TempScreen> createState() => _TempScreenState();
}

class _TempScreenState extends State<TempScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            mainAxisAlignment: MainAxisAlignment.center,
            children: const [
              Text(
                '한글만 이상 합니다',
                style: TextStyle(
                  decoration: TextDecoration.underline,
                  fontSize: 25,
                  decorationThickness: 2,
                ),
              ),
              SizedBox(
                height: 100,
              ),
              Text(
                'English is good',
                style: TextStyle(
                  decoration: TextDecoration.underline,
                  fontSize: 25,
                  decorationThickness: 2,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

flutter doctor -v

[✓] Flutter (Channel stable, 3.3.0, on macOS 12.5.1 21G83 darwin-arm, locale en-KR)
    • Flutter version 3.3.0 on channel stable at /opt/homebrew/Caskroom/flutter/2.8.1/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffccd96b62 (8 days ago), 2022-08-29 17:28:57 -0700
    • Engine revision 5e9e0e0aa8
    • Dart version 2.18.0
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/dooboolab/Library/Android/sdk
    • Platform android-33, build-tools 32.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.2.1)
    • 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.71.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.48.0

[✓] Connected device (3 available)
    • SM N960N (mobile) • 26bd083d61217ece • android-arm64  • Android 10 (API 29)
    • macOS (desktop)   • macos            • darwin-arm64   • macOS 12.5.1 21G83 darwin-arm
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 105.0.5195.52

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

@Jay-flow
Copy link

Jay-flow commented Sep 7, 2022

I referred to #42833 (comment).
I handled it as below temporarily. It works well for the purpose I use.

import 'package:flutter/material.dart';

class UnderlineText extends StatelessWidget {
  const UnderlineText(
    this.text, {
    super.key,
    this.style,
    this.underlineThickness = 1,
    this.underlineHeight = 0,
    this.underlineColor = Colors.black,
  }) : assert(underlineHeight > 0);

  final String text;
  final TextStyle? style;
  final double underlineThickness;
  final double underlineHeight;
  final Color underlineColor;

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Padding(
          padding: EdgeInsets.only(bottom: underlineHeight),
          child: Text(
            text,
            style: style,
          ),
        ),
        Positioned.fill(
          bottom: 0,
          child: Container(
            decoration: BoxDecoration(
              border: Border(
                bottom: BorderSide(
                  color: underlineColor,
                  width: underlineThickness,
                ),
              ),
            ),
          ),
        )
      ],
    );
  }
}

@ElKood-Sol

This comment was marked as duplicate.

@dooully
Copy link

dooully commented Mar 4, 2023

I can't add custom underline because I have to use textSpan.

Hope this solves your problem.

@danagbemava-nc
Copy link
Member

danagbemava-nc commented Mar 7, 2023

Reproduces on the latest versions of flutter.

It reproduced for me on android, iOS, macOS & chrome(canvaskit). Removing android label as this affects more platforms.

code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: const Home(),
    );
  }
}

class Home extends StatelessWidget {
  const Home({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Material App Bar'),
      ),
      body: const Center(
        child: MLinkText('good 早上 have 很好的一天 see you 后来'),
      ),
      floatingActionButton: FloatingActionButton(
        child: const Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

class MLinkText extends StatelessWidget {
  final double fontSize;
  final FontWeight fontWeight;
  final String text;
  final VoidCallback? onTap;
  final Color color;
  final TextAlign? textAlign;

  const MLinkText(this.text,
      {super.key,
      this.fontSize = 16,
      this.fontWeight = FontWeight.bold,
      this.onTap,
      this.color = const Color.fromARGB(255, 74, 166, 255),
      this.textAlign});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        onTap: onTap,
        child: Text(
          text,
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          style: TextStyle(
            color: color,
            fontSize: fontSize,
            fontWeight: fontWeight,
            decoration: TextDecoration.underline,
          ),
          textAlign: textAlign,
        ));
  }
}
screenshots
macOS android iOS chrome(canvaskit) chrom(html)
Screenshot 2023-03-07 at 10 41 45 Screenshot 2023-03-07 at 10 43 25 Screenshot 2023-03-07 at 10 45 39
flutter doctor -v
[✓] Flutter (Channel stable, 3.7.6, on macOS 13.2.1 22D68 darwin-arm64, locale en-GB)
    • Flutter version 3.7.6 on channel stable at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 12cb4eb7a0 (6 days ago), 2023-03-01 10:29:26 -0800
    • Engine revision ada363ee93
    • Dart version 2.19.3
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • 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.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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.15+0-b2043.56-8887301)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 72.1.4
    • Dart plugin version 223.8617.8

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

[✓] Connected device (3 available)
    • Nexus (mobile)  • 00008020-001875E83A38002E • ios            • iOS 16.3.1 20D67
    • macOS (desktop) • macos                     • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 110.0.5481.177
    ! Error: Nexus is busy: Fetching debug symbols for Nexus. Xcode will continue when Nexus is finished. (code -10)

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

• No issues found!
[!] Flutter (Channel master, 3.9.0-1.0.pre.72, on macOS 13.2.1 22D68 darwin-arm64, locale en-GB)
    • Flutter version 3.9.0-1.0.pre.72 on channel master at /Users/nexus/dev/sdks/flutters
    ! Warning: `flutter` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/nexus/dev/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/nexus/dev/sdks/flutters. Consider adding /Users/nexus/dev/sdks/flutters/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8557ffa024 (7 hours ago), 2023-03-06 22:38:59 -0500
    • Engine revision e2bd89f97e
    • Dart version 3.0.0 (build 3.0.0-290.0.dev)
    • DevTools version 2.22.2
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • 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.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.1)
    • Android Studio at /Users/nexus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/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.15+0-b2043.56-8887301)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 72.1.4
    • Dart plugin version 223.8617.8

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

[✓] Connected device (3 available)
    • Nexus (mobile)  • 00008020-001875E83A38002E • ios            • iOS 16.3.1 20D67
    • macOS (desktop) • macos                     • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 110.0.5481.177
    ! Error: Nexus is busy: Fetching debug symbols for Nexus. Xcode will continue when Nexus is finished. (code -10)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@danagbemava-nc danagbemava-nc added found in release: 3.7 Found to occur in 3.7 found in release: 3.9 Found to occur in 3.9 and removed platform-android Android applications specifically found in release: 1.22 Found to occur in 1.22 labels Mar 7, 2023
@JosephNK
Copy link

Will this solve the problem?

@buddypia
Copy link

buddypia commented Jun 24, 2023

my workaround code

DecoratedBox(
  decoration: BoxDecoration(
    border: Border(bottom: BorderSide()),
  ),
  child: Text('テスト테스트test'),
),
スクリーンショット 2023-06-25 0 39 06

@glt3953
Copy link

glt3953 commented Feb 22, 2024

WidgetSpan textWidgetSpan(String text, double fontSize, double height) {
return WidgetSpan(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
text,
style: TextStyle(
fontSize: fontSize),
),
],
),
// Text(text, style: TextStyle(fontSize: fontSize),),
color: const Color(0xFFFF6933),
//下划线
// decoration: BoxDecoration(
// border: Border(bottom: BorderSide(color: const Color(0xFFFF6933))),
// // color: const Color(0xFFFF6933),
// ),
height: height,
),
);
}

@trungBrycen
Copy link

Let try to use this Widget
UnderlineText("スクリーンショット 2023-06-25 0 39 06", style: const TextStyle(fontSize: 21, color: AppColor.blue, height: 1.5))

import 'package:flutter/material.dart';

class UnderlineText extends StatelessWidget {
final String text;
final TextStyle? style;
const UnderlineText(this.text, {super.key, this.style});

@OverRide
Widget build(BuildContext context) {
return RichText(text: TextSpan(children: textWidgetSpan(text)));
}

List textWidgetSpan(String text) {
TextStyle textStyle = style != null ? style! : const TextStyle(fontSize: 21);
Color color = textStyle.color ?? Colors.black;
double fontSize = textStyle.fontSize ?? 21;
double lineHeight = textStyle.height ?? 1.13;
double height = fontSize * 1.13;
double marginBottom = lineHeight > 1.13 ? (lineHeight - 1.13) * fontSize : 0;
textStyle = textStyle.copyWith(height: 1);
List spans = [];
for (int t = 0; t < text.length; t++) {
String char = text.substring(t, t + 1);
spans.add(
WidgetSpan(
child: Container(
height: height,
margin: EdgeInsets.only(bottom: marginBottom),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: color)),
),
child: Text(
char,
style: textStyle,
),
),
),
),
);
}
return spans;
}
}

@trungBrycen
Copy link

`import 'package:flutter/material.dart';

class UnderlineText extends StatelessWidget {
final String text;
final TextStyle? style;
const UnderlineText(this.text, {super.key, this.style});

@OverRide
Widget build(BuildContext context) {
return RichText(text: TextSpan(children: textWidgetSpan(text)));
}

List textWidgetSpan(String text) {
TextStyle textStyle = style != null ? style! : const TextStyle(fontSize: 21);
Color color = textStyle.color ?? Colors.black;
double fontSize = textStyle.fontSize ?? 21;
double lineHeight = textStyle.height ?? 1.13;
double height = fontSize * 1.13;
double marginBottom = lineHeight > 1.13 ? (lineHeight - 1.13) * fontSize : 0;
textStyle = textStyle.copyWith(height: 1);
List spans = [];
for (int t = 0; t < text.length; t++) {
String char = text.substring(t, t + 1);
spans.add(
WidgetSpan(
child: Container(
height: height,
margin: EdgeInsets.only(top: marginBottom/2, bottom: marginBottom/2),
child: DecoratedBox(
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: color)),
),
child: Text(
char,
style: textStyle,
),
),
),
),
);
}
return spans;
}
}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: quality A truly polished experience a: typography Text rendering, possibly libtxt engine flutter/engine repository. See also e: labels. found in release: 3.7 Found to occur in 3.7 found in release: 3.9 Found to occur in 3.9 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
Mobile - localization & intl
  
Engineer Reviewed
Development

No branches or pull requests