Reputation: 1093
I just learn flutter, but i have trouble when deal with images, here is a SVG images, it not fit into container
, no matter how i use fit: Boxfit
, please help, thank a lots.
here is the code of Container
Column(
children: [
InkWell(
onTap: (){
print("heeloo");
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(width: 1.5)
),
height: SizeConfig.screenHeight * 0.12,
width: SizeConfig.screenHeight * 0.12,
child: SvgPicture.asset(
newChat,
//fit: B,
height: SizeConfig.screenHeight * 0.1,
width: SizeConfig.screenHeight * 0.1,
),
),
),
SizedBox(height: 10,),
Text(
"New Chat",
style: TextStyle(
fontFamily: fontBold,
fontSize: 25,
),
)
],
),
Here is result
but i want something like this
Upvotes: 0
Views: 2358
Reputation: 918
Adding the padding padding: EdgeInsets.all(5),
to the container works like charm.
Upvotes: 1
Reputation: 1615
add some padding in the container padding: EdgeInsets.all(10)
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(width: 1.5)
),
padding: EdgeInsets.all(10),
height: MediaQuery.of(context).size.height * 0.12,
width: MediaQuery.of(context).size.height * 0.12,
child: SvgPicture.asset(
"assets/WQb.svg",
//fit: B,
height: MediaQuery.of(context).size.height * 0.1,
width: MediaQuery.of(context).size.height * 0.1,
),
),
),
Upvotes: 4