62 lines
2.3 KiB
Dart
62 lines
2.3 KiB
Dart
// 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(),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)
|
|
);
|
|
}
|
|
} |