123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- class ShopIndex {
- Shop? shop;
- List<Items>? items;
- ShopUser? user;
- ShopIndex({this.shop, this.items, this.user});
- ShopIndex.fromJson(Map<String, dynamic> json) {
- print(json);
- shop = json['shop'] != null ? new Shop.fromJson(json['shop']) : null;
- if (json['items'] != null) {
- items =[];
- json['items'].forEach((v) {
- items!.add(new Items.fromJson(v));
- });
- }
- user = json['user'] != null ? new ShopUser.fromJson(json['user']) : null;
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- if (this.shop != null) {
- data['shop'] = this.shop!.toJson();
- }
- if (this.items != null) {
- data['items'] = this.items!.map((v) => v.toJson()).toList();
- }
- if (this.user != null) {
- data['user'] = this.user!.toJson();
- }
- return data;
- }
- }
- class Shop {
- int? id;
- int? gameId;
- String? name;
- String? type;
- Shop({this.id, this.gameId, this.name, this.type});
- Shop.fromJson(Map<String, dynamic> json) {
- id = json['id'];
- gameId = json['game_id'];
- name = json['name'];
- type = json['type'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['game_id'] = this.gameId;
- data['name'] = this.name;
- data['type'] = this.type;
- return data;
- }
- }
- class Items {
- int? id;
- int? shopId;
- int? gameId;
- String? name;
- String? logo;
- int? price;
- String? detail;
- int? valid;
- Items(
- {this.id,
- this.shopId,
- this.gameId,
- this.name,
- this.logo,
- this.price,
- this.detail,
- this.valid});
- Items.fromJson(Map<String, dynamic> json) {
- id = json['id'];
- shopId = json['shop_id'];
- gameId = json['game_id'];
- name = json['name'];
- logo = json['logo'];
- price = json['price'];
- detail = json['detail'];
- valid = json['valid'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['shop_id'] = this.shopId;
- data['game_id'] = this.gameId;
- data['name'] = this.name;
- data['logo'] = this.logo;
- data['price'] = this.price;
- data['detail'] = this.detail;
- data['valid'] = this.valid;
- return data;
- }
- }
- class ShopUser {
- int? score;
- ShopUser({this.score});
- ShopUser.fromJson(Map<String, dynamic> json) {
- score = json['score'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['score'] = this.score;
- return data;
- }
- }
- class ScoreList {
- List<ScoreListData>? data;
- ScoreList({this.data});
- ScoreList.fromJson(Map<String, dynamic> json) {
- if (json['data'] != null) {
- data = [];
- json['data'].forEach((v) {
- data!.add(new ScoreListData.fromJson(v));
- });
- }
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- if (this.data != null) {
- data['data'] = this.data!.map((v) => v.toJson()).toList();
- }
- return data;
- }
- }
- class ScoreListData {
- int? id;
- int? userId;
- int? score;
- String? from;
- String? detail;
- String? createdAt;
- ScoreListData(
- {this.id,
- this.userId,
- this.score,
- this.from,
- this.detail,
- this.createdAt});
- ScoreListData.fromJson(Map<String, dynamic> json) {
- id = json['id'];
- userId = json['user_id'];
- score = json['score'];
- from = json['from'];
- detail = json['detail'];
- createdAt = json['created_at'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['user_id'] = this.userId;
- data['score'] = this.score;
- data['from'] = this.from;
- data['detail'] = this.detail;
- data['created_at'] = this.createdAt;
- return data;
- }
- }
|