AttachmentFile constructor

AttachmentFile(
  1. {required int? size,
  2. String? path,
  3. String? name,
  4. Uint8List? bytes}
)

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;