listFromJson static method

List<Bookmark> listFromJson(
  1. List? json
)

Implementation

static List<Bookmark> listFromJson(List<dynamic>? json) {
  if (json == null) {
    return <Bookmark>[];
  }

  return json.fold(<Bookmark>[], (List<Bookmark> previousValue, element) {
    final Bookmark? object = Bookmark.fromJson(element);
    if (object is Bookmark) {
      previousValue.add(object);
    }

    return previousValue;
  });
}