How to underline text in flutter

0 votes

How to underline text in flutter inside Text widget?

I cannot seem to find underline inside fontStyle property of TextStyle

Mar 9, 2023 in Android by sarit
• 1,830 points
10,022 views

1 answer to this question.

0 votes

You can underline text in Flutter by using the decoration property of the TextStyle class. Here's an example:

Text(
  'Underlined Text',
  style: TextStyle(
    decoration: TextDecoration.underline,
    decorationColor: Colors.red, // optional
    decorationThickness: 2, // optional
    decorationStyle: TextDecorationStyle.dashed, // optional
  ),
);

In this example, the decoration property is set to TextDecoration.underline to underline the text. You can also specify the color of the underline using the decorationColor property, the thickness of the underline using the decorationThickness property, and the style of the underline using the decorationStyle property.

Note that the decoration property can also be used to add other text decorations, such as overline and line-through.

To know more about Flutter, join our Flutter Certification Course today.


answered Mar 10, 2023 by vinayak

Related Questions In Android

0 votes
1 answer

How can I add a border to a widget in Flutter?

To add a border to a widget ...READ MORE

answered Mar 1, 2023 in Android by vishalini
8,778 views
0 votes
1 answer

How to do Rounded Corners Image in Flutter?

To make the image in your Flutter ...READ MORE

answered Mar 1, 2023 in Android by vishalini
1,210 views
0 votes
1 answer

How to add a ListView to a Column in Flutter?

To add a ListView to a Column ...READ MORE

answered Mar 9, 2023 in Android by pooja
10,674 views
0 votes
0 answers

How to create Toast in Flutter

Can I create something similar to Toasts in Flutter? Just ...READ MORE

Mar 9, 2023 in Android by sarit
• 1,830 points
243 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,230 points
982 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,440 points
1,151 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,440 points
1,600 views
0 votes
1 answer

How to change package name in flutter?

Yes, you can change the package name ...READ MORE

answered Mar 1, 2023 in Android by vishalini
2,733 views
0 votes
1 answer

How to create number input field in Flutter?

Yes, Flutter has a built-in widget called ...READ MORE

answered Mar 1, 2023 in Android by vishalini
5,299 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP