how can I create in Flutter a leading item of Navigation bar with back icon and title of the previous scaffold. Have a look in a picture:
I've tried to put a Text
widget inside a Row
but got an overflow.
CupertinoNavigationBar(
middle: Text('New report'),
leading: Align(
alignment: Alignment(-1.5, -1),
child: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(
CupertinoIcons.left_chevron,
color: CupertinoColors.destructiveRed,
),
],
),
),
),
),
Thanks in advance!
Your leading could be a Row containing the Icon and the text: Something like that:
CupertinoNavigationBar(
middle: Text('New report'),
leading: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(
CupertinoIcons.left_chevron,
color: CupertinoColors.destructiveRed,
),
Text('Reports')
],
),
),
),