Search code examples
flutterdartwidget

Any widgets in flutter allow me to have a profile picture but if they don't have one the initials show instead?


Im trying to make a flutter app for HR and for my employee's section I need to have it so that their initials are shown if a profile picture is unavailable is there a widget which allows me to do this?

Below is an example of what im trying to achieve

This is an Example of what im trying to achieve


Solution

  • You can try it with CachedNetworkImage

    CachedNetworkImage(
                imageUrl: "http://myimage...",
                placeholder: (context, url) => new CircularProgressIndicator(),
                errorWidget: (context, url, error) => new Text("my initials here"),
             ),