Advertisement
muhaiminurabir

circle round image flutter

Apr 28th, 2025
473
0
Never
1
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
Comments
  • muhaiminurabir
    21 days (edited)
    # text 1.98 KB | 0 0
    1. CircleAvatar(
    2. radius: 28,
    3. child: CachedNetworkImage(
    4. height: 60,
    5. width: 60,
    6. imageUrl:
    7. context
    8. .watch<CommonProvider>()
    9. .productDetailsResponse
    10. ?.data
    11. ?.relatedItems
    12. ?.data?[position]
    13. ?.imageUrl ??
    14. "",
    15. placeholder:
    16. (context, url) => Image.asset(
    17. "assets/images/placeholder_image.png",
    18. height: 60,
    19. width: 60,
    20. fit: BoxFit.fill,
    21. scale: 10,
    22. ),
    23. errorWidget:
    24. (context, url, error) => Image.asset(
    25. "assets/images/placeholder_image.png",
    26. height: 60,
    27. width: 60,
    28. fit: BoxFit.fill,
    29. scale: 10,
    30. ),
    31. fit: BoxFit.cover,
    32. imageBuilder:
    33. (context, imageProvider) => CircleAvatar(
    34. backgroundImage: imageProvider,
    35. ),
    36. ),
    37. ),
    38.  
Add Comment
Please, Sign In to add comment
Advertisement