PageModel.fromMap constructor

PageModel.fromMap(
  1. Map<String, dynamic> map
)

This is will help us to create object from Map

Implementation

factory PageModel.fromMap(Map<String, dynamic> map) {
  return PageModel(
    kind: map['kind'],
    items: map['items'] != null
        ? List<PostItemModel>.from(
            map['items']?.map((x) => PostItemModel.fromMap(x)))
        : null,
    etag: map['etag'],
    error: map['error'],
  );
}