mirror of
https://github.com/m5stack/StackChan.git
synced 2026-04-28 03:22:39 +00:00
6314188835
- align Android/iOS native bridge implementations and audio handling paths - improve Bluetooth provisioning/verification flow and related error handling - refactor WebSocket, music, and device utility logic for more stable behavior - clean up noisy debug logs and normalize comments across Flutter and native code - update AR view, dance/agent/device pages, and platform integration details
53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
/*
|
||
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||
SPDX-License-Identifier: MIT
|
||
*/
|
||
|
||
class Pagination {
|
||
int? total;
|
||
int? current;
|
||
int? pageSize;
|
||
bool? hasMore;
|
||
int? page;
|
||
int? limit;
|
||
int? totaPages; //:fieldiserror,is totalPages
|
||
|
||
//Constructorfunction
|
||
Pagination({
|
||
this.total,
|
||
this.current,
|
||
this.pageSize,
|
||
this.hasMore,
|
||
this.page,
|
||
this.limit,
|
||
this.totaPages,
|
||
});
|
||
|
||
//fromJSONparse
|
||
factory Pagination.fromJson(Map<String, dynamic> json) {
|
||
return Pagination(
|
||
total: json['total'] as int?,
|
||
current: json['current'] as int?,
|
||
pageSize: json['pageSize'] as int?,
|
||
hasMore: json['hasMore'] as bool?,
|
||
page: json['page'] as int?,
|
||
limit: json['limit'] as int?,
|
||
totaPages:
|
||
json['totaPages'] as int? ?? json['totalPages'] as int?, //field
|
||
);
|
||
}
|
||
|
||
//convertasJSON
|
||
Map<String, dynamic> toJson() {
|
||
final Map<String, dynamic> data = <String, dynamic>{};
|
||
if (total != null) data['total'] = total;
|
||
if (current != null) data['current'] = current;
|
||
if (pageSize != null) data['pageSize'] = pageSize;
|
||
if (hasMore != null) data['hasMore'] = hasMore;
|
||
if (page != null) data['page'] = page;
|
||
if (limit != null) data['limit'] = limit;
|
||
if (totaPages != null) data['totaPages'] = totaPages;
|
||
return data;
|
||
}
|
||
}
|