Advertisement
SoloNadveos

ModelRawPb

Mar 6th, 2023
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.29 KB | None | 0 0
  1. class GruposModel {
  2.   GruposModel({
  3.     this.desc,
  4.     required this.expand,
  5.     this.genre,
  6.     this.id,
  7.     this.nombre,
  8.   });
  9.  
  10.   String? desc;
  11.   Expand expand;
  12.   String? genre;
  13.   String? id;
  14.   String? nombre;
  15.  
  16.   factory GruposModel.fromJson(Map<String, dynamic> json) => GruposModel(
  17.         desc: json["desc"],
  18.         expand: Expand.fromJson(json["expand"]),
  19.         genre: json["genre"],
  20.         id: json["id"],
  21.         nombre: json["nombre"],
  22.       );
  23.  
  24.   Map<String, dynamic> toJson() => {
  25.         "desc": desc,
  26.         "expand": expand.toJson(),
  27.         "genre": genre,
  28.         "id": id,
  29.         "nombre": nombre,
  30.       };
  31. }
  32.  
  33. class Expand {
  34.   Expand({
  35.     required this.genre,
  36.   });
  37.  
  38.   Genre? genre;
  39.  
  40.   factory Expand.fromJson(Map<String, dynamic> json) => Expand(
  41.         genre: json["genre"] == null ? null : Genre.fromJson(json["genre"]),
  42.       );
  43.  
  44.   Map<String, dynamic> toJson() => {
  45.         "genre": genre?.toJson(),
  46.       };
  47. }
  48.  
  49. class Genre {
  50.   Genre({
  51.     this.id,
  52.     this.nombre,
  53.   });
  54.  
  55.   String? id;
  56.   String? nombre;
  57.  
  58.   factory Genre.fromJson(Map<String, dynamic> json) => Genre(
  59.         id: json["id"],
  60.         nombre: json["nombre"],
  61.       );
  62.  
  63.   Map<String, dynamic> toJson() => {
  64.         "id": id,
  65.         "nombre": nombre,
  66.       };
  67. }
  68.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement