When compiling my app, this warning appears inside the container. I've been told to use the expanded widget by wrapping the container and it doesn't work.
return Container(
width: 500.0,
height: 600.0,
margin: const EdgeInsets.symmetric(horizontal: 5.0),
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
color: color,
boxShadow: const [
BoxShadow(
color: Colors.black,
blurRadius: 0.0,
spreadRadius: 0.0,
offset: Offset(0.0, 0.0), // shadow direction: bottom right
)
],
),
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: const EdgeInsets.only(top: 11.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset(
logo,
width: 50,
height: 50,
),
const Icon(Icons.favorite, color: Colors.red),
],
),
),
const SizedBox(
height: 10,
),
Text(
companyname,
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.white),
),
Text(
role,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Icon(
Icons.location_on,
color: Colors.white,
size: 15,
),
Text(
region,
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.white),
),
],
),
],
),
),
);
} }