import 'package:prasule/api/category.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:prasule/api/entry_data.dart'; part 'walletentry.g.dart'; @JsonSerializable() /// This is an entry containing a single item class WalletSingleEntry { EntryType type; EntryData data; DateTime date; WalletCategory category; int id; WalletSingleEntry( {required this.data, required this.type, required this.date, required this.category, required this.id}); /// Connect the generated [_$WalletEntry] function to the `fromJson` /// factory. factory WalletSingleEntry.fromJson(Map json) => _$WalletSingleEntryFromJson(json); /// Connect the generated [_$WalletEntryToJson] function to the `toJson` method. Map toJson() => _$WalletSingleEntryToJson(this); }