Trying to right align a container with text view child, it has a row parent which is inside another column, tried number of solutions from Stack Overflow, didn\'t work.
Screenshot:
You can also try Wrap
like this:
Wrap(
spacing: 50, // spacing between each of the widgets below
children: <Widget>[
Text("One"),
Text("Two"),
Text("Three"),
],
)
Use Spacer
which will get remaining space and will divide the widget equally
Row(
children: <Widget>[
Text("Text 1", style: TextStyle(fontSize: 20),),
Spacer(),
Text("Text 2", style: TextStyle(fontSize: 20),),
Spacer(),
Text("Text 3", style: TextStyle(fontSize: 20),),
],
),
Output:
Use the mainAxisAlignment
property in Row
widget.
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
...
)