チームまでは表示できた。表示と更新及びメンバー編集不可。エントリー以降も表示不可。

This commit is contained in:
2024-07-27 09:46:00 +09:00
parent c81bcef4bc
commit 08ffc42cdd
24 changed files with 17083 additions and 9 deletions

View File

@ -0,0 +1,62 @@
// lib/pages/entry/entry_detail_page.dart
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/entry/entry_controller.dart';
class EntryDetailPage extends GetView<EntryController> {
@override
Widget build(BuildContext context) {
final Map<String, dynamic> arguments = Get.arguments ?? {};
final mode = Get.arguments['mode'] as String? ?? 'new';
final entry = Get.arguments['entry'];
return Scaffold(
appBar: AppBar(
title: Text(mode == 'new' ? 'エントリー登録' : 'エントリー詳細'),
),
body: Padding(
padding: EdgeInsets.all(16.0),
child: Obx(() => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DropdownButtonFormField(
decoration: InputDecoration(labelText: 'イベント'),
value: controller.selectedEvent.value,
items: controller.events.map((event) => DropdownMenuItem(
value: event,
child: Text(event.eventName),
)).toList(),
onChanged: (value) => controller.updateEvent(value),
),
DropdownButtonFormField(
decoration: InputDecoration(labelText: 'チーム'),
value: controller.selectedTeam.value,
items: controller.teams.map((team) => DropdownMenuItem(
value: team,
child: Text(team.teamName),
)).toList(),
onChanged: (value) => controller.updateTeam(value),
),
DropdownButtonFormField(
decoration: InputDecoration(labelText: 'カテゴリ'),
value: controller.selectedCategory.value,
items: controller.categories.map((category) => DropdownMenuItem(
value: category,
child: Text(category.categoryName),
)).toList(),
onChanged: (value) => controller.updateCategory(value),
),
// 日付選択ウィジェットを追加
if (mode == 'edit' && controller.isOwner())
ElevatedButton(
child: Text('エントリーを削除'),
onPressed: () => controller.deleteEntry(),
),
],
),
),
)
);
}
}