File size: 565 Bytes
b225a21 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import 'package:auto_gpt_flutter_client/models/pagination.dart';
import 'package:auto_gpt_flutter_client/models/task.dart';
class TaskResponse {
final List<Task> tasks;
final Pagination pagination;
TaskResponse({required this.tasks, required this.pagination});
factory TaskResponse.fromJson(Map<String, dynamic> json) {
return TaskResponse(
tasks: (json['tasks'] as List).map((taskJson) {
var task = Task.fromMap(taskJson);
return task;
}).toList(),
pagination: Pagination.fromJson(json['pagination']),
);
}
}
|