tryDecode<T, U> method

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

Converts a encoded 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.

Returns null if items is null.

Implementation

List<T>? tryDecode<T, U>(
  final Iterable? items,
  final JsonRpcParser<T, U> parse, {
  final bool growable = false,
}) {
  return items != null ? decode<T, U>(items, parse, growable: growable) : null;
}