How to implement app bar action text instead of action icon in Flutter?
Wrap your Text widget inside Center widget as
new Center( new Text( userName, textScaleFactor: 1.5, style: new TextStyle( fontSize: 12.0, color: Colors.white, ), ),)
You can also Wrap your Text
widget inside Align
widget and give a alignment: Alignment.center
like below
Align( alignment: Alignment.center, child: Text( "Save", textScaleFactor: 1.5, style: TextStyle( fontSize: 12.0, color: Colors.white, ), ),)
And also you can achieve this by using a TextButton
TextButton( onPressed: () {}, child: Text('Save', style: TextStyle(color: Colors.white),),)