profileUrl method

String profileUrl({
  1. String type = ".json",
})

generate ProfileUrl for Gravatar

Implementation

String profileUrl({String type = ".json"}) {
  if (type.isNotEmpty) {
    type = type.toLowerCase().trim();
  }
  type = !type.startsWith(".") ? ("." + type) : type;
  if (!".json .xml .php .vcf .qr".contains(type)) {
    type = ".json"; //default
  }

  return _gravatarUrl + _generateMd5(_email) + type;
}