PostModel.fromMap constructor

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

This is will help us to create object from Map

Implementation

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