jsonList<T> static method

List<T> jsonList<T>(
  1. dynamic json,
  2. T fromJson(
    1. dynamic
    )
)

Implementation

static List<T> jsonList<T>(dynamic json, T Function(dynamic) fromJson) =>
    json != null
    ? json is List
          ? json.map((e) => fromJson(e)).toList()
          : [fromJson(json)]
    : <T>[];