AttachmentFile constructor
Creates a new AttachmentFile instance.
Implementation
AttachmentFile({
required this.size,
this.path,
String? name,
this.bytes,
}) : assert(
path != null || bytes != null,
'Either path or bytes should be != null',
),
assert(
!CurrentPlatform.isWeb || bytes != null,
'File by path is not supported in web, Please provide bytes',
),
assert(
name?.contains('.') ?? true,
'Invalid file name, should also contain file extension',
),
_name = name;