fromJson<T> function

T fromJson<T>(
  1. dynamic json,
  2. T fromJson(
    1. Map<String, dynamic>
    )
)

Converts argument json to object T using the converter function fromJson

Implementation

T fromJson<T>(json, T Function(Map<String, dynamic>) fromJson) {
  if (json is Map) {
    return fromJson(json.cast());
  } else {
    throw ArgumentError(
        'Argument \'json\' must be of type \'Map\': ${json.runtimeType}');
  }
}