prasule/lib/api/entry.dart
2023-09-08 11:50:21 +02:00

28 lines
736 B
Dart

import 'package:prasule/api/category.dart';
import 'package:json_annotation/json_annotation.dart';
part 'entry.g.dart';
@JsonSerializable()
class WalletEntry {
EntryType type;
String name;
double amount;
DateTime date;
WalletCategory category;
WalletEntry(
{required this.name,
required this.amount,
required this.type,
required this.date,
required this.category});
/// Connect the generated [_$WalletEntry] function to the `fromJson`
/// factory.
factory WalletEntry.fromJson(Map<String, dynamic> json) =>
_$WalletEntryFromJson(json);
/// Connect the generated [_$PersonToJson] function to the `toJson` method.
Map<String, dynamic> toJson() => _$WalletEntryToJson(this);
}