💄 Better posting with attachments

This commit is contained in:
2025-04-26 16:11:09 +08:00
parent d4538a9ef6
commit bdb602c8c6
3 changed files with 263 additions and 50 deletions

View File

@ -3,6 +3,21 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'file.freezed.dart';
part 'file.g.dart';
enum UniversalFileType { image, video, audio, file }
@freezed
abstract class UniversalFile with _$UniversalFile {
const UniversalFile._();
const factory UniversalFile({
required dynamic data,
required UniversalFileType type,
}) = _UniversalFile;
bool get isOnCloud => data is SnCloudFile;
bool get isOnDevice => !isOnCloud;
}
@freezed
abstract class SnCloudFile with _$SnCloudFile {
const factory SnCloudFile({