stacked bar graph, edit / remove transaction & budget page base
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class Transaction {
|
||||
String uuid;
|
||||
DateTime date;
|
||||
String category;
|
||||
String description;
|
||||
@@ -6,6 +9,7 @@ class Transaction {
|
||||
double value;
|
||||
|
||||
Transaction({
|
||||
required this.uuid,
|
||||
required this.date,
|
||||
required this.category,
|
||||
required this.description,
|
||||
@@ -15,6 +19,7 @@ class Transaction {
|
||||
|
||||
factory Transaction.fromJson(Map<String, dynamic> json) {
|
||||
return Transaction(
|
||||
uuid: json['uuid'] ?? const Uuid().v8(),
|
||||
date: DateTime.parse(json['date']),
|
||||
category: json['category'],
|
||||
description: json['description'],
|
||||
@@ -24,6 +29,7 @@ class Transaction {
|
||||
}
|
||||
|
||||
Map<String, String> toJson() => {
|
||||
'uuid': uuid,
|
||||
'date': date.toIso8601String(),
|
||||
'category': category,
|
||||
'description': description,
|
||||
|
||||
Reference in New Issue
Block a user