writeAsBytes method Null safety

  1. @override
Future<void> writeAsBytes(
  1. AssetId id,
  2. FutureOr<List<int>> bytes

Writes bytes to a binary file located at id.

Returns a Future that completes after writing the asset out.

  • Throws a PackageNotFoundException if id.package is not found.
  • Throws an InvalidOutputException if the output was not valid (that is, id is not in allowedOutputs)

NOTE: Most Builder implementations should not need to await this Future since the runner will be responsible for waiting until all outputs are written.


Future<void> writeAsBytes(AssetId id, FutureOr<List<int>> bytes);