Skip to content
Snippets Groups Projects
Commit 30a51594 authored by Florian Schindler's avatar Florian Schindler
Browse files

transaction and category models

parent e88ec4f5
No related branches found
No related tags found
No related merge requests found
import 'package:flutter/material.dart';
class Category {
String title;
IconData icon;
Color color;
Category({
required this.title,
required this.icon,
required this.color
});
factory Category.fromJson(Map<String, dynamic> parsedJson) {
return Category(
title: parsedJson['title'],
icon: parsedJson['icon'],
color: parsedJson['color']
);
}
}
import 'package:trackeroo/logic/models/category.dart';
class Transaction {
String title;
double amount;
Category category;
Transaction({
required this.title,
required this.amount,
required this.category
});
factory Transaction.fromJson(Map<String, dynamic> parsedJson) {
return Transaction(
title: parsedJson['title'],
amount: parsedJson['amount'],
category: parsedJson['category']
);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment