import 'package:sport/services/Converter.dart';

class ShareInfo {
  int id;
  String hash;

  ShareInfo.fromJson(Map<String, dynamic> json) {
    id = Converter.toInt(json['id']);
    hash = json['hash'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data["share"] = this.hash;
    return data;
  }
}

class Share {
  int id;
  String hash;
  int consume;
  double defeat;
  int duration;
  String period;
  double weight;
  Share(
      {this.id,
      this.hash,
      this.consume,
      this.defeat,
      this.duration,
      this.period,
      this.weight});

  Share.fromJson(Map<String, dynamic> json) {
    id = Converter.toInt(json['id']);
    hash = json["hash"];
    consume = json['consume'];
    defeat = json['defeat'];
    duration = json['duration'];
    period = json['period'];
    weight = json['weight'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data["hash"] = this.hash;
    data["consume"] = this.consume;
    data['defeat'] = this.defeat;
    data['duration'] = this.duration;
    data['period'] = this.period;
    data['weight'] = this.weight;
    return data;
  }
}
