Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off centre display #9

Closed
AllanSullivan opened this issue Apr 24, 2020 · 4 comments
Closed

Off centre display #9

AllanSullivan opened this issue Apr 24, 2020 · 4 comments

Comments

@AllanSullivan
Copy link

I've just tried this package out but get an unexpected output, the icon is not centered.
Screenshot_20200424-114218

CircularProfileAvatar(
                    null,
                    child: Icon(
                      Icons.account_circle,
                      size: 200.0,
                    ),
                    borderColor: Colors.black,
                    borderWidth: 3,
                    elevation: 5,
                    radius: 75,
                  )
@ch-muhammad-adil
Copy link
Owner

Thanks Allan for reporting that, let me give a try to your code.

@ch-muhammad-adil
Copy link
Owner

ch-muhammad-adil commented Apr 24, 2020

@AllanSullivan just try this code please

           CircularProfileAvatar(
              null,
              child: Icon(
                Icons.account_circle,
                size: 150,
              ),
              borderColor: Colors.black,
              borderWidth: 0,
              elevation: 0,
              radius: 75,
            )

What you are doing here, you have set size of your Icon to 200, which should be below radius+border of the CircularProfileAvatar widget.

So I have given you a sample without adding any border and elevation so you can know where things are wrong. Please try to use 145 size of Icon.

@ch-muhammad-adil
Copy link
Owner

So for your case this code should work fine

  CircularProfileAvatar(
            null,
            child: Icon(
              Icons.account_circle,
              size: 145,
            ),
            borderColor: Colors.black,
            borderWidth: 3,
            elevation: 5,
            radius: 75,
          )

@ch-muhammad-adil
Copy link
Owner

I am closing this now I hope this is what you are looking for :) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants