import 'package:sport/bean/sport_target.dart'; class SportTargetRecord { int id; int userId; int consume; int duration; int consumeTarget; int durationTarget; bool finish; String type; String createdAt; int durationMinute; int durationTargetMinute; SportTargetRecord( {this.id, this.userId, this.consume, this.duration, this.consumeTarget, this.durationTarget, this.finish, this.type, this.createdAt, this.durationMinute, this.durationTargetMinute}); SportTargetRecord.fromJson(Map json) { id = json['id']; userId = json['user_id']; consume = json['consume']; duration = json['duration']; consumeTarget = json['consume_target']; durationTarget = json['duration_target']; finish = json['finish']; type = json['type']; createdAt = json['created_at']; durationMinute = json['duration_minute']; durationTargetMinute = json['duration_target_minute']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['user_id'] = this.userId; data['consume'] = this.consume; data['duration'] = this.duration; data['consume_target'] = this.consumeTarget; data['duration_target'] = this.durationTarget; data['finish'] = this.finish; data['type'] = this.type; data['created_at'] = this.createdAt; data['duration_minute'] = this.durationMinute; data['duration_target_minute'] = this.durationTargetMinute; return data; } }