Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
wallet_model.dart
Go to the documentation of this file.
1import 'transaction_model.dart';
2
4 final String currency;
5 final String balance;
6 final List<TransactionModel> recentTransactions;
7
9 required this.currency,
10 required this.balance,
11 required this.recentTransactions,
12 });
13
14 factory WalletModel.fromJson(Map<String, dynamic> json) {
15 return WalletModel(
16 currency: json['currency'] as String,
17 balance: json['balance'] as String,
18 recentTransactions: (json['recentTransactions'] as List)
19 .map((transaction) => TransactionModel.fromJson(transaction))
20 .toList(),
21 );
22 }
23
24 Map<String, dynamic> toJson() {
25 return {
26 'currency': currency,
27 'balance': balance,
28 'recentTransactions': recentTransactions.map((transaction) => transaction.toJson()).toList(),
29 };
30 }
31}
32
34 currency: "USD",
35 balance: "3,000.00",
36 recentTransactions: [
38 date: "12-11-2023",
39 type: "Transfer received",
40 amount: 1000.00,
41 time: "07:36 AM",
42 isReceived: true
43 ),
45 date: "10-11-2023",
46 type: "Transfer sent",
47 amount: 850.00,
48 time: "09:39 am",
49 isReceived: false
50 ),
52 date: "09-11-2023",
53 type: "Transfer received",
54 amount: 1500.00,
55 time: "02:15 PM",
56 isReceived: true
57 ),
59 date: "08-11-2023",
60 type: "Transfer sent",
61 amount: 650.00,
62 time: "11:20 AM",
63 isReceived: false
64 ),
66 date: "07-11-2023",
67 type: "Transfer received",
68 amount: 2000.00,
69 time: "08:30 AM",
70 isReceived: true
71 ),
72 ]
73);
factory TransactionModel fromJson(Map< String, dynamic > json)
final String currency
final String balance
final List< TransactionModel > recentTransactions
Map< String, dynamic > toJson()
WalletModel({ required this.currency, required this.balance, required this.recentTransactions, })
final CurrencyEntity currency
class WalletModel walletMockData