LegacyProfileTextures.fromJson constructor

LegacyProfileTextures.fromJson(
  1. Map<String, dynamic> json
)

Implementation

LegacyProfileTextures.fromJson(Map<String, dynamic> json) {
  Map skin = json['textures']['SKIN'] ?? {},
      cape = json['textures']['CAPE'] ?? {};
  this
    .._timestamp = json['timestamp']
    .._profileId = json['profileId']
    .._profileName = json['profileName']
    // .._signatureRequired = json['signatureRequired'] ?? false
    .._skinUrl = skin['url'] ?? ''
    .._skinModel = (skin['metadata'] ?? {})['model'] == 'slim'
        ? SkinModel.slim
        : SkinModel.classic
    .._capeUrl = cape['url'] ?? '';
}