ch-muhammad-adil/flutter-plugin-circular_profile_avatar

Image is Oval and not Circular

Closed this issue · 1 comments

Hi, I used your library but the result image ha an oval shape.

CircularProfileAvatar(
        state.user.profileImage,
        radius: 18,
        backgroundColor: Colors.transparent,
        borderWidth: 1,
        borderColor: Colors.white,
        cacheImage: true,
        initialsText: Text(
          state.user.name[0],
          style: TextStyle(color: Colors.white, fontSize: 18),
        ),
        onTap: () {
          print("image tap");
          // action();
        },
      );

I suppose that the problem is caused because the image I used is rectangular.

Hello thanks for reporting issue, I have tried your code and it looks fine here with portrait mode picture.

CircularProfileAvatar(
                'http://www4.pictures.zimbio.com/gi/Lionel+Messi+Argentina+v+Nigeria+Group+B+2010+9LVH1-kOJNGl.jpg',
                radius: 18,
                backgroundColor: Colors.transparent,
                borderWidth: 1,
                borderColor: Colors.white,
                cacheImage: true,
                initialsText: Text(
                  'Messi'[0],
                  style: TextStyle(color: Colors.white, fontSize: 18),
                ),
                onTap: () {
                  print("image tap");
                  // action();
                },
              ),    

Here are the results it has produced, So far i guess parent widgets of CircularProfileAvatar has height/width smaller than what you have given to the radius*2 of CircularProfileAvatar. Providing more information might can help you. Right now i am closing it.

Screenshot 2019-09-11 at 1 54 45 PM

Screenshot 2019-09-11 at 1 55 09 PM