Advertisement
muhaiminurabir

circle round image flutter

Apr 28th, 2025
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.67 KB | None | 0 0
  1.               CircleAvatar(
  2.                 backgroundColor: Colors.blue.shade200,
  3.                 radius: 20,
  4.                 child:
  5.                     context.read<UserProvider>().userResponse?.data != null
  6.                         ? CachedNetworkImage(
  7.                           imageUrl:
  8.                               context
  9.                                   .read<UserProvider>()
  10.                                   .userResponse!
  11.                                   .data!
  12.                                   .attributesdata!
  13.                                   .avatarUrl!,
  14.                           imageBuilder:
  15.                               (context, imageProvider) => Container(
  16.                                 decoration: BoxDecoration(
  17.                                   shape: BoxShape.circle,
  18.                                   image: DecorationImage(
  19.                                     image: imageProvider,
  20.                                     fit: BoxFit.cover,
  21.                                   ),
  22.                                 ),
  23.                               ),
  24.                           placeholder:
  25.                               (context, url) => CircularProgressIndicator(),
  26.                           errorWidget:
  27.                               (context, url, error) => SvgPicture.asset(
  28.                                 "assets/images/ic_profile.svg",
  29.                                 fit: BoxFit.cover,
  30.                               ),
  31.                         )
  32.                         : SvgPicture.asset(
  33.                           "assets/images/ic_profile.svg",
  34.                           fit: BoxFit.cover,
  35.                         ),
  36.               ),
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement