decodeValue method

  1. @protected
dynamic decodeValue(
  1. dynamic value,
  2. dynamic fromEncodable(
    1. Map<String, dynamic>
    )?, {
  3. ValueProcessor processor = ValueProcessor.none,
  4. List<int> process(
    1. dynamic
    )?,
})

Returns a value decoded from the provided value

  • bytes: The list of bytes
  • fromEncodable: An function that converts between the Map representation and the object
  • processor: The value transformation to apply if any
  • process: A transformer function

Returns the decoded value from the provided value

Implementation

@protected
dynamic decodeValue(
    dynamic value, dynamic Function(Map<String, dynamic>)? fromEncodable,
    {ValueProcessor processor = ValueProcessor.none,
    List<int> Function(dynamic)? process}) {
  List<int> bytes;
  if (processor == ValueProcessor.custom && process != null) {
    bytes = process(value);
  } else if (processor == ValueProcessor.cast) {
    bytes = (value as List).cast<int>();
  } else {
    bytes = value as List<int>;
  }

  return decodeBinaryValue(Uint8List.fromList(bytes), fromEncodable);
}