24 lines
570 B
Dart
24 lines
570 B
Dart
enum MediaAttachmentType {
|
|
image,
|
|
video,
|
|
gifv,
|
|
audio,
|
|
unknown,
|
|
}
|
|
|
|
class MediaAttachmentModel {
|
|
late MediaAttachmentType type;
|
|
late String url;
|
|
late String previewUrl;
|
|
late String? description;
|
|
|
|
MediaAttachmentModel.fromJson(Map<String, dynamic> json) {
|
|
url = json["url"];
|
|
previewUrl = json["preview_url"];
|
|
type = MediaAttachmentType.values.firstWhere((element) =>
|
|
// ignore: prefer_interpolation_to_compose_strings
|
|
element.toString() == "MediaAttachmentType." + json["type"]);
|
|
description = json["description"];
|
|
}
|
|
}
|