defaultAvatarUrl property

String get defaultAvatarUrl

This function is a getter that returns the default avatar URL of a User as String.

If the user has an avatar, it returns the URL of that avatar. Otherwise, it returns a URL for the default avatar image based on the User's discriminator.

Implementation

String get defaultAvatarUrl => _avatar != null
  ? '${_avatar?.url}'
  : '${Constants.cdnUrl}/embed/avatars/${int.parse(_discriminator) % 5 }.png';