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
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. )
“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.
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.
You can try to use the Row widget.
Row( children: <Widget>[ Expanded( child: Divider() ), Text("OR"), Expanded( child: Divider() ), ] )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With