MemoryPublishLoader class
A PublishLoader over bundles in memory: tests, previews, and apps that ship their layouts. bundles holds one bundle per source; a source without one uses PublishSource.publish's.
assets are the site's files by their relative path (a site read from a folder: its fonts and images); readAsset, when given, reads the ones not there (from the folder, on demand).
- Implemented types
Constructors
-
MemoryPublishLoader(PublishBundle bundle, {Map<
PublishSource, PublishBundle> others = const {}, Map<String, Uint8List> assets = const {}, Future<Uint8List?> readAsset(String path)?})
Properties
-
assets
→ Map<
String, Uint8List> -
The site's files, by path relative to the site.
final
-
bundles
→ Map<
PublishSource, PublishBundle> -
final
-
calls
→ List<
String> -
Calls made, for tests:
model:<source>,layout:<source>:<id>andcomponent:<source>:<type>.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
readAsset
→ Future<
Uint8List?> Function(String path)? -
Reads a site file assets does not hold; null: none.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
assetUrl(
String path) → Uri? -
Where file
pathis served, when it has a URL (an image is then loaded from there, cached by the platform); null when it is read as bytes only (loadAsset).override -
loadAsset(
String path) → Future< Uint8List> -
The bytes of file
path; throws PublishLoadException when there is no such file.override -
loadComponent(
PublishSource source, String type) → Future< PublishComponent> -
Component
type(a type name the model'scomponentslists): the definition stored at PublishSource.componentPath. Throws a PublishLoadException when there is none.override -
loadLayout(
PublishSource source, String layoutId) → Future< PublishLayout> -
Layout
layoutId(a layout id the model lists).override -
loadModel(
PublishSource source) → Future< PublishModel> -
The project's publish model.
override
-
loadPlugin(
String id, int version) → Future< PluginVersion?> -
The plugin versions the publish bundle embeds.
override
-
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