I'm trying to put text (custom text button) into leading property of AppBar. However when the text get too long then the text end up in multiple lines
Scaffold(
appBar: AppBar(
centerTitle: true,
leading: Text('Go back to'),
),
)

How do I increase width of AppBar leading property?
I don't want to use title because it makes centering title a PITA.
Scaffold(
appBar: AppBar(
centerTitle: true,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[Text('go back to'), Text('My center title')],
),
),
)

Is there any way to change it without messing with title property?
You can set a custom leading width by using the leadingWidth property in the appBar:
Scaffold(
appBar: AppBar(
leadingWidth: 400,
leading: Text('Go back to'),
centerTitle: true,
title: Text('Center title'),
),
)
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