writeAsString abstract method
Writes contents
to a text file with the specified extension
using the given encoding
.
Returns a Future that completes after writing the asset out.
- Throws an error if the output was not valid (that is, the resulting file extension is not in allowedExtensions)
NOTE: Most Builder
implementations should not need to await
this
Future since the runner will be responsible for waiting until all outputs
are written.
@param contents The text content to write @param extension The extension of the file to be written (must be in allowedExtensions) @param encoding The character encoding to use (defaults to UTF-8)
Implementation
FutureOr<void> writeAsString(
String contents, {
required String extension,
Encoding encoding = utf8,
});