getSkins property

List<ProfileTexture> get getSkins

Implementation

List<ProfileTexture> get getSkins {
  if (_skins.isNotEmpty) {
    // We're not on a legacy profile.
    return _skins
        .map((element) {
          if (element is Map<String, dynamic>) {
            return ProfileTexture(
                element['id'],
                element['url'],
                element['alias'],
                element['variant'] == 'CLASSIC'
                    ? SkinModel.classic
                    : SkinModel.slim);
          }
        })
        .where((t) => t != null)
        .cast<ProfileTexture>()
        .toList();
  } else {
    // Legacy profile, convert using LegacyProfileTextures.
    // They also only have a single texture.
    final tex = _getTextures;
    return [
      ProfileTexture(tex._profileId, tex.skinUrl(), null, tex.skinModel)
    ];
  }
}