from static method

JSONPaging? from(
  1. Object? json
)

Implementation

static JSONPaging? from(Object? json) {
  if (json == null) return null;

  _registerPagingFormats();

  if (json is JSONPaging) return json;

  for (var entry in _pagingFormats.entries) {
    var matcher = entry.key;

    if (matcher(json)) {
      var instantiator = entry.value;
      return instantiator(json);
    }
  }

  return null;
}