1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import 'package:sport/bean/rank_game_info.dart';
- import 'package:sport/bean/user.dart';
- import 'package:sport/services/Converter.dart';
- class AchievementRule {
- List<Table>? table;
- List<Texts>? texts;
- AchievementRule({this.table, this.texts});
- AchievementRule.fromJson(Map<String, dynamic> json) {
- if (json['table'] != null) {
- table =[];
- json['table'].forEach((v) {
- table!.add(new Table.fromJson(v));
- });
- }
- if (json['texts'] != null) {
- texts = [];
- json['texts'].forEach((v) {
- texts!.add(new Texts.fromJson(v));
- });
- }
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- if (this.table != null) {
- data['table'] = this.table!.map((v) => v.toJson()).toList();
- }
- if (this.texts != null) {
- data['texts'] = this.texts!.map((v) => v.toJson()).toList();
- }
- return data;
- }
- }
- class Table {
- String? condition;
- int score = 0;
- int exp = 0;
- Table({this.condition, this.score=0, this.exp=0});
- Table.fromJson(Map<String, dynamic> json) {
- condition = json['condition'];
- score = json['score']??0;
- exp = json['exp']??0;
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['condition'] = this.condition;
- data['score'] = this.score;
- data['exp'] = this.exp;
- return data;
- }
- }
- class Texts {
- String? title;
- String? content;
- Texts({this.title, this.content});
- Texts.fromJson(Map<String, dynamic> json) {
- title = json['title'];
- content = json['content'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['title'] = this.title;
- data['content'] = this.content;
- return data;
- }
- }
|