BloomFile class

Platform-neutral file descriptor for file inputs and attachments.

Keeps form.dart pure Dart without requiring browser DOM package:web imports, ensuring safe usage in Server-Side Rendering (SSR) and Dart VM unit tests. In browser execution, rawFile holds an opaque reference to the browser's native web.File.

final document = BloomFile(
  name: 'specs.pdf',
  size: 1024 * 1024,
  mimeType: 'application/pdf',
);

Constructors

BloomFile({required String name, int size = 0, String mimeType = '', DateTime? lastModified, Object? rawFile})
Creates a platform-neutral BloomFile descriptor.
const

Properties

extension → String
Returns the lowercase file extension including the leading period (e.g. '.png'), or an empty string if no extension is present.
no setter
hashCode → int
The hash code for this object.
no setteroverride
lastModified → DateTime?
Timestamp of when the file was last modified, if available.
final
mimeType → String
The MIME media type (e.g. 'image/png', 'application/pdf').
final
name → String
The filename without path (e.g. 'photo.png').
final
rawFile → Object?
Opaque handle to the underlying platform file instance (e.g. web.File in browser DOM).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
The file size in bytes.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override