decode<T, U> method

List<T> decode<T, U>(
  1. Iterable items,
  2. JsonRpcParser<T, U> parse, {
  3. bool growable = false,
})

Converts a serialised list of items into a List<T>.

The parse method converts each item from type U into T.

The List has a fixed length if growable is false.

Implementation

List<T> decode<T, U>(
  final Iterable items,
  final JsonRpcParser<T, U> parse, {
  final bool growable = false,
}) {
  return items.map((final item) => parse(item as U)).toList(growable: growable);
}