Team,Member, Entryの登録まで完了

This commit is contained in:
2024-07-29 08:41:28 +09:00
parent 7f8adeea01
commit 9c98d3ed53
10 changed files with 803 additions and 260 deletions

View File

@ -9,7 +9,7 @@ class Entry {
final Team team;
final Event event;
final NewCategory category;
final DateTime date;
final DateTime? date;
final String owner;
Entry({
@ -27,8 +27,10 @@ class Entry {
team: Team.fromJson(json['team']),
event: Event.fromJson(json['event']),
category: NewCategory.fromJson(json['category']),
date: DateTime.parse(json['date']),
owner: json['owner'],
date: json['date'] != null
? DateTime.tryParse(json['date'])
: null,
owner: json['owner'] is Map ? json['owner']['name'] ?? '' : json['owner'] ?? '',
);
}
@ -38,7 +40,7 @@ class Entry {
'team': team.toJson(),
'event': event.toJson(),
'category': category.toJson(),
'date': date.toIso8601String(),
'date': date?.toIso8601String(),
'owner': owner,
};
}