51 lines
1.2 KiB
Dart
51 lines
1.2 KiB
Dart
class ClientRecord {
|
|
const ClientRecord({
|
|
required this.identity,
|
|
required this.title,
|
|
required this.subtitle,
|
|
required this.raw,
|
|
this.status,
|
|
});
|
|
|
|
final String identity;
|
|
final String title;
|
|
final String subtitle;
|
|
final int? status;
|
|
final Map<String, Object?> raw;
|
|
}
|
|
|
|
class UserProfile {
|
|
const UserProfile({
|
|
required this.identity,
|
|
required this.name,
|
|
required this.phone,
|
|
required this.avatar,
|
|
});
|
|
|
|
final String identity;
|
|
final String name;
|
|
final String phone;
|
|
final String avatar;
|
|
|
|
factory UserProfile.fromJson(Map<String, Object?> json) => UserProfile(
|
|
identity: json['identity'] as String? ?? '',
|
|
name: json['name'] as String? ?? '',
|
|
phone: json['phone'] as String? ?? '',
|
|
avatar: json['avatar'] as String? ?? '',
|
|
);
|
|
}
|
|
|
|
class WalletSummary {
|
|
const WalletSummary({required this.balance, required this.withdrawalBalance});
|
|
|
|
final int balance;
|
|
final int withdrawalBalance;
|
|
|
|
factory WalletSummary.fromJson(Map<String, Object?> json) => WalletSummary(
|
|
balance: (json['balance'] as num?)?.toInt() ?? 0,
|
|
withdrawalBalance: (json['withdrawal_balance'] as num?)?.toInt() ?? 0,
|
|
);
|
|
}
|
|
|
|
String moneyText(int cents) => '¥${(cents / 100).toStringAsFixed(2)}';
|