| 1 | import 'package:cw_zano/api/model/transfer.dart'; |
| 2 | |
| 3 | class RecentHistory { |
| 4 | final List<Transfer>? history; |
| 5 | final int lastItemIndex; |
| 6 | final int totalHistoryItems; |
| 7 | |
| 8 | RecentHistory( |
| 9 | {required this.history, required this.lastItemIndex, required this.totalHistoryItems}); |
| 10 | |
| 11 | factory RecentHistory.fromJson(Map<String, dynamic> json) => RecentHistory( |
| 12 | history: json['history'] == null |
| 13 | ? null |
| 14 | : (json['history'] as List<dynamic>) |
| 15 | .map((e) => Transfer.fromJson(e as Map<String, dynamic>)) |
| 16 | .toList(), |
| 17 | lastItemIndex: json['last_item_index'] as int? ?? 0, |
| 18 | totalHistoryItems: json['total_history_items'] as int? ?? 0, |
| 19 | ); |
| 20 | } |