i want to make my container responsive of image size, but somehow it is not working.
below is the container that I have made-:
Container(
height: size.height * 0.7,
width: size.width * 0.95,
decoration: BoxDecoration(
// borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10)),
image: DecorationImage(
image: AssetImage('assets/vir.gif'),//widget.user.imgUrl),
fit: BoxFit.contain,
),
),
child: Container(
decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(color: Colors.black12, spreadRadius: 0.5),
],
),
),
),
here if the height of image is same as the container then it is good but if the height is less then I am able to see the background that I don't want.
even if I add any information in the container the height remains fixed and doesn't adjust to the content.
below is another example for this -:
Container(
height: size.height * 0.2,
width: size.width * 0.95,
decoration: BoxDecoration(
color: Colors.pink[100],
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Wrap(
spacing: 10,
children: [
Chip(
elevation: 5,
label: Text('Height'),
labelStyle: TextStyle(
color: Colors.white,
fontSize: 17,
),
backgroundColor: Colors.pinkAccent,
deleteIcon: Icon(Icons.height),
// labelPadding: EdgeInsets.symmetric(horizontal: 10),
),
Chip(
elevation: 5,
label: Text('Active'),
labelStyle: TextStyle(
color: Colors.white,
fontSize: 17,
),
backgroundColor: Colors.pinkAccent,
labelPadding: EdgeInsets.symmetric(horizontal: 10),
),
Chip(
elevation: 5,
label: Text('Start Sign'),
labelStyle: TextStyle(
color: Colors.white,
fontSize: 17,
),
backgroundColor: Colors.pinkAccent,
labelPadding: EdgeInsets.symmetric(horizontal: 10),
),
]
),
)
],
),
),
here if I add or delete any content then I have to increase or decrease the size manually. can anyone help me with this?