BundleResources class
Read/write surface for one reserved folder under a bundle's .mbd/
root. All paths are forward-slash separated and resolved relative to
the folder root — absolute paths and .. traversal are rejected.
Constructors
- BundleResources({required String bundleRoot, required BundleFolder folder})
-
Bind to
<bundleRoot>/<folder.name>.
Properties
- folder → BundleFolder
-
Which reserved folder this surface points at.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
String relativePath) → Future< void> - Delete the file. No-op when missing.
-
exists(
String relativePath) → Future< bool> - Whether the file exists.
-
list(
{String? extension}) → Future< List< String> > - Enumerate files under this folder.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String relativePath) → Future< String> - Read file contents as UTF-8 text.
-
readBytes(
String relativePath) → Future< Uint8List> - Read file contents as raw bytes.
-
readJson(
String relativePath) → Future -
Decode
relativePathas JSON text. Convenience wrapper around read +jsonDecodeso callers don't repeat the boilerplate. -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String relativePath, String content) → Future< void> - Write UTF-8 text. Creates parent directories as needed.
-
writeBytes(
String relativePath, Uint8List bytes) → Future< void> - Write raw bytes. Creates parent directories as needed.
-
writeJson(
String relativePath, Object? value, {int indent = 2}) → Future< void> -
JSON-encode
valueand write as UTF-8 text. Creates parent directories as needed.indentcontrols pretty-printing — 0 emits a single line with no padding; > 0 uses that many spaces. Symmetric with readJson so callers stop repeatingjsonEncode+ write.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited