In-memory implementation of AssetReader
and AssetWriter
.
testing provides a ReaderWriterTesting that gives access to the in-memory filesystem for tests to directly modify files and check on files.
Writes and deletes are notified to FakeWatcher.
Constructors
- TestReaderWriter.new({String? rootPackage})
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- testing → ReaderWriterTesting
-
no setter
Methods
-
canRead(
AssetId id) → Future< bool> -
Indicates whether asset at
id
is readable.inherited -
delete(
AssetId id) → Future< void> -
Delete
id
.inherited -
deleteDirectory(
AssetId id) → Future< void> -
Delete the directory
id
recursively.inherited -
digest(
AssetId id) → Future< Digest> -
Returns a
Digest
representing a hash of the contents ofid
.inherited -
findAssets(
Glob glob) → Stream< AssetId> -
Returns all readable assets matching
glob
under the current package.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readAsBytes(
AssetId id) → Future< List< int> > -
Returns a Future that completes with the bytes of a binary asset.
inherited
-
readAsString(
AssetId id, {Encoding encoding = utf8}) → Future< String> -
Returns a Future that completes with the contents of a text asset.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
writeAsBytes(
AssetId id, List< int> bytes) → Future<void> -
Writes
bytes
to a binary file located atid
.inherited -
writeAsString(
AssetId id, String contents, {Encoding encoding = utf8}) → Future< void> -
Writes
contents
to a text file located atid
withencoding
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited