Imrpoved image handling since the size of the image is about 5MB.
This commit is contained in:
@@ -4,13 +4,15 @@ class PictureDto {
|
||||
final int id;
|
||||
final String? comment;
|
||||
final String? category;
|
||||
final String image;
|
||||
int evaluation;
|
||||
final DateTime pictureDate;
|
||||
final String? username;
|
||||
final String imageUrl;
|
||||
final String normalSizeUrl;
|
||||
final String thumbnailSizeUrl;
|
||||
|
||||
PictureDto(
|
||||
{required this.id, required this.comment, required this.category, required this.image, required this.evaluation, required this.pictureDate, required this.username});
|
||||
{required this.id, required this.comment, required this.category, required this.evaluation, required this.pictureDate, required this.username, required this.imageUrl, required this.normalSizeUrl, required this.thumbnailSizeUrl});
|
||||
|
||||
/// Create from JSON response
|
||||
factory PictureDto.fromJson(Map<String, dynamic> json) {
|
||||
@@ -18,10 +20,12 @@ class PictureDto {
|
||||
id: json['id'] as int,
|
||||
comment: json['comment'] as String?,
|
||||
category: json['category'] as String?,
|
||||
image: json['image'] as String,
|
||||
evaluation: json["evaluation"] as int,
|
||||
pictureDate: DateTimeUtils.toDateTime(json['pictureDate']) ?? DateTime.now(),
|
||||
username: json['username'] as String?
|
||||
username: json['username'] as String?,
|
||||
imageUrl: json['imageUrl'] as String,
|
||||
normalSizeUrl: json['normalSizeUrl'] as String,
|
||||
thumbnailSizeUrl: json['thumbnailSizeUrl'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user