kopia lustrzana https://gitlab.com/mysocialportal/relatica
21 wiersze
392 B
Dart
21 wiersze
392 B
Dart
enum AttachmentMediaType {
|
|
unknown,
|
|
image,
|
|
video;
|
|
|
|
static AttachmentMediaType parse(String? text) {
|
|
if (text == null) {
|
|
return AttachmentMediaType.unknown;
|
|
}
|
|
|
|
if (text == 'gif' || text == 'gifv') {
|
|
return AttachmentMediaType.image;
|
|
}
|
|
|
|
return AttachmentMediaType.values.firstWhere(
|
|
(e) => e.name == text,
|
|
orElse: () => unknown,
|
|
);
|
|
}
|
|
}
|