Home > front end >  How to add labels to circle avatar in flutter
How to add labels to circle avatar in flutter

Time:03-02

I have created a circle avatar and want to show the label for it as to make it clear for what the avatar is.

CodePudding user response:

You can use Stack widget sample usage:

Stack(
alignment: Alignment.center
  children: <Widget>[
    CircleAvatar(
        backgroundColor: Colors.white,
        child: ClipRect(
          child: Image.network(
            'url-to-image',
            fit: BoxFit.cover,
          ),
        ),
      )
     Center(
     child: Text(
     'label',
     textAlign: TextAlign.center))
  ],

CodePudding user response:

I suggest to use circular_profile_avatar package, you cant add label or title to CircleAvatar. by this package you can add Text over your like Stack.

if you didnt like package you can follow this link, i hope it helps.

  • Related