getPropertyValueRaw function

List<Uint8List> getPropertyValueRaw(
  1. List<String> values,
  2. List<String> types
)

Implementation

List<Uint8List> getPropertyValueRaw(List<String> values, List<String> types) {
  if (values.length != types.length) {
    throw ArgumentError("Length of property values and types not match");
  }

  final results = <Uint8List>[];
  for (var index = 0; index < types.length; index++) {
    try {
      final typeTag = getPropertyType(types[index]);
      final serializer = Serializer();
      serializeArg(values[index], typeTag, serializer);
      results.add(serializer.getBytes());
    } catch (error) {
      // if not support type, just use the raw string bytes
      results.add(Uint8List.fromList(utf8.encode(values[index])));
    }
  }

  return results;
}