FLUTTER | Right Align not working
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,
...
)
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"),
],
)