kmobile/lib/data/models/transaction.dart
2025-06-02 10:29:32 +05:30

29 lines
638 B
Dart

class Transaction {
final String? id;
final String? name;
final String? date;
final int? amount;
final String? type;
Transaction({this.id, this.name, this.date, this.amount, this.type});
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'date': date,
'amount': amount,
'type': type,
};
}
factory Transaction.fromJson(Map<String, dynamic> json) {
return Transaction(
id: json['id'] as String?,
name: json['name'] as String?,
date: json['date'] as String?,
amount: json['amount'] as int?,
type: json['type'] as String?,
);
}
}