Skip to content

Commit

Permalink
feat(quest): クエスト詳細ページに表示する要素を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Jun 30, 2024
1 parent 1a0311f commit fbdedb9
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 3 deletions.
60 changes: 60 additions & 0 deletions feature/quest/lib/src/gen/l10n/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions feature/quest/lib/src/gen/l10n/l10n_en.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions feature/quest/lib/src/gen/l10n/l10n_ja.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions feature/quest/lib/src/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
"questListAppBarTitle": "Quests",
"questListAddQuest": "Add Quest",
"questDetailAppBarTitle": "Quest",
"questDetailContentBegunAtLabel": "Begun At",
"questDetailContentBegunAtEmptyText": "Not set",
"questDetailContentEndedAtLabel": "Ended At",
"questDetailContentEndedAtEmptyText": "Not set",
"questDetailContentCategoryLabel": "Category",
"questDetailContentCategoryEmptyText": "Not set",
"questDetailContentStatusLabel": "Status",
"questDetailContentStatusEmptyText": "Not set",
"questDetailContentNoteLabel": "Note",
"questDetailContentNoteEmptyText": "Not set",
"questAddAppBarTitle": "Add Quest",
"questAddFormTitleLabel": "Title",
"questAddFormTitleEmptyErrorMessage": "Please enter a title",
Expand Down
10 changes: 10 additions & 0 deletions feature/quest/lib/src/l10n/app_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
"questListAppBarTitle": "クエスト",
"questListAddQuest": "クエストを追加する",
"questDetailAppBarTitle": "クエスト",
"questDetailContentBegunAtLabel": "開始日時",
"questDetailContentBegunAtEmptyText": "設定されていません",
"questDetailContentEndedAtLabel": "終了日時",
"questDetailContentEndedAtEmptyText": "設定されていません",
"questDetailContentCategoryLabel": "カテゴリ",
"questDetailContentCategoryEmptyText": "設定されていません",
"questDetailContentStatusLabel": "ステータス",
"questDetailContentStatusEmptyText": "設定されていません",
"questDetailContentNoteLabel": "ノート",
"questDetailContentNoteEmptyText": "設定されていません",
"questAddAppBarTitle": "クエストを追加",
"questAddFormTitleLabel": "タイトル",
"questAddFormTitleEmptyErrorMessage": "タイトルを入力してください",
Expand Down
61 changes: 58 additions & 3 deletions feature/quest/lib/src/ui/page/detail/component/quest_content.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:core_designsystem/component.dart';
import 'package:core_domain/quest_use_case.dart';
import 'package:core_model/quest.dart';
import 'package:feature_quest/src/gen/l10n/l10n.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

Expand All @@ -14,6 +16,8 @@ final class QuestContent extends HookConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final l10n = L10n.of(context);

final provider = questStreamByIdUseCaseProvider(id: _questId);
final quest = ref.watch(provider);

Expand All @@ -37,12 +41,63 @@ final class QuestContent extends HookConsumerWidget {
fontWeight: FontWeight.bold,
),
),
Text(quest.description),
Text(quest.note),
// カバー画像
if (quest.coverImageUrl != null)
ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(quest.coverImageUrl!),
),

// 説明
if (quest.description.isNotEmpty) Text(quest.description),

// 開始日時
...[
const Gap(8),
Text(l10n.questDetailContentBegunAtLabel),
if (quest.begunAt != null)
Text(quest.begunAt!.toIso8601String())
else
Text(l10n.questDetailContentBegunAtEmptyText),
],

// 終了日時
...[
const Gap(8),
Text(l10n.questDetailContentEndedAtLabel),
if (quest.endedAt != null)
Text(quest.endedAt!.toIso8601String())
else
Text(l10n.questDetailContentEndedAtEmptyText),
],

// カテゴリ
...[
const Gap(8),
Text(l10n.questDetailContentCategoryLabel),
if (quest.categoryId != null)
Text(quest.categoryId!)
else
Text(l10n.questDetailContentCategoryEmptyText),
],

// ステータス
...[
const Gap(8),
Text(l10n.questDetailContentStatusLabel),
Text(quest.status.name),
],

// ノート
...[
const Gap(8),
Text(l10n.questDetailContentNoteLabel),
Text(quest.note),
],
].expand(
(element) => [
element,
const SizedBox(height: 16),
const Gap(8),
],
),
],
Expand Down

0 comments on commit fbdedb9

Please sign in to comment.