prasule/lib/api/wallet_entry.g.dart

44 lines
1.3 KiB
Dart
Raw Permalink Normal View History

2023-09-08 11:50:21 +02:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'wallet_entry.dart';
2023-09-08 11:50:21 +02:00
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
WalletSingleEntry _$WalletSingleEntryFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id'],
disallowNullValues: const ['id'],
);
return WalletSingleEntry(
data: json['data'] == null
? EntryData.unknown()
: EntryData.fromJson(json['data'] as Map<String, dynamic>),
type: $enumDecodeNullable(_$EntryTypeEnumMap, json['type']) ??
EntryType.expense,
date: json['date'] == null
? DateTime.now()
: DateTime.parse(json['date'] as String),
category: json['category'] == null
? WalletCategory.unknown()
: WalletCategory.fromJson(json['category'] as Map<String, dynamic>),
id: (json['id'] as num).toInt(),
);
}
2023-09-08 11:50:21 +02:00
Map<String, dynamic> _$WalletSingleEntryToJson(WalletSingleEntry instance) =>
2023-09-08 11:50:21 +02:00
<String, dynamic>{
'type': _$EntryTypeEnumMap[instance.type]!,
'data': instance.data,
2023-09-08 11:50:21 +02:00
'date': instance.date.toIso8601String(),
'category': instance.category,
2023-09-14 19:44:34 +02:00
'id': instance.id,
2023-09-08 11:50:21 +02:00
};
const _$EntryTypeEnumMap = {
EntryType.expense: 'expense',
EntryType.income: 'income',
};