<p>In this article, I'm going to share a simple example of how to add new line to Text in Flutter.</p> <p>Before:</p> <p></p> <p>Here is the code from main.dart file to achieve this.</p> <p>runApp(MyApp());</p> <p>class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); }</p> <p>class _MyAppState extends State { double padValue = 0;</p> <p>@override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text("Text Example"), ), body: Center( child: Container( child: Text( 'Hello,<br /> How are you?', textAlign: TextAlign.center, overflow: TextOverflow.ellipsis, style: TextStyle(fontWeight: FontWeight.bold), )), )), ); } }` Thanks, Srikanth</p>
How to add new line to Text in Flutter?
This Article is posted by seven.srikanth at 9/21/2019 6:30:24 AM
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter
Tags: New Line; break line;
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter