import 'dart:convert';

List<UsersList> usersListFromJson(String str) =>
    List<UsersList>.from(json.decode(str).map((x) => UsersList.fromJson(x)));

String usersListToJson(List<UsersList> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class UsersList {
  UsersList({
    required this.userId,
    required this.id,
    required this.title,
    required this.body,
  });

  int userId;
  int id;
  String title;
  String body;

  factory UsersList.fromJson(Map<String, dynamic> json) => UsersList(
        userId: json["userId"],
        id: json["id"],
        title: json["title"],
        body: json["body"],
      );

  Map<String, dynamic> toJson() => {
        "userId": userId,
        "id": id,
        "title": title,
        "body": body,
      };
}
