You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
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<SignIn> signInList; |
|
List<Task> taskList; |
|
List<int> rewardList; |
|
|
|
factory SignInfo.fromJson(Map<String, dynamic> json) => SignInfo() |
|
..point = json['point'] as String |
|
..todayHasSignin = json['todayHasSignin'] as bool |
|
..rank = json['rank'] == null |
|
? null |
|
: MemberRank.fromJson(json['rank'] as Map<String, dynamic>) |
|
..signInList = (json['signInList'] as List) |
|
?.map((e) => |
|
e == null ? null : SignIn.fromJson(e as Map<String, dynamic>)) |
|
?.toList() |
|
..taskList = (json['taskList'] as List) |
|
?.map( |
|
(e) => e == null ? null : Task.fromJson(e as Map<String, dynamic>)) |
|
?.toList() |
|
..rewardList = (json['rewardList'] as List)?.map((e) => e as int)?.toList(); |
|
Map<String, dynamic> toJson() => <String, dynamic>{ |
|
'point': this.point, |
|
'todayHasSignin': this.todayHasSignin, |
|
'rank': this.rank, |
|
'signInList': this.signInList, |
|
'taskList': this.taskList, |
|
'rewardList': this.rewardList, |
|
}; |
|
|
|
|
|
}
|
|
|