6 changed files with 238 additions and 20 deletions
Unified View
Diff Options
-
23lib/controller/setting/task_controller.dart
-
115lib/model/live/matchmaker_task.dart
-
3lib/network/api_urls.dart
-
8lib/network/home_api.dart
-
33lib/network/home_api.g.dart
-
76lib/pages/setting/match_task_page.dart
@ -0,0 +1,115 @@ |
|||||
|
class SubListItem { |
||||
|
final String? subTaskName; |
||||
|
final int? subTaskType; |
||||
|
final String? subTaskDesc; |
||||
|
final int? requiredCount; |
||||
|
final int? completeCount; |
||||
|
final bool? completeStatus; |
||||
|
final String? completeTime; |
||||
|
final int? sort; |
||||
|
|
||||
|
SubListItem({ |
||||
|
this.subTaskName, |
||||
|
this.subTaskType, |
||||
|
this.subTaskDesc, |
||||
|
this.requiredCount, |
||||
|
this.completeCount, |
||||
|
this.completeStatus, |
||||
|
this.completeTime, |
||||
|
this.sort, |
||||
|
}); |
||||
|
|
||||
|
factory SubListItem.fromJson(Map<String, dynamic> json) { |
||||
|
return SubListItem( |
||||
|
subTaskName: json['subTaskName'] as String?, |
||||
|
subTaskType: json['subTaskType'] as int?, |
||||
|
subTaskDesc: json['subTaskDesc'] as String?, |
||||
|
requiredCount: json['requiredCount'] as int?, |
||||
|
completeCount: json['completeCount'] as int?, |
||||
|
completeStatus: json['completeStatus'] as bool?, |
||||
|
completeTime: json['completeTime'] as String?, |
||||
|
sort: json['sort'] as int?, |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
Map<String, dynamic> toJson() { |
||||
|
return { |
||||
|
'subTaskName': subTaskName, |
||||
|
'subTaskType': subTaskType, |
||||
|
'subTaskDesc': subTaskDesc, |
||||
|
'requiredCount': requiredCount, |
||||
|
'completeCount': completeCount, |
||||
|
'completeStatus': completeStatus, |
||||
|
'completeTime': completeTime, |
||||
|
'sort': sort, |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
class MatchmakerTask { |
||||
|
final String? userTaskCompleteId; |
||||
|
final int? taskGroup; |
||||
|
final int? taskType; |
||||
|
final int? stageCode; |
||||
|
final String? taskName; |
||||
|
final String? taskDesc; |
||||
|
final String? taskStartDate; |
||||
|
final String? taskEndDate; |
||||
|
final String? rewardValue; |
||||
|
final bool? completeStatus; |
||||
|
final int? rewardReceiveStatus; |
||||
|
final String? completeTime; |
||||
|
final List<SubListItem>? subList; |
||||
|
|
||||
|
MatchmakerTask({ |
||||
|
this.userTaskCompleteId, |
||||
|
this.taskGroup, |
||||
|
this.taskType, |
||||
|
this.stageCode, |
||||
|
this.taskName, |
||||
|
this.taskDesc, |
||||
|
this.taskStartDate, |
||||
|
this.taskEndDate, |
||||
|
this.rewardValue, |
||||
|
this.completeStatus, |
||||
|
this.rewardReceiveStatus, |
||||
|
this.completeTime, |
||||
|
this.subList, |
||||
|
}); |
||||
|
|
||||
|
factory MatchmakerTask.fromJson(Map<String, dynamic> json) { |
||||
|
return MatchmakerTask( |
||||
|
userTaskCompleteId: json['userTaskCompleteId'] as String?, |
||||
|
taskGroup: json['taskGroup'] as int?, |
||||
|
taskType: json['taskType'] as int?, |
||||
|
stageCode: json['stageCode'] as int?, |
||||
|
taskName: json['taskName'] as String?, |
||||
|
taskDesc: json['taskDesc'] as String?, |
||||
|
taskStartDate: json['taskStartDate'] as String?, |
||||
|
taskEndDate: json['taskEndDate'] as String?, |
||||
|
rewardValue: json['rewardValue'] as String?, |
||||
|
completeStatus: json['completeStatus'] as bool?, |
||||
|
rewardReceiveStatus: json['rewardReceiveStatus'] as int?, |
||||
|
completeTime: json['completeTime'] as String?, |
||||
|
subList: (json['subList'] as List<dynamic>?)?.map((e) => SubListItem.fromJson(e as Map<String, dynamic>)).toList() ?? [], |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
Map<String, dynamic> toJson() { |
||||
|
return { |
||||
|
'userTaskCompleteId': userTaskCompleteId, |
||||
|
'taskGroup': taskGroup, |
||||
|
'taskType': taskType, |
||||
|
'stageCode': stageCode, |
||||
|
'taskName': taskName, |
||||
|
'taskDesc': taskDesc, |
||||
|
'taskStartDate': taskStartDate, |
||||
|
'taskEndDate': taskEndDate, |
||||
|
'rewardValue': rewardValue, |
||||
|
'completeStatus': completeStatus, |
||||
|
'rewardReceiveStatus': rewardReceiveStatus, |
||||
|
'completeTime': completeTime, |
||||
|
'subList': subList?.map((e) => e.toJson()).toList(), |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save