Robo-advisory-dart/lib/models/transaction.dart

28 lines
633 B
Dart

class Category {
String name;
String color;
Category({this.name, this.color});
Category.formJson(Map<String, dynamic> map)
: name = map["name"],
color = map["color"];
}
class Transaction {
String amount;
String description;
String date;
String name;
Category category;
Transaction(
{this.amount, this.description, this.date, this.name, this.category});
Transaction.fromJson(Map<String, dynamic> map)
: category = Category.formJson(map["category"]),
amount = map["amount"],
description = map["description"],
name = map["name"],
date = map["date"];
}