79729069

Date: 2025-08-07 19:43:28
Score: 1
Natty:
Report link

There is a library for exactly this usage profile_name_avatar.
Supports network and local image with caching and has placeholder and name as fallback.

import 'package:profile_name_avatar/profile_name_avatar.dart';

ProfileImage(
  imageSource: "https://example.com/avatar.jpg",
  placeholder: "assets/images/placeholder.png",     // Fallback when imagesource fail
  fallbackName: "J D",                              // Used when both above fail
  radius: 100,                                      // Optional
  textStyle: TextStyle(                             // Optional
    fontSize: 24,
    fontWeight: FontWeight.bold,
    color: Colors.white,
  ),
  backgroundColor: Colors.orange,                   // Optional
)

Fallback example
enter image description here

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Shyamlal