import 'package:huixiang/retrofit/data/member_rank.dart'; import 'package:huixiang/retrofit/data/sign_in.dart'; import 'package:huixiang/retrofit/data/task.dart'; class SignInfo { SignInfo(); String point; bool todayHasSignin; MemberRank rank; List signInList; List taskList; List rewardList; factory SignInfo.fromJson(Map json) => SignInfo() ..point = json['point'] as String ..todayHasSignin = json['todayHasSignin'] as bool ..rank = json['rank'] == null ? null : MemberRank.fromJson(json['rank'] as Map) ..signInList = (json['signInList'] as List) ?.map((e) => e == null ? null : SignIn.fromJson(e as Map)) ?.toList() ..taskList = (json['taskList'] as List) ?.map( (e) => e == null ? null : Task.fromJson(e as Map)) ?.toList() ..rewardList = (json['rewardList'] as List)?.map((e) => e as int)?.toList(); Map toJson() => { 'point': this.point, 'todayHasSignin': this.todayHasSignin, 'rank': this.rank, 'signInList': this.signInList, 'taskList': this.taskList, 'rewardList': this.rewardList, }; }