mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
feat: coin log
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
15
lib/models_new/coin_log/data.dart
Normal file
15
lib/models_new/coin_log/data.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:PiliPlus/models_new/coin_log/list.dart';
|
||||
|
||||
class CoinLogData {
|
||||
List<CoinLogItem>? list;
|
||||
int? count;
|
||||
|
||||
CoinLogData({this.list, this.count});
|
||||
|
||||
factory CoinLogData.fromJson(Map<String, dynamic> json) => CoinLogData(
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => CoinLogItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
count: json['count'] as int?,
|
||||
);
|
||||
}
|
||||
14
lib/models_new/coin_log/list.dart
Normal file
14
lib/models_new/coin_log/list.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
class CoinLogItem {
|
||||
final String time;
|
||||
final String delta;
|
||||
final String reason;
|
||||
|
||||
const CoinLogItem(
|
||||
{required this.time, required this.delta, required this.reason});
|
||||
|
||||
factory CoinLogItem.fromJson(Map<String, dynamic> json) => CoinLogItem(
|
||||
time: json['time'],
|
||||
delta: (json['delta'] as num).toString(),
|
||||
reason: json['reason'],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user