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 in Android by sarit
• 1,190 points
67 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.


answered Mar 10 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 in Android by vishalini
65 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 in Android by vishalini
99 views
0 votes
1 answer
0 votes
0 answers

How to create Toast in Flutter

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

Mar 9 in Android by sarit
• 1,190 points
15 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,240 points
602 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,460 points
802 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,460 points
1,194 views
0 votes
1 answer

How to change package name in flutter?

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

answered Mar 1 in Android by vishalini
64 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 in Android by vishalini
62 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