114
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
final formatter = DateFormat('dd.MM.yyyy');
|
||||
const uuid = Uuid();
|
||||
|
||||
enum Category { foot, travel, leisure, work }
|
||||
|
||||
const categoryIcons = {
|
||||
Category.foot: Icons.lunch_dining,
|
||||
Category.travel: Icons.flight_takeoff,
|
||||
Category.leisure: Icons.movie,
|
||||
Category.work: Icons.work,
|
||||
};
|
||||
|
||||
class Expense {
|
||||
Expense({
|
||||
required this.title,
|
||||
required this.amount,
|
||||
required this.date,
|
||||
required this.category,
|
||||
}) : id = uuid.v4();
|
||||
|
||||
final String id;
|
||||
final String title;
|
||||
final double amount;
|
||||
final DateTime date;
|
||||
final Category category;
|
||||
|
||||
String get formattedDate {
|
||||
return formatter.format(date);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user