default to success and hide indicators if not needed
This commit is contained in:
@@ -58,7 +58,7 @@ class Attachment {
|
||||
final AttachmentFile file;
|
||||
|
||||
/// The current upload state of the attachment
|
||||
final UploadState uploadState;
|
||||
UploadState uploadState;
|
||||
|
||||
/// Map of custom channel extraData
|
||||
@JsonKey(includeIfNull: false)
|
||||
@@ -123,10 +123,15 @@ class Attachment {
|
||||
this.actions,
|
||||
this.extraData,
|
||||
this.file,
|
||||
this.uploadState,
|
||||
UploadState uploadState,
|
||||
}) : id = id ?? Uuid().v4(),
|
||||
title = title ?? file?.name,
|
||||
localUri = file?.path != null ? Uri.parse(file.path) : null;
|
||||
localUri = file?.path != null ? Uri.parse(file.path) : null {
|
||||
this.uploadState = uploadState ??
|
||||
((assetUrl != null || imageUrl != null)
|
||||
? UploadState.success()
|
||||
: UploadState.preparing());
|
||||
}
|
||||
|
||||
/// Create a new instance from a json
|
||||
factory Attachment.fromJson(Map<String, dynamic> json) {
|
||||
|
||||
Reference in New Issue
Block a user