Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Horizontal divider with text in the middle in Flutter?

Is there a built in widget in Flutter to create a divider with text in the middle? Any guide on how to do it? Like this: (the "OR" text in the middle of horizontal line)

here's is the screenshot of what I want to achieve

like image 372
Deche Avatar asked Jan 06 '19 02:01

Deche


People also ask

How do you make a divider with text in Flutter?

How to Add Vertical Divider: VerticalDivider( color: Colors. black, //color of divider width: 10, //width space of divider thickness: 3, //thickness of divier line indent: 10, //Spacing at the top of divider. endIndent: 10, //Spacing at the bottom of divider. )

How do you make a divider horizontal in Flutter?

“horizontal divider in flutter” Code Answer'sindent: 20, // empty space to the leading edge of divider. endIndent: 20, // empty space to the trailing edge of the divider. color: Colors. black, // The color to use when painting the line.

How do you add a separator line in Flutter?

If you have a list of widgets, you may need to add a separator between the widgets. In Flutter, there are two widgets suitable for that purpose: Divider and VerticalDivider . Divider is used to create a horizontal line divider, while VerticalDivider is used to create a vertical line divider.


1 Answers

You can try to use the Row widget.

Row(     children: <Widget>[         Expanded(             child: Divider()         ),                 Text("OR"),                  Expanded(             child: Divider()         ),     ] ) 
like image 132
Jerome Escalante Avatar answered Sep 22 '22 18:09

Jerome Escalante