Text underline display line above text instead of below - flutter

As showing the given image After applying underline decoration text style to the text it shows line above text instead of below in flutter 2.2.
TextButton(
onPressed: () {},
child: Text(
getLocalValue(context, txtTermsNConditions),
style: TextStyle(
fontSize: 12.sp,
fontWeight: fwMedium,
color: Color(clrPrimary),
decoration: TextDecoration.underline),
),
)

style: TextStyle(decoration: TextDecoration.overline) will do the trick see this link for more information.

You can do with a shortcut just use a Stack and place both Text and a Divider Widget in it and gave then position according to your Requirements that's all.

That was a problem with fonts I have used, using another font it has been resolved.

Related

Why do parts of TextStyle trickle down the widget-tree while others don't?

I am fairly new to flutter and just stumbled across something that seems odd to me with regards to how style is affecting widgets further down the tree.
Consider the following example:
ElevatedButton(
style: ElevatedButton.styleFrom(
textStyle: const TextStyle(
fontSize: 17.0,
fontWeight: FontWeight.bold,
color: Colors.red,
)
),
onPressed: () { print("testados"); },
child: const Text(
"some testadorian text",
style: TextStyle(color: Colors.red),
),
);
I could verify that changing fontSize and fontWeight in lines 4 and 5 did produce the
expected effect. But setting the color inside the textStyle of ElevatedButton.styleFrom didn't have any visible effect at all.
Setting the color inside style of Text did produce the expected result.
What I understood so far was that Text-widgets take what is available as default-theming further up the widget tree and override those defaults when a specific property is directly set on themselves.
What am I missing out to understand this behaviour?

Force remained text onto next line

I want to make textWidget1 wrap its remained text to the next line in a row.
like below :
how can I achieve this?
Using Wrap make the entire textWidget1to next line.
you may use triple quotes like in the following example:
Container(
child: Text(
'''Text1
Text2
''',
maxLines: 3,
style: TextStyle(
fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.white),
),
);
Run the above code on DartPad.
Hope I could help you.
Luis
You can wrap your Text inside a Container and the container wrapped by Flexible.
I solved my problem by drawing them.

flutter: Bug? only FlatButton but not CupertinoButton showing Text

Did you ever experience this? Does it make sense to register this as a bug and how would I do this?
For one of my screens I have now this situation for the 2nd time: I insert a CupertinoButton with Text as a child, however, the text does not show up. In the 1st occurrence, 2 pixels of text appeared to be rendered (I saw 2 dots). I have also copied a CupertinoButton from another line and left it unchanged. No change, text does not appear. If I then only change the widget name from CupertinoButton to FlatButton (leaving everything else untouched), the text appears.
Since CupertinoButtons are typically working for me, I guess I would have to submit the whole project for a bug report, since isolating the issue does not to be appear like a straight forward job.
Please consider adding padding like this:
CupertinoButton(
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 5),
color: Colors.blue,
borderRadius: BorderRadius.all(Radius.circular(12)),
child: Text(
'Login',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.white),
),
onPressed: () => {},
),

Is there a way to display Text in small caps in Flutter?

I'm searching for a way to display a Google Font in small caps.
I'm using the google_fonts package.
You can use the FontFeature property inside a TextStyle like this:
Text('This is a Google Font',
style: GoogleFonts.lato(
textStyle: TextStyle(fontFeatures:[FontFeature.enable('smcp')], color: Colors.blue, letterSpacing: .5),
//smcp as in small caps
),
),

Is there a way to paint inside the text in Flutter?

I am currently working on the Flutter package and want to add an outlined wavy liquid text as below.
Is there any feature to add this in the Text widget?
there is this flutter package animated_text_kit 2.2.0. Which could be used to give a wavy animation to the text. I am leaving the link down below
https://pub.dev/packages/animated_text_kit
width: 250.0,
child: TextLiquidFill(
text: 'LIQUIDY',
waveColor: Colors.blueAccent,
boxBackgroundColor: Colors.redAccent,
textStyle: TextStyle(
fontSize: 80.0,
fontWeight: FontWeight.bold,
),
boxHeight: 300.0,
),
);