writeCanRead function

BuildBehavior writeCanRead(
  1. AssetId assetId
)

A build behavior which writes either 'true' or 'false' depending on whether assetId can be read.

Implementation

BuildBehavior writeCanRead(AssetId assetId) =>
    (BuildStep buildStep, Map<String, List<String>> buildExtensions) =>
        _copyToAll(
          buildStep,
          buildExtensions,
          readFrom: (_) => assetId,
          read: (buildStep, assetId) async =>
              '${await buildStep.canRead(assetId)}',
        );