factory ImageState.fromJson(Map<String, dynamic> json) { return ImageState( reason: json['reason'] as String?, status: (json['status'] as String?)?.toImageStatus(), ); }