feat : Modèle avec sérialisation automatique

This commit is contained in:
Yaël Perret
2026-05-05 21:52:13 +02:00
parent 93a54ae19b
commit d88b32d8f2
13 changed files with 404 additions and 89 deletions

26
lib/models/event.g.dart Normal file
View File

@@ -0,0 +1,26 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'event.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Event _$EventFromJson(Map<String, dynamic> json) => Event(
name: json['name'] as String,
picture: json['picture'] as String,
organizer: json['organizer'] as String,
date:
json['date'] == null ? null : DateTime.parse(json['date'] as String),
place: json['place'] as String?,
isFavorite: json['isFavorite'] as bool? ?? false,
);
Map<String, dynamic> _$EventToJson(Event instance) => <String, dynamic>{
'name': instance.name,
'picture': instance.picture,
'organizer': instance.organizer,
'place': instance.place,
'date': instance.date?.toIso8601String(),
'isFavorite': instance.isFavorite,
};