fromJson static method

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

Implementation

static ProfilePhoto? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return ProfilePhoto(
    id: int.tryParse((json['id'] as dynamic)?.toString() ?? '') ?? 0,
    small: File.fromJson(tdMapFromJson(json['small'])),
    big: File.fromJson(tdMapFromJson(json['big'])),
    minithumbnail: Minithumbnail.fromJson(
      tdMapFromJson(json['minithumbnail']),
    ),
    hasAnimation: (json['has_animation'] as bool?) ?? false,
    isPersonal: (json['is_personal'] as bool?) ?? false,
  );
}