The thing is I want the image to be fixed even when the window is being resized , Here’s the code :
CircleAvatar(
radius: 60.0,
backgroundImage: const AssetImage('images/profile.png'),
),
I tried using SizedBox , FittedBox Align Center and nothing actually worked , I wondering if is it even possible to make it fix in a place
4
Answers
I got it fixed by removing the
BackgroundImage
and also cropping the image into circular instead of default rectangle (I named it as "profile-modified"). I usedImage.assest
as a child ofCircleAvatar
and usingfit: BoxFit.cover
.The modified code looks this way :
change the radius of circle avatar according to screen width using media query like this.
change 0.4 to any value want
Try
Align
Widget Like This:Read This Documentation
See This
Image 1 And Image2
you may use use [nb_utils][1] package to create responsive apps, To make responsive avatar you can use radius 40.w. so 40.w will be responsive according to width of screen.
initialize nb_utils in main.dart file for initializing.
Supported Platform
you may change 40.w according to your need.