prasule/lib/api/entry_data.dart

30 lines
740 B
Dart
Raw Normal View History

2024-06-30 20:25:36 +02:00
// SPDX-FileCopyrightText: (C) 2024 Matyáš Caras
//
// SPDX-License-Identifier: AGPL-3.0-only
import 'package:json_annotation/json_annotation.dart';
part 'entry_data.g.dart';
/// Contains raw data
@JsonSerializable()
class EntryData {
/// Contains raw data
EntryData({required this.name, required this.amount, this.description = ""});
2024-07-17 16:44:02 +02:00
/// Generates a class instance from a Map
factory EntryData.fromJson(Map<String, dynamic> json) =>
_$EntryDataFromJson(json);
/// Name of entry
String name;
/// Optional description, default is empty
String description;
/// Amount for entry
double amount;
2024-07-17 16:44:02 +02:00
/// Converts the data in this instance into a Map
Map<String, dynamic> toJson() => _$EntryDataToJson(this);
}