FakeFile class

Files for tests, like Laravel's UploadedFile::fake().

final XFile photo = FakeFile.image('avatar.png', width: 64, height: 64);
final XFile pdf = FakeFile.create('invoice.pdf', kilobytes: 120);

They live in memory, so they work inside testWidgets.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Methods

create(String name, {int kilobytes = 0, String? mimeType}) → XFile
A file of kilobytes zero bytes, with the MIME type its name suggests unless mimeType is given.
image(String name, {int width = 10, int height = 10}) → XFile
A real, decodable PNG of width by height pixels. The contents are always PNG, whatever extension name has.