readFile static method

Future<AssetItem?> readFile(
  1. String path,
  2. Lib lib,
  3. SharedOptions options
)
override

Implementation

static Future<AssetItem?> readFile(String path, Lib lib, SharedOptions options) async {
  final AssetItem? asset = await AssetItem.readFile(path, lib, options);
  if (asset != null) {
    final Image? img = decodeImage(asset.content!);
    return img == null
      ? asset
      : ImageAssetItem(
        path: asset.path,
        name: asset.name,
        hash: asset.hash,
        lib: asset.lib,
        options: asset.options,
        content: asset.content,
        width: img.width,
        height: img.height,
      );
  } else {
    return null;
  }
}