DataBundle.fromString constructor

DataBundle.fromString(
  1. String content,
  2. String url, {
  3. ContentType? contentType,
})

Implementation

DataBundle.fromString(String content, String url, {ContentType? contentType}) : super(url) {
  // Encode string to data by utf8.
  data = Uint8List.fromList(utf8.encode(content));
  _contentType = contentType ?? ContentType.text;
}