zeshanghayoomi / flutter_user_profile_avatar

A simple widget that display round profile picture where the picture is fetched from network and displays circular progress indicator whilst the image is being loaded. Also, has the ability to display notification bubble.
MIT License
3 stars 0 forks source link

Can't use in ListTile as Leading #1

Closed kitsuniru closed 3 years ago

kitsuniru commented 3 years ago

It causes glitches like this:

image

zeshanghayoomi commented 3 years ago

No worries I will have a look at it and will get back to you, thank you for pointing this out

zeshanghayoomi commented 3 years ago

@MindMayhem

try this:

ListTile(
  title: FittedBox(
    fit: BoxFit.scaleDown,
    alignment: Alignment.topLeft,
    child: UserProfileAvatar(
      avatarUrl: 'https://picsum.photos/id/237/5000/5000',
      radius: 40,
      notificationCount: 10,
      notificationBubbleTextStyle: TextStyle(fontSize: 16),
      avatarSplashColor: Colors.red,
      onAvatarTap: () => print('Avatar Tapped'),
    ),
  ),
  leading: Text('Leading'),
  trailing: Text('Trailing'),
  subtitle: Text('Subtitle'),
  tileColor: Colors.grey[900],
  onTap: () => print('Tapped'),
),

Screenshot 2021-08-31 at 2 20 18 pm

zeshanghayoomi commented 3 years ago

@MindMayhem any feedback would be appreciated otherwise I will be closing this issue.