2023-10-09 17:28:05 +02:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'entry_data.g.dart';
|
|
|
|
|
2023-12-29 21:39:54 +01:00
|
|
|
/// Contains raw data
|
2023-10-09 17:28:05 +02:00
|
|
|
@JsonSerializable()
|
|
|
|
class EntryData {
|
2023-12-29 21:39:54 +01:00
|
|
|
/// Contains raw data
|
2023-11-01 17:58:05 +01:00
|
|
|
EntryData({required this.name, required this.amount, this.description = ""});
|
2023-10-09 17:28:05 +02:00
|
|
|
|
2023-12-31 12:41:10 +01:00
|
|
|
/// Connects generated fromJson method
|
2023-10-09 17:28:05 +02:00
|
|
|
factory EntryData.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$EntryDataFromJson(json);
|
|
|
|
|
2023-12-29 21:39:54 +01:00
|
|
|
/// Name of entry
|
|
|
|
String name;
|
|
|
|
|
|
|
|
/// Optional description, default is empty
|
|
|
|
String description;
|
|
|
|
|
|
|
|
/// Amount for entry
|
|
|
|
double amount;
|
|
|
|
|
2023-12-31 12:41:10 +01:00
|
|
|
/// Connects generated toJson method
|
2023-10-09 17:28:05 +02:00
|
|
|
Map<String, dynamic> toJson() => _$EntryDataToJson(this);
|
|
|
|
}
|