Issue
Container(
width: 400,
height: 250,
decoration: BoxDecoration(
gradient:LinearGradient(
colors: <Color>[
Colors.purpleAccent,
Colors.pink,
]
),
borderRadius: BorderRadius.circular(10),
),
child: CircleAvatar(
backgroundImage: AssetImage('images/images.jpg'),
radius: 1,
),
),
Above in the code the radius i given is 1 but it is not working instead the image is taking the full size as the given height to container.
Here is the output image and here the radius given to image is 1 but still it taking the whole container space.
Solution
Try wrapping your CircleAvatar with a Center widget to see if it is constrained:
Container(
width: 400,
height: 250,
decoration: BoxDecoration(
gradient: LinearGradient(colors: <Color>[
Colors.purpleAccent,
Colors.pink,
]),
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: CircleAvatar(
backgroundImage: AssetImage(
'images/images.jpg',
fit: BoxFit.cover,
),
radius: 5,
),
),
)
Answered By - esentis

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.