Hello Guys How are you all? Hope you all are fine. Today in this tutorial we are going to learn How to set center text vertically and horizontally in Flutter? so without wasting your time lets start this tutorial.
How to set center text vertically and horizontally in Flutter?
- Using Center Widget
- Also Using textAlign Property.
- Using Align widget.
How to set Text in center Using Center Widget.
To set text in center Just Use Center() widget. It will set Text to horizontally and vertically Center. Lets have a look of my example.
Center(
child: Text(
"FlutterCorner",
),
),
Output

How to set Text in center Using textAlign Property.
Text widget has textAlign property you can give them start, end, center, justify, left, right. Lets have a look of my example.
Text(
"FlutterCorner",
textAlign: TextAlign.center,
),
Output

How to set Text in center Using Align widget.
We can use Align Widget to set text in center align has alignment property. Lets have a look of my example.
child: Align(
alignment: Alignment.center,
child: Text("FlutterCorner"),
),
Output

Faq
- How to set center text vertically and horizontally in Flutter?
to set center text vertically and horizontally in Flutter Just Use Center() widget. It will set Text to horizontally and vertically Center. The text widget has textAlign property you can give them start, end, center, justify, left, right. We can use Align Widget to set text in center align has alignment property.
- set center text vertically and horizontally in Flutter
to set center text vertically and horizontally in Flutter Just Use Center() widget. It will set Text to horizontally and vertically Center. The text widget has textAlign property you can give them start, end, center, justify, left, right. We can use Align Widget to set text in center align has alignment property.
Summery
So, It’s All About this tutorial. I hope this tutorial helps you to solve your error. Please Comment Below if You stucks anywhere with my code.
Also Check Out Below Tutorials
- Flutter: How to fix “A RenderFlex overflowed by pixels ” error?
- No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider
- The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’
- RangeError (index): Invalid value: Valid value range is empty: 0
- Gradle failure A problem occurred evaluating project ‘:app’
Leave a Reply