Вместо того, чтобы обернуть Column
в Expanded
, который будет занимать как можно больше места, используйте Flexible
, а также оберните другие виджеты внутри Column
, чтобы вы могли легко расположить их:
class TitleSection extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(32),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Kratos",style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20
)),
Text("The God Of War",
style: TextStyle(
color: Colors.grey[500]
),
),
],
),
),
Flexible(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Icon(
Icons.star,
color: Colors.red,
),
Text("143")
],
),
],
),
),
],
)
);
}
}