getDataDetail function

String getDataDetail(
  1. Object? data,
  2. bool includeContent
)

Implementation

String getDataDetail(Object? data, bool includeContent) {
  var detail = "";
  if (data is Uint8List) {
    detail = "Binary data of length ${data.lengthInBytes}";
    if (includeContent) {
      detail += ". Content: '${formatArrayBuffer(data)}'";
    }
  } else if (data is String) {
    detail = "String data of length ${data.length}";
    if (includeContent) {
      detail += ". Content: '$data'";
    }
  }
  return detail;
}