prasule/lib/api/debt_entry.g.dart

32 lines
971 B
Dart
Raw Permalink Normal View History

2024-07-17 16:44:02 +02:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'debt_entry.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
DebtEntry _$DebtEntryFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id'],
disallowNullValues: const ['id'],
);
return DebtEntry(
id: (json['id'] as num).toInt(),
amount: (json['amount'] as num?)?.toInt() ?? 0,
name: json['name'] as String? ?? 'Unknown',
whoPayed: (json['whoPayed'] as List<dynamic>?)
?.map((e) => DebtPerson.fromJson(e as Map<String, dynamic>))
.toList() ??
_defaultDebtPayers(),
);
}
2024-07-17 16:44:02 +02:00
Map<String, dynamic> _$DebtEntryToJson(DebtEntry instance) => <String, dynamic>{
'id': instance.id,
'amount': instance.amount,
'name': instance.name,
'whoPayed': instance.whoPayed,
};