So I have this AppBarComponent that displays the appbar of my app.
class AppBarComponent {
static Widget titleWithImage(String title) {
return Row(
children: <Widget>[
Image.asset(
'logo.png',
fit: BoxFit.contain,
width: 40,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Text('title'),
),
Row(
children: [
Text(
'subtitle',
),
],
),
],
);
}
}
The result is something like this:
But what I want is to display the subtitle on the right side of the appbar.
3
Answers
Oh! I have resolved it using
instead of wrapping it with Row.
It’s not recommended to use Widget function instead use Stateful/Stateless widgets, so you can achieve it like that…