$dataFromBytes static method

$Value? $dataFromBytes(
  1. Runtime runtime,
  2. $Value? target,
  3. List<$Value?> args
)

Implementation

static $Value? $dataFromBytes(
  Runtime runtime,
  $Value? target,
  List<$Value?> args,
) {
  final bytes = (args[0]!.$value as List)
      .map((e) => (e is $Value ? e.$reified : e) as int)
      .toList();
  final parameters = (args[2]?.$value as Map?)?.map(
    (key, value) =>
        MapEntry(key.$reified.toString(), value.$reified.toString()),
  );
  return $Uri.wrap(
    Uri.dataFromBytes(
      bytes,
      mimeType: args[1]?.$value ?? "application/octet-stream",
      parameters: parameters,
      percentEncoded: args[3]?.$value ?? false,
    ),
  );
}