Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Add Pagination Model for API Responses

hunteraraujoe3200d87ba6d
diff --git a/lib/models/pagination.dart b/lib/models/pagination.dart
new file mode 100644
index 0000000000..cac391c928
--- /dev/null
+++ b/lib/models/pagination.dart
@@ -0,0 +1,22 @@
+class Pagination {
+ final int totalItems;
+ final int totalPages;
+ final int currentPage;
+ final int pageSize;
+
+ Pagination({
+ required this.totalItems,
+ required this.totalPages,
+ required this.currentPage,
+ required this.pageSize,
+ });
+
+ factory Pagination.fromJson(Map<String, dynamic> json) {
+ return Pagination(
+ totalItems: json['total_items'],
+ totalPages: json['total_pages'],
+ currentPage: json['current_page'],
+ pageSize: json['page_size'],
+ );
+ }
+}