大幅変更&環境バージョンアップ

This commit is contained in:
2024-08-22 14:35:09 +09:00
parent 56e9861c7a
commit dc58dc0584
446 changed files with 29645 additions and 8315 deletions

50
lib/model/entry.dart Normal file
View File

@ -0,0 +1,50 @@
// lib/models/entry.dart
import 'event.dart';
import 'team.dart';
import 'category.dart';
class Entry {
final int id;
final Team team;
final Event event;
final NewCategory category;
final DateTime? date;
final int zekkenNumber; // 新しく追加
final String owner;
Entry({
required this.id,
required this.team,
required this.event,
required this.category,
required this.date,
required this.zekkenNumber,
required this.owner,
});
factory Entry.fromJson(Map<String, dynamic> json) {
return Entry(
id: json['id'],
team: Team.fromJson(json['team']),
event: Event.fromJson(json['event']),
category: NewCategory.fromJson(json['category']),
date: json['date'] != null
? DateTime.tryParse(json['date'])
: null,
zekkenNumber: json['zekken_number'], // 新しく追加
owner: json['owner'] is Map ? json['owner']['name'] ?? '' : json['owner'] ?? '',
);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'team': team.toJson(),
'event': event.toJson(),
'category': category.toJson(),
'date': date?.toIso8601String(),
'zekken_number': zekkenNumber, // 新しく追加
'owner': owner,
};
}
}